QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#683070#9531. Weird Ceilingutada#WA 1ms3612kbC++171.0kb2024-10-27 18:38:422024-10-27 18:38:43

Judging History

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

  • [2024-10-27 18:38:43]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3612kb
  • [2024-10-27 18:38:42]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define int long long
const int N=1e6+10;
signed main()
{
	int t;
	cin>>t;
	map <char,int> mp;
	mp['E']=0; mp['W']=2; mp['N']=1; mp['S']=3;
	while(t--){
		int m;
		cin>>m;
		int idx=0;
		char d,in;
		string kl[300];
		int su[300];
		for(int i=0;i<=40;i++) su[i]=0;
		for(int i=0;i<m;i++){
			char c;
			int a;
			cin>>c>>a;
			if(i==0) {
				d=c;
				in=c;
				kl[idx]="Z";
				su[idx]=a;
				idx++;
				continue;
			}
			int op=mp[in]; int ed=mp[c];
			if(abs(op-ed)==2){
				kl[idx]="L";
				idx++;
				kl[idx]="L";
				idx++;
				su[idx]=a;
				kl[idx]="Z";
				idx++;
				in=c;
				continue;
			}
			if((op-ed)>0) {
				if(op-ed==3) kl[idx]="L";
				else kl[idx]="R";
				idx++;
			}
			else {
				if(op-ed==-3) kl[idx]="R";
				else kl[idx]="L";
				idx++;
			}
			su[idx]=a;
			kl[idx]="Z";
			idx++;
			in=c;
		}
		cout<<idx<<' '<<d<<endl;
		for(int i=0;i<idx;i++){
			cout<<kl[i];
			if(su[i]) cout<<' '<<su[i];
			cout<<endl;
		}
	}
}
 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
5
451
114514

output:

9 4
Z 51
L
Z 14514
L
Z 14514
L
Z 14514
L
Z 14514
9 4
Z 14368
L
Z 14368
L
Z 14368
L
Z 14368
L
Z 14368
9 4
Z 14368
L
Z 14368
L
Z 14368
L
Z 14368
L
Z 14368

result:

wrong answer 1st lines differ - expected: '21', found: '9 4'