結果

問題 No.2740 Old Maid
ユーザー 👑 p-adicp-adic
提出日時 2024-04-21 20:01:24
言語 cLay
(20240104-1)
結果
AC  
実行時間 441 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 3,092 ms
コンパイル使用メモリ 190,380 KB
実行使用メモリ 35,200 KB
最終ジャッジ日時 2024-04-21 20:01:42
合計ジャッジ時間 16,355 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 178 ms
35,072 KB
testcase_01 AC 175 ms
35,072 KB
testcase_02 AC 174 ms
35,200 KB
testcase_03 AC 179 ms
34,944 KB
testcase_04 AC 197 ms
35,072 KB
testcase_05 AC 176 ms
35,072 KB
testcase_06 AC 175 ms
35,072 KB
testcase_07 AC 177 ms
35,200 KB
testcase_08 AC 182 ms
35,072 KB
testcase_09 AC 199 ms
35,072 KB
testcase_10 AC 174 ms
35,200 KB
testcase_11 AC 175 ms
35,200 KB
testcase_12 AC 271 ms
25,600 KB
testcase_13 AC 295 ms
27,392 KB
testcase_14 AC 38 ms
8,448 KB
testcase_15 AC 64 ms
10,240 KB
testcase_16 AC 180 ms
20,736 KB
testcase_17 AC 39 ms
8,192 KB
testcase_18 AC 298 ms
26,624 KB
testcase_19 AC 85 ms
13,184 KB
testcase_20 AC 359 ms
30,336 KB
testcase_21 AC 61 ms
9,216 KB
testcase_22 AC 178 ms
20,224 KB
testcase_23 AC 27 ms
7,040 KB
testcase_24 AC 85 ms
12,672 KB
testcase_25 AC 363 ms
31,744 KB
testcase_26 AC 3 ms
5,376 KB
testcase_27 AC 18 ms
5,888 KB
testcase_28 AC 179 ms
20,480 KB
testcase_29 AC 197 ms
19,584 KB
testcase_30 AC 7 ms
5,376 KB
testcase_31 AC 441 ms
34,432 KB
testcase_32 AC 104 ms
14,080 KB
testcase_33 AC 389 ms
32,896 KB
testcase_34 AC 165 ms
19,456 KB
testcase_35 AC 77 ms
12,288 KB
testcase_36 AC 87 ms
13,056 KB
testcase_37 AC 135 ms
16,640 KB
testcase_38 AC 69 ms
11,520 KB
testcase_39 AC 33 ms
7,936 KB
testcase_40 AC 226 ms
23,552 KB
testcase_41 AC 342 ms
30,080 KB
testcase_42 AC 2 ms
5,376 KB
testcase_43 AC 2 ms
5,376 KB
testcase_44 AC 1 ms
5,376 KB
testcase_45 AC 2 ms
5,376 KB
testcase_46 AC 1 ms
5,376 KB
testcase_47 AC 1 ms
5,376 KB
testcase_48 AC 1 ms
5,376 KB
testcase_49 AC 1 ms
5,376 KB
testcase_50 AC 2 ms
5,376 KB
testcase_51 AC 2 ms
5,376 KB
testcase_52 AC 1 ms
5,376 KB
testcase_53 AC 1 ms
5,376 KB
testcase_54 AC 1 ms
5,376 KB
testcase_55 AC 2 ms
5,376 KB
testcase_56 AC 1 ms
5,376 KB
testcase_57 AC 1 ms
5,376 KB
testcase_58 AC 2 ms
5,376 KB
testcase_59 AC 2 ms
5,376 KB
testcase_60 AC 1 ms
5,376 KB
testcase_61 AC 2 ms
5,376 KB
testcase_62 AC 1 ms
5,376 KB
testcase_63 AC 1 ms
5,376 KB
testcase_64 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:114:18: warning: narrowing conversion of ‘p[i]’ from ‘long long int’ to ‘int’ [-Wnarrowing]
  114 |     S.insert({p[i],i});
      |               ~~~^
main.cpp:114:18: warning: narrowing conversion of ‘p[i]’ from ‘long long int’ to ‘int’ [-Wnarrowing]
main.cpp:122:17: warning: narrowing conversion of ‘p[t]’ from ‘long long int’ to ‘int’ [-Wnarrowing]
  122 |     S.erase({p[t],t});
      |              ~~~^
main.cpp:122:17: warning: narrowing conversion of ‘p[t]’ from ‘long long int’ to ‘int’ [-Wnarrowing]
main.cpp:122:19: warning: narrowing conversion of ‘t’ from ‘long long int’ to ‘int’ [-Wnarrowing]
  122 |     S.erase({p[t],t});
      |                   ^
main.cpp:122:19: warning: narrowing conversion of ‘t’ from ‘long long int’ to ‘int’ [-Wnarrowing]

ソースコード

diff #

ll@N,@p[N],s,t;set<ll>I;set<VI>S;rep(i,N)I.insert(i),S.insert({p[i],i});rep(n,N/2){auto j=S.begin();(*j)[1]<*I.rbegin()?j:++j;I.erase(s=(*j)[1]);I.erase(t=*I.upper_bound(s));S.erase(j);S.erase({p[t],t});wtSp(p[s],p[t]);}
0