結果
問題 | No.1286 Stone Skipping |
ユーザー | tails |
提出日時 | 2020-11-13 22:00:49 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 279 bytes |
コンパイル時間 | 344 ms |
コンパイル使用メモリ | 28,800 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-23 09:52:37 |
合計ジャッジ時間 | 1,113 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,816 KB |
testcase_01 | AC | 1 ms
6,944 KB |
testcase_02 | AC | 1 ms
6,940 KB |
testcase_03 | AC | 1 ms
6,944 KB |
testcase_04 | AC | 1 ms
6,940 KB |
testcase_05 | AC | 1 ms
6,940 KB |
testcase_06 | AC | 1 ms
6,940 KB |
testcase_07 | AC | 1 ms
6,940 KB |
testcase_08 | AC | 1 ms
6,940 KB |
testcase_09 | AC | 1 ms
6,940 KB |
testcase_10 | AC | 1 ms
6,944 KB |
testcase_11 | AC | 1 ms
6,940 KB |
testcase_12 | AC | 1 ms
6,944 KB |
testcase_13 | AC | 1 ms
6,944 KB |
testcase_14 | AC | 1 ms
6,940 KB |
testcase_15 | AC | 1 ms
6,940 KB |
testcase_16 | AC | 1 ms
6,944 KB |
testcase_17 | AC | 1 ms
6,944 KB |
testcase_18 | AC | 1 ms
6,940 KB |
testcase_19 | AC | 1 ms
6,940 KB |
testcase_20 | AC | 1 ms
6,940 KB |
testcase_21 | AC | 1 ms
6,944 KB |
testcase_22 | AC | 1 ms
6,944 KB |
testcase_23 | AC | 1 ms
6,940 KB |
testcase_24 | AC | 1 ms
6,940 KB |
testcase_25 | AC | 1 ms
6,940 KB |
testcase_26 | AC | 1 ms
6,940 KB |
testcase_27 | AC | 1 ms
6,944 KB |
testcase_28 | AC | 1 ms
6,940 KB |
コンパイルメッセージ
main.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int] 1 | main(){ | ^~~~ main.c: In function 'main': main.c:3:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | scanf("%ld",&d); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main(){ main.c:3:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 3 | scanf("%ld",&d); | ^~~~~ main.c:3:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:18:33: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 18 | printf("%ld",m); | ^~~~~~ main.c:18:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:18:33: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:18:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:19:33: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 19 | exit(0); | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | main(){ main.c:19:33: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 19 | exit(0); | ^~~~ main.c:19:33: note: include '<stdlib.h>' or provide a declaration of 'exit'
ソースコード
main(){ long d; scanf("%ld",&d); int k=63; while(1){ long l=0,r=1e18; while(l+1<r){ long m=l+r>>1; long x=0; for(int i=0;i<k;++i){ x+=m>>i; } if(x<d){ l=m; }else if(x>d){ r=m; }else{ printf("%ld",m); exit(0); } } --k; } }