QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#711854#9546. Recover Statisticsir101#WA 0ms3596kbC++201.2kb2024-11-05 13:47:082024-11-05 13:47:09

Judging History

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

  • [2024-11-05 13:47:09]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3596kb
  • [2024-11-05 13:47:08]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define PII pair<int,int>
#define PI4 pair<int,array<int,3>>
//#define endl '\n'
#define int long long
#define i64 long long
#define  lc p<<1
#define  rc p<<1|1
using namespace  std;
const int N = 1e6 + 10;

int lowbit(int x) {
	return x & -x;
}
vector<PII>ans1;
string s;
void solve() {
	cin >> s;
	ans1.clear();
	int n = s.length();
	s = ' ' + s;
	int f = 1, l = 0;
	int r=0;
	for (int i = n - 3; i >= 0; i--) {
		if (s[i] == '>') {

		} else {
			if (i >= 2) {
				for (int j = i + 3; j <= n; j+=3) {
					ans1.push_back({1,j});
				}
				r=i;
			}else{
				f=0;
			}
			break;
		}
	}
	reverse(ans1.begin(),ans1.end());
	if (s[n] == s[n - 1] && s[n - 1] == s[n - 2] && s[n] == '>' && s[1] == '>') {

	} else {
		f = 0;
	}
	for(int i=2;i<r;i++){
		if(s[i]=='>'){
			ans1.push_back({i,r-i+4});
		}
	}
	if(!f){
		cout<<"No\n";
		return;
	}
	cout<<"Yes ";
	cout<<ans1.size()+1<<endl;
	cout<<1<<' '<<n<<endl;
	for(auto[u,v]:ans1){
		cout<<u<<' '<<v<<endl;
	}
}
signed main() {
	ios::sync_with_stdio(false), cin.tie(0);
	ll t = 1;
	cin >> t;
	while (t--) {
		solve();
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3596kb

input:

50
95
99

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No

result:

wrong output format Expected integer, but "No" found