結果
| 問題 |
No.1717 Levi-Civita Triangle
|
| コンテスト | |
| ユーザー |
sugarrr
|
| 提出日時 | 2021-10-22 21:48:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 3,570 bytes |
| コンパイル時間 | 4,750 ms |
| コンパイル使用メモリ | 252,144 KB |
| 最終ジャッジ日時 | 2025-01-25 03:27:57 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 WA * 30 |
ソースコード
#include<atcoder/all>
#include<bits/stdc++.h>
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef long double dd;
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E18;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define rrep(i,r,l) for(ll i=r;i>=l;i--)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
dd EPS=1E-10;
#define fi first
#define se second
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
template<class T,class S>
inline bool chmax(T &a, S b) {
if(a < b) {
a = (T)b;
return true;
}
return false;
}
template<class T,class S>
inline bool chmin(T &a, S b) {
if(a > b) {
a = (T)b;
return true;
}
return false;
}
#define all(c) c.begin(),c.end()
using mint = modint998244353;
//using mint = modint1000000007;
//using mint=modint;
//using mint=static_modint<100>;
//using mint=dd;
//using mint=ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl>vvvl;
typedef vector<mint>vi;
typedef vector<vi>vvi;
typedef vector<vvi>vvvi;
typedef vector<l_l>vl_l;
typedef vector<vl_l>vvl_l;
typedef vector<string>vs;
typedef vector<vs>vvs;
typedef vector<dd> vd;
typedef vector<vd> vvd;
typedef vector<d_d>vd_d;
dd PI=acos((dd)-1);
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cout<<fixed<<setprecision(18);
template <class T> using pq = priority_queue<T>;
template <class T> using pqg = priority_queue<T, vector<T>, greater<T>>;
// g++ -std=gnu++17 -Wall -Wextra -O2 -DONLINE_JUDGE main.cpp && ./a.out
#define endl "\n" //インタラクティブで消す!!!!!!!!!!!!!!!!!!!!!
#define popcount __builtin_popcountll
#define SHUFFLE(v) shuffle(all(v),default_random_engine(chrono::system_clock::now().time_since_epoch().count()))
//////////////////////////
template<class S>
void DEBUG_PRINT(S x){
cerr<<x<<endl;
}
template<class S,class T>
void DEBUG_PRINT(pair<S,T>x){
cerr<<"("<<x.fi<<","<<x.se<<")"<<endl;
}
template<class S>
void DEBUG_PRINT(vector<S> x){
for(auto y:x)cerr<<setw(2)<<y<<" ";
cerr<<endl;
}
template<class S,class T>
void DEBUG_PRINT(vector<pair<S,T>>x){
for(auto y:x)cerr<<"("<<y.fi<<","<<y.se<<") ";
cerr<<endl;
}
template<class S>
void DEBUG_PRINT(vector<vector<S>> x){
cerr<<endl;
for(auto y:x){
for(auto z:y){
cerr<<setw(2)<<z<<" ";
}cerr<<endl;
}cerr<<endl;
}
#define TO_STRING_FOR_DEBUG(VariableName) # VariableName
#ifdef LOCAL
#define DEB(V) cerr<< TO_STRING_FOR_DEBUG(V) << ": "; DEBUG_PRINT(V);
#else
#define DEB(V) void(0)
#endif
/////////////////////////////////////////////////////////////////////////////////////////
signed main(){fastio
ll n;cin>>n;
n=2*n+1;
vl a(n);rep(i,0,n-1)cin>>a[i];
if(n>=10){
cout<<0<<endl;
return 0;
}
while((int)a.size()>1){
vl b;
rep(i,0,(int)a.size()-3){
if(a[i]!=a[i+1] && a[i+1]!=a[i+2] && a[i]!=a[i+2]){
if((a[i+1]+3-a[i])%3==1){
b.pb(1);
}else{
b.pb(2);
}
}else{
b.pb(0);
}
}
a=b;
for(auto x:a)cerr<<x<<" ";cerr<<endl;
}
cout<<a[0]<<endl;
return 0;
}
sugarrr