QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#711854 | #9546. Recover Statistics | ir101# | WA | 0ms | 3596kb | C++20 | 1.2kb | 2024-11-05 13:47:08 | 2024-11-05 13:47:09 |
Judging History
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();
}
}
详细
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