結果
問題 | No.2307 [Cherry 5 th Tune *] Cool 46 |
ユーザー | tails |
提出日時 | 2023-05-24 20:57:54 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 20 ms / 2,000 ms |
コード長 | 1,996 bytes |
コンパイル時間 | 746 ms |
コンパイル使用メモリ | 32,136 KB |
実行使用メモリ | 11,920 KB |
最終ジャッジ日時 | 2024-06-06 07:52:02 |
合計ジャッジ時間 | 18,281 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,812 KB |
testcase_01 | AC | 1 ms
6,940 KB |
testcase_02 | AC | 9 ms
9,184 KB |
testcase_03 | AC | 10 ms
9,196 KB |
testcase_04 | AC | 11 ms
9,192 KB |
testcase_05 | AC | 10 ms
9,192 KB |
testcase_06 | AC | 11 ms
11,228 KB |
testcase_07 | AC | 9 ms
9,184 KB |
testcase_08 | AC | 11 ms
9,312 KB |
testcase_09 | AC | 14 ms
9,320 KB |
testcase_10 | AC | 11 ms
9,328 KB |
testcase_11 | AC | 14 ms
11,332 KB |
testcase_12 | AC | 12 ms
11,232 KB |
testcase_13 | AC | 15 ms
11,232 KB |
testcase_14 | AC | 12 ms
9,184 KB |
testcase_15 | AC | 11 ms
9,316 KB |
testcase_16 | AC | 14 ms
11,336 KB |
testcase_17 | AC | 13 ms
9,428 KB |
testcase_18 | AC | 16 ms
11,224 KB |
testcase_19 | AC | 14 ms
11,648 KB |
testcase_20 | AC | 16 ms
11,916 KB |
testcase_21 | AC | 15 ms
11,292 KB |
testcase_22 | AC | 18 ms
11,404 KB |
testcase_23 | AC | 16 ms
11,920 KB |
testcase_24 | AC | 15 ms
11,444 KB |
testcase_25 | AC | 17 ms
11,468 KB |
testcase_26 | AC | 15 ms
11,228 KB |
testcase_27 | AC | 16 ms
11,276 KB |
testcase_28 | AC | 15 ms
11,272 KB |
testcase_29 | AC | 16 ms
11,240 KB |
testcase_30 | AC | 15 ms
11,492 KB |
testcase_31 | AC | 16 ms
11,636 KB |
testcase_32 | AC | 16 ms
11,224 KB |
testcase_33 | AC | 16 ms
11,232 KB |
testcase_34 | AC | 16 ms
11,316 KB |
testcase_35 | AC | 15 ms
11,608 KB |
testcase_36 | AC | 16 ms
11,804 KB |
testcase_37 | AC | 15 ms
11,276 KB |
testcase_38 | AC | 9 ms
8,800 KB |
testcase_39 | AC | 14 ms
11,448 KB |
testcase_40 | AC | 13 ms
8,320 KB |
testcase_41 | AC | 11 ms
11,228 KB |
testcase_42 | AC | 13 ms
9,088 KB |
testcase_43 | AC | 13 ms
11,616 KB |
testcase_44 | AC | 16 ms
11,224 KB |
testcase_45 | AC | 20 ms
10,216 KB |
コンパイルメッセージ
main.c: In function ‘main’: main.c:66:40: warning: multi-character character constant [-Wmultichar] 66 | *(unsigned*)wp='\noN'; | ^~~~~~ main.c:73:35: warning: multi-character character constant [-Wmultichar] 73 | *(int*)wp='\nseY'; | ^~~~~~~ main.c:79:49: warning: multi-character character constant [-Wmultichar] 79 | wt_red(h); | ^ main.c:84:41: warning: multi-character character constant [-Wmultichar] 84 | wt_red(h); | ^ main.c:85:42: warning: multi-character character constant [-Wmultichar] 85 | wt_blue(h); | ^ main.c:89:42: warning: multi-character character constant [-Wmultichar] 89 | wt_blue(h); | ^ main.c:95:50: warning: multi-character character constant [-Wmultichar] 95 | wt_blue(h); | ^ main.c:96:49: warning: multi-character character constant [-Wmultichar] 96 | wt_red(h); | ^ main.c:101:49: warning: multi-character character constant [-Wmultichar] 101 | wt_red(h); | ^ main.c:102:50: warning: multi-character character constant [-Wmultichar] 102 | wt_blue(h); | ^ main.c:107:9: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration] 107 | write(1,wbuf,wp-wbuf);
ソースコード
#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #define rd_init() char*rp=({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);}) #define rd_skip() while(*rp++>=48) #define rd() ({long _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;}) #define WTHI(v) {ulong _z=v,_n=0,_d=0;while(++_n,_d=_d<<8|0x30|_z%10,_z/=10);*(ulong*)wp=_d;wp+=_n;} #define WTLO(v) {ulong _z=v,_n=8,_d=0;while(_d=_d<<8|0x30|_z%10,_z/=10,--_n);*(ulong*)wp=_d;wp+=8;} #define wt(v) if(v>=100000000){WTHI(v/100000000);WTLO(v);}else{WTHI(v);} #define wt_red(h) ({*(unsigned*)wp=' deR';wp+=4;wt(hash[h]);*wp++='\n';}) #define wt_blue(h) ({*(unsigned*)wp='eulB';wp+=4;;*wp++=' ';wt(hash[h]);*wp++='\n';}) #define rep(v,e) for(typeof(e) v=0;v<e;++v) #define HASH_BITS 19 #define HASH_MASK ((1<<HASH_BITS)-1) unsigned hash[1<<HASH_BITS]; int hash_add(unsigned x){ int h=x&HASH_MASK; while(1){ if(hash[h]==0){ hash[h]=x; return h; } if(hash[h]==x){ return h; } h=h+1&HASH_MASK; } } typedef unsigned long ulong; char wbuf[1<<25]; char u[1<<HASH_BITS]; int as[1<<18],an; int bs[1<<18],bn; int cs[1<<18],cn; int main(){ rd_init(); rd_skip(); char*wp=wbuf; while(*rp){ an=0; bn=0; cn=0; int n=rd(),m=rd(); if(!n)++rp; rep(j,n){ int h=hash_add(rd()); u[h]=1; as[an++]=h; } if(!m)++rp; rep(j,m){ int h=hash_add(rd()); if(u[h]){ u[h]=0; cs[cn++]=h; }else{ bs[bn++]=h; } } if(cn==0&&an&&bn){ *(unsigned*)wp='\noN'; wp+=3; while(an){ int h=as[--an]; u[h]=0; } }else{ *(int*)wp='\nseY'; wp+=4; while(an){ int h=as[--an]; if(u[h]){ u[h]=0; wt_red(h); } } if(cn){ int h=cs[--cn]; wt_red(h); wt_blue(h); } while(bn){ int h=bs[--bn]; wt_blue(h); } while(1){ if(!cn)break; { int h=cs[--cn]; wt_blue(h); wt_red(h); } if(!cn)break; { int h=cs[--cn]; wt_red(h); wt_blue(h); } } } } write(1,wbuf,wp-wbuf); _exit(0); }