結果
問題 | No.2252 Find Zero |
ユーザー | tails |
提出日時 | 2023-03-24 23:31:36 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 62 ms / 2,000 ms |
コード長 | 284 bytes |
コンパイル時間 | 714 ms |
コンパイル使用メモリ | 20,224 KB |
実行使用メモリ | 25,196 KB |
平均クエリ数 | 195.33 |
最終ジャッジ日時 | 2024-09-18 17:39:37 |
合計ジャッジ時間 | 2,684 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 50 ms
24,812 KB |
testcase_01 | AC | 60 ms
24,940 KB |
testcase_02 | AC | 55 ms
25,196 KB |
testcase_03 | AC | 58 ms
24,812 KB |
testcase_04 | AC | 49 ms
25,196 KB |
testcase_05 | AC | 45 ms
24,940 KB |
testcase_06 | AC | 53 ms
24,812 KB |
testcase_07 | AC | 49 ms
25,196 KB |
testcase_08 | AC | 57 ms
24,580 KB |
testcase_09 | AC | 62 ms
24,836 KB |
testcase_10 | AC | 48 ms
24,812 KB |
testcase_11 | AC | 46 ms
24,800 KB |
testcase_12 | AC | 43 ms
24,812 KB |
testcase_13 | AC | 45 ms
25,184 KB |
testcase_14 | AC | 45 ms
24,892 KB |
testcase_15 | AC | 44 ms
24,812 KB |
testcase_16 | AC | 42 ms
24,940 KB |
testcase_17 | AC | 43 ms
24,812 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("%d",&n); | ^~~~~ 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("%d",&n); | ^~~~~ main.c:3:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:4:12: warning: implicit declaration of function ‘fork’ [-Wimplicit-function-declaration] 4 | if(fork()){ | ^~~~ main.c:16:17: warning: implicit declaration of function ‘wait’ [-Wimplicit-function-declaration] 16 | wait(0); | ^~~~ main.c:17:17: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 17 | printf("! %d\n",a); | ^~~~~~ main.c:17:17: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:17:17: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:17:17: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:20:25: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] 20 | printf("? %d %d\n",i,i+1); | ^~~~~~ main.c:20:25: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
ソースコード
main(){ int n; scanf("%d",&n); if(fork()){ int a=0; for(int i=n;i-=2,i>=0;){ int z=0; scanf("%d",&z); if(z==i){ a=i+1; } if(z==i+1){ a=i; } } wait(0); printf("! %d\n",a); }else{ for(int i=n;i-=2,i>=0;){ printf("? %d %d\n",i,i+1); } } }