CODE FESTIVAL 2016 Grand Final

Submission #3932858

Source codeソースコード

c,i,k[30],x;main(n){for(;~scanf("%d",&i);)k[__builtin_ctz(i)]=--n&&(x^=i);for(i=30;i--;x&n&&(c++,x=~x&n-1))n=k[i]<<i;printf("%d",x?-1:c);}

Submission

Task問題 C - Cheating Nim
User nameユーザ名 kotatsugame
Created time投稿日時
Language言語 C (GCC 5.4.1)
Status状態 WA
Score得点 0
Source lengthソースコード長 138 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./Main.c:1:1: warning: data definition has no type or storage class
c,i,k[30],x;main(n){for(;~scanf("%d",&i);)k[__builtin_ctz(i)]=--n&&(x^=i);for(i=30;i--;x&n&&(c++,x=~x&n-1))n=k[i]<<i;printf("%d",x?-1:c);}
^
./Main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘c’ [-Wimplicit-int]
./Main.c:1:3: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
c,i,k[30],x;main(n){for(;~scanf("%d",&i);)k[__builtin_ctz(i)]=--n&&(x^=i);for(i=30;i--;x&n&&(c++,x=~x&n-1))n=k[i]<<i;printf("%d",x?-1:c);}
^
./Main.c:1:5: warning: type defaults to ‘int’ in declaration of ‘k’ [-Wimplicit-int]
c,i,k[30],x;main(n){for(;~scanf("%d",&i);)k[__builtin_ctz(i)]=--n&&(x^=i);for(i=30;i--;x&n&&(c++,x=~x&n-1))n=k[i]<<i;printf("%d",x?-1:c);}
^
./Main.c:1:11: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int]
c,i,k[30],x;main(n){for(;~scanf("%d",&i);)k[__builtin_ctz(i)]=--n&&(x^=i);for(i=30;i--;x&n&&(c++,x=~x&n-1))n=k[i]<<i;printf("%d",x?-1:c);}
^
./Main.c:1:13: warning: ret...

Test case

Set

Set name Score得点 / Max score Cases
Sample - example0.txt,example1.txt
All 0 / 500 000.txt,001.txt,002.txt,003.txt,004.txt,005.txt,006.txt,007.txt,008.txt,009.txt,010.txt,011.txt,012.txt,013.txt,014.txt,015.txt,016.txt,017.txt,018.txt,019.txt,020.txt,021.txt,022.txt,023.txt,example0.txt,example1.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
000.txt AC 1 ms 128 KB
001.txt AC 1 ms 128 KB
002.txt AC 12 ms 128 KB
003.txt AC 5 ms 128 KB
004.txt WA
005.txt WA
006.txt AC 12 ms 128 KB
007.txt AC 12 ms 128 KB
008.txt AC 12 ms 128 KB
009.txt AC 12 ms 128 KB
010.txt AC 12 ms 128 KB
011.txt AC 12 ms 128 KB
012.txt AC 12 ms 128 KB
013.txt AC 12 ms 128 KB
014.txt AC 12 ms 128 KB
015.txt AC 12 ms 128 KB
016.txt WA
017.txt WA
018.txt AC 12 ms 128 KB
019.txt AC 12 ms 128 KB
020.txt WA
021.txt WA
022.txt AC 2 ms 128 KB
023.txt AC 12 ms 128 KB
example0.txt AC 1 ms 128 KB
example1.txt AC 1 ms 128 KB