結果

問題 No.3024 等式
ユーザー 👑 p-adicp-adic
提出日時 2023-09-11 10:26:00
言語 cLay
(20240104-1)
結果
AC  
実行時間 4,707 ms / 5,000 ms
コード長 510 bytes
コンパイル時間 2,650 ms
コンパイル使用メモリ 177,564 KB
実行使用メモリ 198,852 KB
最終ジャッジ日時 2023-09-12 16:18:39
合計ジャッジ時間 14,108 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 3 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 14 ms
4,380 KB
testcase_07 AC 16 ms
4,440 KB
testcase_08 AC 24 ms
5,320 KB
testcase_09 AC 6 ms
4,380 KB
testcase_10 AC 18 ms
5,048 KB
testcase_11 AC 23 ms
4,928 KB
testcase_12 AC 1,070 ms
31,472 KB
testcase_13 AC 1,032 ms
31,556 KB
testcase_14 AC 1,772 ms
51,468 KB
testcase_15 AC 374 ms
28,824 KB
testcase_16 AC 177 ms
18,164 KB
testcase_17 AC 30 ms
6,964 KB
testcase_18 AC 267 ms
36,596 KB
testcase_19 AC 671 ms
67,192 KB
testcase_20 AC 583 ms
54,664 KB
testcase_21 AC 24 ms
5,320 KB
testcase_22 AC 4,707 ms
198,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using V=vector<double>;using T=chrono::system_clock;{T::time_point w=T::now();ll@N,c;V A(N);rep(i,N){ll@a;A[i]=a;}set<V>S{A};while(N>1){auto T=move(S);S.clear();while(T.size()&&static_cast<ll>(chrono::duration_cast<chrono::microseconds>(T::now()-w).count()/1000)<4000){T.erase(A=*T.begin());rep(i,N)rep(j,N)if(i!=j){auto&a=A[j];if(a==0)wt("YES"),exit(0);V B(N-1);c=0;rep(k,N)if(k!=i&&k!=j)B[c++]=A[k];V D{A[i]+a,A[i]-a,A[i]*a,A[i]/a};rep[D](d,4)if(d>=0){B[c]=d,S.insert(B);}}}N--;}wt(S.count({0})?"YES":"NO");}
0