QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#127017#6642. (1, 2) Nimyy_zq#WA 1ms3412kbC++14595b2023-07-19 12:19:302023-07-19 12:19:34

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-19 12:19:34]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3412kb
  • [2023-07-19 12:19:30]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,j,k) for(int i=j;i<=k;++i) 
int b[13];
int a[13];
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		FOR(i,1,n){
			cin>>b[i];
		}
		int ys = 1;
		FOR(i,1,n){
			if(b[i]>b[i-1]) a[i] = i*10;
			if(b[i]==b[i-1]) a[i] = 10-i;
			if(b[i]<b[i-1]||b[i]>b[i-1]+1){
				ys=0;
			}
		}
		if(ys){
			cout<<"YES\n";
			FOR(i,1,n) cout<<a[i]<<' ';
			cout<<'\n';
		}
		else cout<<"NO\n";
	}
	return 0;
}
/*
2
6
1 2 3 4 5 7
4
1 2 2 3
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3412kb

input:

3
2
1 2
1
5
4
1 7 2 9

output:

YES
10 20 
NO
NO

result:

wrong answer 1st lines differ - expected: 'Grundy', found: 'YES'