2012/4/16

Google Code Jam 2012 資格賽 第三題 Problem C. RecycledNumbers

Smail Set 一次 10分。

Large Set 兩次 0分。

 

// RecycledNumbers.cpp : Defines the entry point for the console application.

//

#include "stdafx.h"

#include "string.h"

 

void main()

{     

        int line, len, i, n, k, x, A, B, m, head, tail, pow, pow2, ans, cnt, dup;      

        char str[8];

 

        scanf("%d\n\r", &line);   

        for(i=0;i<line;i++) {         

                scanf("%d %d", &A, &B);              

                ans=0;             

                for(n=A;n<=B;n++)

                {     

                        //printf("%d => ", n);

                        sprintf(str,"%d",n);

                        len = strlen(str);                       

                        tail = n;

                        pow = 1;

                        pow2 = 1;

                        for(x = 0; x<len; x++) {

                                pow2 *= 10;

                        }     

                        cnt = 0;

                        dup = 1;

                        if( len == 4 && (n%100 == n/100) ) {

                                dup=2;

                        }

                        if( len == 6 && (n%1000 == n/1000) ) {

                                dup=2;

                        }

                        if( len == 6 && (n%100 == (n/100)%100) && (n%100 == (n/10000))) {

                                dup=3;

                        }

                        for(k=1;k<len;k++) {

                                tail /= 10;

                                pow *= 10;                             

                                pow2 /= 10;

                                head = (n % pow)*pow2;

                                m = head + tail;

                                if( A<=n && n<m && m<=B ) {

                                        //printf("%d ",m);

                                        cnt++;

                                }                                     

                        }     

                        ans += cnt/dup;

                        //printf("\n");

                }

                printf("Case #%d: ", i+1);

                printf("%d\n", ans);

        }             

}

Google Code Jam 2012 資格賽 第一題 Problem A. Speaking in Tongues

#include "stdafx.h"
#include "string.h"

int main(int argc, char* argv[])
{
char map[] = "yhesocvxduiglbkrztnwjpfmaq";
int line, i;
char c;

scanf("%d\n\r", &line);
for(i=0;i<line;i++) {
printf("Case #%d: ", i+1);
while(scanf("%c",&c) == 1 && c != '\n')
{
printf("%c",c==' '?' ':map[c-'a']);
}
printf("\n");
}
return 0;
}

2012/4/11

MOD已經擺脫過去負面形像了!

中時電子報:媒體收視滿意度MOD追上  http://news.chinatimes.com/tech/11050904/122012041000382.html

可見MOD已經擺脫過去負面形像了!

目前由於新、舊平台轉換青黃不接,新、舊平台服務差異:新平台目前暫未提供VOD18+、歡唱坊(無麥克風插孔)、金融理財(無金融卡插槽) 服務及台互、靖天SVOD服務,預計5月份可陸續推出服務。

spring

Rem ==========以下是按鍵精靈錄製的內容==========
MoveTo 727,409
LeftClick 1
Delay 5875
LeftClick 1
MoveTo 902,619
Delay 5172
LeftClick 1
MoveTo 817,575
Delay 3093
LeftClick 1
MoveTo 717,419
Delay 11965
LeftClick 1
Delay 6172
LeftDown 1
LeftClick 1
LeftUp 1
Rem ==========以上是按鍵精靈錄製的內容==========