結果

問題 No.2740 Old Maid
ユーザー 👑 p-adicp-adic
提出日時 2024-04-21 19:59:02
言語 cLay
(20240104-1)
結果
AC  
実行時間 609 ms / 2,000 ms
コード長 237 bytes
コンパイル時間 3,151 ms
コンパイル使用メモリ 189,696 KB
実行使用メモリ 36,736 KB
最終ジャッジ日時 2024-04-21 19:59:20
合計ジャッジ時間 15,907 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 206 ms
36,608 KB
testcase_01 AC 204 ms
36,608 KB
testcase_02 AC 203 ms
36,736 KB
testcase_03 AC 204 ms
36,736 KB
testcase_04 AC 215 ms
36,736 KB
testcase_05 AC 205 ms
36,608 KB
testcase_06 AC 204 ms
36,608 KB
testcase_07 AC 203 ms
36,480 KB
testcase_08 AC 204 ms
36,480 KB
testcase_09 AC 212 ms
36,736 KB
testcase_10 AC 196 ms
36,608 KB
testcase_11 AC 201 ms
36,608 KB
testcase_12 AC 378 ms
26,624 KB
testcase_13 AC 448 ms
28,800 KB
testcase_14 AC 47 ms
8,704 KB
testcase_15 AC 71 ms
10,624 KB
testcase_16 AC 270 ms
21,632 KB
testcase_17 AC 45 ms
8,448 KB
testcase_18 AC 399 ms
27,648 KB
testcase_19 AC 117 ms
13,568 KB
testcase_20 AC 487 ms
31,744 KB
testcase_21 AC 55 ms
9,600 KB
testcase_22 AC 256 ms
20,992 KB
testcase_23 AC 30 ms
7,168 KB
testcase_24 AC 100 ms
13,184 KB
testcase_25 AC 518 ms
33,152 KB
testcase_26 AC 4 ms
5,376 KB
testcase_27 AC 20 ms
6,144 KB
testcase_28 AC 265 ms
21,120 KB
testcase_29 AC 269 ms
20,480 KB
testcase_30 AC 7 ms
5,376 KB
testcase_31 AC 609 ms
35,968 KB
testcase_32 AC 135 ms
14,976 KB
testcase_33 AC 582 ms
34,432 KB
testcase_34 AC 246 ms
20,096 KB
testcase_35 AC 109 ms
13,056 KB
testcase_36 AC 117 ms
13,568 KB
testcase_37 AC 181 ms
17,280 KB
testcase_38 AC 86 ms
11,776 KB
testcase_39 AC 38 ms
7,936 KB
testcase_40 AC 330 ms
24,448 KB
testcase_41 AC 500 ms
31,360 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 2 ms
5,376 KB
testcase_47 AC 2 ms
5,376 KB
testcase_48 AC 2 ms
5,376 KB
testcase_49 AC 1 ms
5,376 KB
testcase_50 AC 2 ms
5,376 KB
testcase_51 AC 1 ms
5,376 KB
testcase_52 AC 1 ms
5,376 KB
testcase_53 AC 2 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 2 ms
5,376 KB
testcase_58 AC 1 ms
5,376 KB
testcase_59 AC 2 ms
5,376 KB
testcase_60 AC 2 ms
5,376 KB
testcase_61 AC 1 ms
5,376 KB
testcase_62 AC 1 ms
5,376 KB
testcase_63 AC 2 ms
5,376 KB
testcase_64 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:115:18: warning: narrowing conversion of ‘p[i]’ from ‘long long int’ to ‘int’ [-Wnarrowing]
  115 |     S.insert({p[i],i});
      |               ~~~^
main.cpp:115:18: warning: narrowing conversion of ‘p[i]’ from ‘long long int’ to ‘int’ [-Wnarrowing]
main.cpp:123:22: warning: narrowing conversion of ‘(q[((2 * n) + 1)] = p[t])’ from ‘long long int’ to ‘int’ [-Wnarrowing]
  123 |     S.erase({q[2*n+1]=p[t],t});
      |              ~~~~~~~~^~~~~
main.cpp:123:22: warning: narrowing conversion of ‘(q[((2 * n) + 1)] = p[t])’ from ‘long long int’ to ‘int’ [-Wnarrowing]
main.cpp:123:28: warning: narrowing conversion of ‘t’ from ‘long long int’ to ‘int’ [-Wnarrowing]
  123 |     S.erase({q[2*n+1]=p[t],t});
      |                            ^
main.cpp:123:28: warning: narrowing conversion of ‘t’ from ‘long long int’ to ‘int’ [-Wnarrowing]

ソースコード

diff #

ll@N,@p[N],q[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({q[2n+1]=p[t],t});q[2n]=p[s];}wt(q(N));
0