結果
問題 |
No.2490 Escalator
|
ユーザー |
![]() |
提出日時 | 2023-09-29 22:30:14 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 542 bytes |
コンパイル時間 | 1,696 ms |
コンパイル使用メモリ | 195,744 KB |
最終ジャッジ日時 | 2025-02-17 03:24:31 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 TLE * 1 -- * 41 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int N; cin>>N; vector<int> A(2*N); for(int i=0;i<2*N;i++) cin>>A[i]; bool ans = false; for(int i=0;i<2*N;i++){ bool p = true; for(int j=0;j<N;j++)if(A[(i+j)%(2*N)] != -1 && A[(i+N-1-j)%(2*N)] != -1 && A[(i+j)%(2*N)] != A[(i+N-1-j)%(2*N)]) p = false; ans |= p; p = true; for(int j=0;j<=N;j++)if(A[(i+j)%(2*N)] != -1 && A[(i+N-j)%(2*N)] != -1 && A[(i+j)%(2*N)] != A[(i+N-j)%(2*N)]) p = false; ans |= p; } cout<<(ans ? "Yes" : "No")<<endl; }