結果
問題 |
No.3007 組み紐
|
ユーザー |
|
提出日時 | 2025-01-17 23:26:42 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 703 bytes |
コンパイル時間 | 5,842 ms |
コンパイル使用メモリ | 332,404 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-17 23:26:50 |
合計ジャッジ時間 | 7,022 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using mint = atcoder::static_modint<998244353>; //using mint = atcoder::static_modint<1000000007>; using namespace std; using namespace atcoder; using ld = long double; using ll = long long; #define mp(a,b) make_pair(a,b) #define rep(i,s,n) for(int i=s; i<n; i++) const vector<int> dx{1,0,-1,0},dy{0,1,0,-1}; int main(){ int n,k,l; cin >> n >> k >> l; vector<int> a(k); vector<int> b(l); rep(i,0,k)cin >> a[i]; rep(i,0,l)cin >> b[i]; vector<int> A(n+5); iota(A.begin(),A.end(),0); auto B=A; for(auto x:a)swap(A[x],A[x+1]); for(auto x:b)swap(B[x],B[x+1]); if(A==B)cout << "YES\n"; else cout << "NO\n"; }