結果
問題 | No.941 商とあまり |
ユーザー | NyaanNyaan |
提出日時 | 2019-12-04 12:24:05 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,219 bytes |
コンパイル時間 | 1,786 ms |
コンパイル使用メモリ | 174,564 KB |
実行使用メモリ | 7,584 KB |
最終ジャッジ日時 | 2024-05-07 12:30:41 |
合計ジャッジ時間 | 172,532 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 26 ms
7,304 KB |
testcase_02 | AC | 24 ms
7,300 KB |
testcase_03 | AC | 25 ms
7,408 KB |
testcase_04 | AC | 24 ms
7,432 KB |
testcase_05 | AC | 25 ms
7,324 KB |
testcase_06 | AC | 25 ms
7,304 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 25 ms
7,376 KB |
testcase_21 | AC | 25 ms
7,376 KB |
testcase_22 | AC | 24 ms
7,408 KB |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | AC | 2 ms
6,940 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | AC | 24 ms
7,388 KB |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | AC | 24 ms
7,244 KB |
testcase_41 | AC | 25 ms
7,500 KB |
testcase_42 | AC | 25 ms
7,424 KB |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | AC | 25 ms
7,384 KB |
testcase_49 | WA | - |
testcase_50 | WA | - |
testcase_51 | WA | - |
testcase_52 | WA | - |
testcase_53 | WA | - |
testcase_54 | WA | - |
testcase_55 | WA | - |
testcase_56 | WA | - |
testcase_57 | WA | - |
testcase_58 | WA | - |
testcase_59 | WA | - |
testcase_60 | WA | - |
testcase_61 | WA | - |
testcase_62 | WA | - |
testcase_63 | WA | - |
testcase_64 | WA | - |
testcase_65 | WA | - |
testcase_66 | WA | - |
testcase_67 | WA | - |
testcase_68 | WA | - |
testcase_69 | WA | - |
testcase_70 | WA | - |
testcase_71 | WA | - |
testcase_72 | WA | - |
testcase_73 | WA | - |
testcase_74 | WA | - |
testcase_75 | WA | - |
testcase_76 | WA | - |
testcase_77 | WA | - |
testcase_78 | WA | - |
testcase_79 | WA | - |
testcase_80 | WA | - |
testcase_81 | WA | - |
testcase_82 | WA | - |
testcase_83 | WA | - |
testcase_84 | WA | - |
testcase_85 | WA | - |
testcase_86 | WA | - |
testcase_87 | WA | - |
testcase_88 | WA | - |
testcase_89 | WA | - |
testcase_90 | WA | - |
testcase_91 | WA | - |
testcase_92 | WA | - |
testcase_93 | WA | - |
testcase_94 | WA | - |
testcase_95 | WA | - |
testcase_96 | WA | - |
testcase_97 | WA | - |
testcase_98 | AC | 24 ms
7,272 KB |
testcase_99 | WA | - |
testcase_100 | WA | - |
testcase_101 | AC | 25 ms
7,216 KB |
testcase_102 | AC | 25 ms
7,424 KB |
testcase_103 | WA | - |
testcase_104 | AC | 1,810 ms
6,940 KB |
testcase_105 | AC | 1,811 ms
6,940 KB |
testcase_106 | AC | 2 ms
6,944 KB |
testcase_107 | AC | 1,810 ms
6,944 KB |
testcase_108 | AC | 1,809 ms
6,944 KB |
testcase_109 | AC | 1,810 ms
6,940 KB |
ソースコード
#include <bits/stdc++.h> #define whlie while #define pb push_back #define eb emplace_back #define fi first #define se second #define rep(i,N) for(int i = 0; i < (N); i++) #define repr(i,N) for(int i = (N) - 1; i >= 0; i--) #define rep1(i,N) for(int i = 1; i <= (N) ; i++) #define repr1(i,N) for(int i = (N) ; i > 0 ; i--) #define each(x,v) for(auto& x : v) #define all(v) (v).begin(),(v).end() #define sz(v) ((int)(v).size()) #define ini(...) int __VA_ARGS__; in(__VA_ARGS__) #define inl(...) ll __VA_ARGS__; in(__VA_ARGS__) #define ins(...) string __VA_ARGS__; in(__VA_ARGS__) using namespace std; void solve(); using ll = long long; using vl = vector<ll>; using vi = vector<int>; using vvi = vector< vector<int> >; constexpr int inf = 1001001001; constexpr ll infLL = (1LL << 61) - 1; struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(7);} } iosetupnya; template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; } template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; } template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; } template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; } template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; } template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; } void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);} void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);} template<typename T>void die(T x){out(x); exit(0);} #ifdef NyaanDebug #include "NyaanDebug.h" #define trc(...) do { cerr << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0) #define trca(v,N) do { cerr << #v << " = "; array_out(v , N);cout << endl;} while(0) #else #define trc(...) #define trca(...) int main(){solve();} #endif using P = pair<int,int>; using vp = vector<P>; constexpr int MOD = /**/ 1000000007; //*/ 998244353; ////////// void solve(){ ini(N , X); vl A(N); in(A); vi ans(X * 2 + 10 , 0); auto owari = [&](){ rep1(i , X) cout << ans[i]; cout << endl; exit(0); }; ll seki = 1; rep(i , N){ seki *= (A[i] + 1); if(seki > X) owari(); } seki--; ans[seki] = 1; if(N == 1) owari(); auto start = clock(); vi ord(N); iota(all(ord) , 0); mt19937 rng(58); while( 1.0 * (clock() - start) / CLOCKS_PER_SEC < 1.8 ){ shuffle(all(ord) , rng); ll nya = 1; rep(i , N){ if(i == 0) nya = A[ord[i]] + 1; else{ ll nxt = A[ord[i]] + 1; ll margin = 0; if(rng() % 2 == 1){ swap(nxt , nya);} while(rng() < UINT32_MAX / 2 ) margin += nya - 1; nya = nya * nxt + margin; if(nya - 1 > X) break; } } if(nya - 1 <= X) ans[nya - 1] = 1; } owari(); }