結果

問題 No.1717 Levi-Civita Triangle
ユーザー 沙耶花沙耶花
提出日時 2021-10-22 22:36:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 712 bytes
コンパイル時間 4,042 ms
コンパイル使用メモリ 263,492 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 13:56:42
合計ジャッジ時間 5,748 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 4 ms
4,348 KB
testcase_07 AC 20 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 4 ms
4,348 KB
testcase_12 AC 12 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 2 ms
4,348 KB
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 -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000000000000

vector<int> get(vector<int> a){
	vector<int> b(a.size()-1);
	rep(i,a.size()-1){
		int d = a[i+1] - a[i];
		d %=3 ;
		if(d<0)d += 3;
		b[i] = d;
	}
	
	vector<int> ret;
	rep(i,b.size()-1){
		if(b[i]!=0&&b[i]==b[i+1])ret.push_back(b[i]);
		else ret.push_back(0);
	}
	return ret;
	
}

int main(){
	
	int n;
	cin>>n;
	
	vector<int> a(n*2+1);
	rep(i,a.size())cin>>a[i];
	
	if(a.size()>500){
		cout<<0<<endl;
		return 0;
	}
	
	while(a.size()!=1){
		a = get(a);
	}
	
	cout<<a[0]<<endl;
	
	return 0;
}
0