結果
問題 | No.2732 Similar Permutations |
ユーザー | kureha |
提出日時 | 2024-04-19 22:30:48 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,904 bytes |
コンパイル時間 | 2,730 ms |
コンパイル使用メモリ | 218,100 KB |
実行使用メモリ | 468,232 KB |
最終ジャッジ日時 | 2024-10-11 16:06:14 |
合計ジャッジ時間 | 25,714 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 11 ms
21,940 KB |
testcase_02 | AC | 890 ms
211,924 KB |
testcase_03 | TLE | - |
testcase_04 | AC | 402 ms
105,292 KB |
testcase_05 | AC | 198 ms
62,592 KB |
testcase_06 | AC | 87 ms
38,440 KB |
testcase_07 | AC | 1,070 ms
254,944 KB |
testcase_08 | AC | 275 ms
78,696 KB |
testcase_09 | AC | 248 ms
74,112 KB |
testcase_10 | RE | - |
testcase_11 | AC | 41 ms
27,776 KB |
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 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | WA | - |
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 | AC | 10 ms
21,888 KB |
testcase_64 | AC | 11 ms
21,888 KB |
testcase_65 | AC | 10 ms
21,948 KB |
testcase_66 | AC | 10 ms
21,884 KB |
testcase_67 | AC | 10 ms
22,016 KB |
testcase_68 | AC | 10 ms
22,016 KB |
testcase_69 | AC | 11 ms
21,884 KB |
testcase_70 | AC | 10 ms
21,888 KB |
testcase_71 | AC | 10 ms
22,016 KB |
testcase_72 | AC | 11 ms
21,888 KB |
testcase_73 | AC | 11 ms
22,016 KB |
testcase_74 | AC | 11 ms
22,016 KB |
testcase_75 | AC | 10 ms
21,888 KB |
testcase_76 | AC | 11 ms
22,016 KB |
testcase_77 | AC | 10 ms
22,092 KB |
testcase_78 | AC | 11 ms
21,848 KB |
testcase_79 | AC | 11 ms
22,008 KB |
testcase_80 | AC | 11 ms
21,888 KB |
testcase_81 | AC | 11 ms
21,936 KB |
testcase_82 | AC | 11 ms
22,012 KB |
testcase_83 | AC | 10 ms
22,016 KB |
testcase_84 | AC | 11 ms
22,016 KB |
testcase_85 | AC | 11 ms
21,888 KB |
testcase_86 | AC | 10 ms
21,924 KB |
testcase_87 | AC | 10 ms
22,016 KB |
testcase_88 | AC | 10 ms
21,928 KB |
testcase_89 | AC | 11 ms
22,016 KB |
testcase_90 | AC | 12 ms
21,828 KB |
testcase_91 | AC | 11 ms
22,008 KB |
testcase_92 | AC | 11 ms
21,960 KB |
testcase_93 | AC | 10 ms
21,952 KB |
testcase_94 | AC | 11 ms
22,008 KB |
testcase_95 | AC | 10 ms
22,016 KB |
testcase_96 | AC | 11 ms
21,848 KB |
testcase_97 | AC | 11 ms
22,004 KB |
testcase_98 | AC | 10 ms
22,008 KB |
testcase_99 | AC | 11 ms
22,016 KB |
testcase_100 | AC | 11 ms
22,016 KB |
testcase_101 | AC | 11 ms
21,920 KB |
testcase_102 | AC | 11 ms
21,972 KB |
ソースコード
#include<bits/stdc++.h> using namespace std; using uint = unsigned int; using ll = long long; using ull = unsigned long long; template<class T> using V = vector<T>; template<class T> using VV = V<V<T>>; template<class T> using VVV = V<VV<T>>; template<class T> using VVVV = VV<VV<T>>; #define rep(i,n) for(ll i=0ll;i<n;i++) #define REP(i,a,n) for(ll i=a;i<n;i++) const long long INF = (1LL << 60); const long long mod99 = 998244353; const long long mod107 = 1000000007; const long long mod = mod99; #define eb emplace_back #define pb eb #define be(v) (v).begin(),(v).end() #define all(i,v) for(auto& i : v) #define all2(i,j,v) for(auto& [i,j] : v) template<class T, class U> void chmin(T& t, const U& u) { if (t > u) t = u; } template<class T, class U> void chmax(T& t, const U& u) { if (t < u) t = u; } // cin.tie(nullptr); // ios::sync_with_stdio(false); // cout << fixed << setprecision(20); ll Rnd(ll L=0, ll R=mod99){ return rand()%(R-L)+L; } void solve(){ ll n; cin >> n; V<ll> v(n); rep(i,n) cin >> v[i]; VV<ll> pos(200100); rep(i, n) pos[v[i]].eb(i); rep(i, 200100) if(pos[i].size()>=2){ V<ll> ans(n); cout << "Yes" << endl; rep(i, n){ cout << i+1 << " "; ans[i] = i+1; } cout << endl; swap(ans[pos[i][0]],ans[pos[i][1]]); all(i,ans) cout << i << " "; cout << endl; return; } V<set<V<ll>>> vv(300000); V<ll> p(n); rep(i,n) p[i] = i+1; rep(i, 1300){ ll x = 0; rep(j,n-1){ swap(p[j], p[Rnd(j,n)]); x ^= (v[j]+p[j]); } x ^= (v[n-1]+p[n-1]); vv[x].insert(p); if(vv[x].size()>1){ all(i, *(vv[x].begin())) cout << i << " "; cout << endl; all(i, *(vv[x].rbegin())) cout << i << " "; cout << endl; return; } } cout << -1 << endl; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int t=1; // cin >> t; rep(i,t) solve(); }