結果

問題 No.3024 等式
ユーザー 👑 p-adicp-adic
提出日時 2023-09-11 10:22:25
言語 cLay
(20240104-1)
結果
TLE  
実行時間 -
コード長 510 bytes
コンパイル時間 2,537 ms
コンパイル使用メモリ 177,496 KB
実行使用メモリ 220,788 KB
最終ジャッジ日時 2023-09-11 10:22:43
合計ジャッジ時間 15,767 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 14 ms
4,380 KB
testcase_07 AC 17 ms
4,480 KB
testcase_08 AC 26 ms
5,436 KB
testcase_09 AC 7 ms
4,376 KB
testcase_10 AC 19 ms
5,156 KB
testcase_11 AC 23 ms
4,856 KB
testcase_12 AC 1,111 ms
31,380 KB
testcase_13 AC 1,037 ms
31,692 KB
testcase_14 AC 1,831 ms
51,500 KB
testcase_15 AC 405 ms
28,756 KB
testcase_16 AC 183 ms
18,260 KB
testcase_17 AC 31 ms
6,924 KB
testcase_18 AC 276 ms
36,612 KB
testcase_19 AC 719 ms
67,108 KB
testcase_20 AC 611 ms
54,660 KB
testcase_21 TLE -
権限があれば一括ダウンロードができます

ソースコード

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)<4995){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