結果

問題 No.1990 Candy Boxes
ユーザー 👑 kmjpkmjp
提出日時 2022-06-24 23:31:47
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,219 bytes
コンパイル時間 2,112 ms
コンパイル使用メモリ 203,668 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-04-30 18:10:14
合計ジャッジ時間 5,876 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 WA -
testcase_05 AC 2 ms
6,940 KB
testcase_06 WA -
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 11 ms
6,940 KB
testcase_15 AC 11 ms
6,940 KB
testcase_16 AC 12 ms
6,940 KB
testcase_17 AC 13 ms
6,944 KB
testcase_18 AC 14 ms
6,940 KB
testcase_19 AC 19 ms
6,940 KB
testcase_20 AC 21 ms
6,940 KB
testcase_21 AC 18 ms
6,940 KB
testcase_22 AC 15 ms
6,940 KB
testcase_23 AC 20 ms
6,940 KB
testcase_24 AC 19 ms
6,944 KB
testcase_25 AC 27 ms
6,944 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 14 ms
6,944 KB
testcase_29 WA -
testcase_30 AC 12 ms
6,944 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 13 ms
6,944 KB
testcase_35 AC 19 ms
6,940 KB
testcase_36 RE -
testcase_37 AC 17 ms
6,944 KB
testcase_38 AC 14 ms
6,940 KB
testcase_39 AC 16 ms
6,944 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 10 ms
6,948 KB
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 AC 2 ms
6,940 KB
testcase_53 WA -
testcase_54 AC 2 ms
6,940 KB
testcase_55 WA -
testcase_56 WA -
testcase_57 RE -
testcase_58 AC 1 ms
6,944 KB
testcase_59 AC 2 ms
6,940 KB
testcase_60 WA -
testcase_61 AC 2 ms
6,940 KB
testcase_62 AC 2 ms
6,944 KB
testcase_63 AC 2 ms
6,940 KB
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
testcase_67 AC 18 ms
6,940 KB
testcase_68 AC 10 ms
6,944 KB
testcase_69 AC 19 ms
6,944 KB
testcase_70 RE -
testcase_71 WA -
testcase_72 WA -
testcase_73 AC 24 ms
6,940 KB
testcase_74 WA -
testcase_75 AC 14 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------

int N;
int B[202020];
int D[202020];
int A[202020];
int add[202020];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	int pre=0;
	vector<int> X,Y;
	FOR(i,N) {
		cin>>B[i];
		D[i]=(B[i]+i)%2;
		A[i]=B[i]-pre;
		
		if(A[i]%2) X.push_back(i);
		if(D[i]%2) Y.push_back(i);
		
		pre=A[i];
	}
	if(A[N-1]) {
		cout<<"No"<<endl;
		return;
	}
	if(X.size()!=Y.size()) {
		cout<<"No"<<endl;
		return;
	}
	assert(0);
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
0