結果
問題 | No.1837 Same but Different |
ユーザー | tails |
提出日時 | 2022-05-12 21:08:09 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 456 bytes |
コンパイル時間 | 734 ms |
コンパイル使用メモリ | 28,160 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 15:27:28 |
合計ジャッジ時間 | 2,292 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 2 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 2 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | AC | 1 ms
5,376 KB |
testcase_15 | AC | 1 ms
5,376 KB |
testcase_16 | AC | 1 ms
5,376 KB |
testcase_17 | AC | 1 ms
5,376 KB |
testcase_18 | AC | 1 ms
5,376 KB |
testcase_19 | AC | 1 ms
5,376 KB |
testcase_20 | AC | 1 ms
5,376 KB |
testcase_21 | AC | 1 ms
5,376 KB |
testcase_22 | AC | 1 ms
5,376 KB |
testcase_23 | AC | 1 ms
5,376 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",&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("%ld",&n); | ^~~~~ main.c:3:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:5:25: warning: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 5 | if(n==3)puts("0 1 11 3 4 5"); | ^~~~ main.c:5:25: note: include '<stdio.h>' or provide a declaration of 'puts' main.c:9:17: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 9 | exit(0); | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | main(){ main.c:9:17: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 9 | exit(0); | ^~~~ main.c:9:17: note: include '<stdlib.h>' or provide a declaration of 'exit' main.c:19:17: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 19 | printf("%ld ",x+=x==m?6:3); | ^~~~~~ main.c:19:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:19:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:19:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:24:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mism
ソースコード
main(){ long n; scanf("%ld",&n); if(n<7){ if(n==3)puts("0 1 11 3 4 5"); if(n==4)puts("0 1 2 19 4 5 6 7"); if(n==5)puts("0 1 2 3 34 6 7 8 9 10"); if(n==6)puts("0 1 2 3 4 53 8 9 10 11 12 13"); exit(0); } // A if(n%3==0)puts("0 3"); if(n%3==1)puts("1 3"); if(n%3==2)puts("1 4"); long m=(n*2-7)/3*3; long x=9; long e=n*3+6; while(x<e){ printf("%ld ",x+=x==m?6:3); } // B long y=4; for(long i=0;i<n;++i){ printf("%ld ",y+=3); } }