結果
問題 | No.2307 [Cherry 5 th Tune *] Cool 46 |
ユーザー | tails |
提出日時 | 2023-05-24 20:55:07 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 1,989 bytes |
コンパイル時間 | 1,130 ms |
コンパイル使用メモリ | 32,272 KB |
実行使用メモリ | 8,064 KB |
最終ジャッジ日時 | 2024-06-06 07:49:56 |
合計ジャッジ時間 | 23,125 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 0 ms
5,376 KB |
testcase_02 | AC | 12 ms
5,888 KB |
testcase_03 | AC | 13 ms
5,760 KB |
testcase_04 | AC | 13 ms
5,888 KB |
testcase_05 | AC | 12 ms
5,632 KB |
testcase_06 | AC | 13 ms
5,760 KB |
testcase_07 | AC | 11 ms
5,376 KB |
testcase_08 | AC | 13 ms
6,144 KB |
testcase_09 | AC | 13 ms
6,144 KB |
testcase_10 | AC | 12 ms
5,888 KB |
testcase_11 | AC | 14 ms
6,656 KB |
testcase_12 | AC | 12 ms
6,016 KB |
testcase_13 | AC | 17 ms
7,424 KB |
testcase_14 | AC | 13 ms
6,144 KB |
testcase_15 | AC | 11 ms
5,504 KB |
testcase_16 | AC | 14 ms
6,656 KB |
testcase_17 | AC | 13 ms
6,272 KB |
testcase_18 | AC | 17 ms
7,808 KB |
testcase_19 | AC | 14 ms
7,808 KB |
testcase_20 | AC | 16 ms
8,064 KB |
testcase_21 | AC | 16 ms
7,936 KB |
testcase_22 | AC | 16 ms
7,808 KB |
testcase_23 | AC | 15 ms
7,936 KB |
testcase_24 | AC | 17 ms
7,936 KB |
testcase_25 | AC | 16 ms
7,808 KB |
testcase_26 | AC | 17 ms
7,936 KB |
testcase_27 | AC | 16 ms
7,808 KB |
testcase_28 | AC | 17 ms
8,064 KB |
testcase_29 | AC | 16 ms
8,064 KB |
testcase_30 | AC | 15 ms
7,808 KB |
testcase_31 | AC | 17 ms
7,936 KB |
testcase_32 | AC | 16 ms
7,936 KB |
testcase_33 | AC | 17 ms
7,808 KB |
testcase_34 | AC | 16 ms
7,808 KB |
testcase_35 | AC | 15 ms
7,808 KB |
testcase_36 | AC | 15 ms
7,936 KB |
testcase_37 | AC | 16 ms
7,808 KB |
testcase_38 | AC | 10 ms
5,632 KB |
testcase_39 | AC | 16 ms
7,552 KB |
testcase_40 | AC | 15 ms
7,040 KB |
testcase_41 | AC | 12 ms
7,040 KB |
testcase_42 | AC | 13 ms
7,808 KB |
testcase_43 | AC | 14 ms
7,808 KB |
testcase_44 | AC | 17 ms
7,808 KB |
testcase_45 | AC | 17 ms
7,680 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 18 #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<<18]; 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); }