結果
問題 | No.1017 Reiwa Sequence |
ユーザー | tails |
提出日時 | 2020-11-01 03:54:32 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 13 ms / 2,000 ms |
コード長 | 727 bytes |
コンパイル時間 | 368 ms |
コンパイル使用メモリ | 34,060 KB |
実行使用メモリ | 9,728 KB |
最終ジャッジ日時 | 2024-07-22 05:38:01 |
合計ジャッジ時間 | 30,619 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,816 KB |
testcase_01 | AC | 1 ms
6,816 KB |
testcase_02 | AC | 1 ms
6,940 KB |
testcase_03 | AC | 2 ms
6,940 KB |
testcase_04 | AC | 1 ms
6,944 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,944 KB |
testcase_09 | AC | 3 ms
6,944 KB |
testcase_10 | AC | 2 ms
6,944 KB |
testcase_11 | AC | 3 ms
6,940 KB |
testcase_12 | AC | 5 ms
6,944 KB |
testcase_13 | AC | 5 ms
6,940 KB |
testcase_14 | AC | 3 ms
6,944 KB |
testcase_15 | AC | 4 ms
6,940 KB |
testcase_16 | AC | 3 ms
6,940 KB |
testcase_17 | AC | 6 ms
6,944 KB |
testcase_18 | AC | 4 ms
6,944 KB |
testcase_19 | AC | 13 ms
8,960 KB |
testcase_20 | AC | 12 ms
8,960 KB |
testcase_21 | AC | 12 ms
9,216 KB |
testcase_22 | AC | 13 ms
9,088 KB |
testcase_23 | AC | 12 ms
9,088 KB |
testcase_24 | AC | 13 ms
9,088 KB |
testcase_25 | AC | 13 ms
8,704 KB |
testcase_26 | AC | 12 ms
8,576 KB |
testcase_27 | AC | 9 ms
7,936 KB |
testcase_28 | AC | 8 ms
7,936 KB |
testcase_29 | AC | 7 ms
7,552 KB |
testcase_30 | AC | 7 ms
6,940 KB |
testcase_31 | AC | 7 ms
6,944 KB |
testcase_32 | AC | 4 ms
6,944 KB |
testcase_33 | AC | 2 ms
6,944 KB |
testcase_34 | AC | 1 ms
6,940 KB |
testcase_35 | AC | 10 ms
8,448 KB |
testcase_36 | AC | 2 ms
6,944 KB |
testcase_37 | AC | 1 ms
6,940 KB |
testcase_38 | AC | 9 ms
7,936 KB |
testcase_39 | AC | 6 ms
6,940 KB |
testcase_40 | AC | 4 ms
6,944 KB |
testcase_41 | AC | 2 ms
6,940 KB |
testcase_42 | AC | 3 ms
6,944 KB |
testcase_43 | AC | 2 ms
6,940 KB |
testcase_44 | AC | 1 ms
6,944 KB |
testcase_45 | AC | 2 ms
6,944 KB |
testcase_46 | AC | 1 ms
6,944 KB |
testcase_47 | AC | 1 ms
6,944 KB |
testcase_48 | AC | 3 ms
6,940 KB |
testcase_49 | AC | 1 ms
6,944 KB |
testcase_50 | AC | 1 ms
6,944 KB |
testcase_51 | AC | 1 ms
6,940 KB |
testcase_52 | AC | 4 ms
6,940 KB |
testcase_53 | AC | 13 ms
9,728 KB |
コンパイルメッセージ
main.c: In function 'yes': main.c:10:13: warning: implicit declaration of function 'sprintf' [-Wimplicit-function-declaration] 10 | wp+=sprintf(wp,"Yes\n"); | ^~~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'sprintf' +++ |+#include <stdio.h> 1 | #pragma GCC optimize("Ofast") main.c:10:13: warning: incompatible implicit declaration of built-in function 'sprintf' [-Wbuiltin-declaration-mismatch] 10 | wp+=sprintf(wp,"Yes\n"); | ^~~~~~~ main.c:10:13: note: include '<stdio.h>' or provide a declaration of 'sprintf' main.c:21:9: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration] 21 | write(1,&v,wp-(char*)&v); | ^~~~~ main.c:22:9: warning: implicit declaration of function '_exit'; did you mean '_Exit'? [-Wimplicit-function-declaration] 22 | _exit(0); | ^~~~~ | _Exit main.c: At top level: main.c:34:1: warning: return type defaults to 'int' [-Wimplicit-int] 34 | main(){ | ^~~~ main.c: In function 'main': main.c:35:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 35 | scanf("%d",&n); | ^~~~~ main.c:35:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:35:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] main.c:35:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
ソースコード
#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #define MAX (150000*22+1) int n,m,a[22]; int v[MAX]; void yes(int p1,int p2){ char*wp=(char*)&v; wp+=sprintf(wp,"Yes\n"); for(int i=0;i<m;++i){ int b=a[i]*((p1&1)-(p2&1)); wp+=sprintf(wp,"%d ",b); p1>>=1; p2>>=1; } n-=m; while((long)wp&7) *wp++=32; while(n>=4) *(long*)wp=0x2030203020302030l, wp+=8, n-=4; while(n) *(short*)wp=0x2030, wp+=2, --n; write(1,&v,wp-(char*)&v); _exit(0); } void f(int i,int p,int s){ if(i==m) return; f(i+1,p,s); int s1=s+a[i]; int p1=p|1<<i; if(v[s1]) yes(v[s1],p1); f(i+1,v[s1]=p1,s1); } main(){ scanf("%d",&n); m=n<22?n:22; for(int i=0;i<m;++i) scanf("%d",&a[i]); f(0,0,0); write(1,"No\n",3); _exit(0); }