QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#387885 | #8287. Caught in the Middle | KLPP# | WA | 0ms | 3524kb | C++14 | 510b | 2024-04-12 22:52:43 | 2024-04-12 22:52:44 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for (int i=a; i<b; i++)
#define trav(a,b) for (auto a:b)
#define all(x) begin(x),end(x)
#define lld long long
void solve() {
int n;
cin>>n;
string s;
cin>>s;
int cnt=0;
rep(i,0,n){
if(s[i]=='R')cnt++;
else cnt--;
if(cnt<0){
cout<<"Alice\n";
return;
}
}
cout<<"Bob\n";
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int tt = 1;
cin >> tt;
while (tt--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3524kb
input:
20 10 RLRRRRLLRR 10 LRLLLLRRLR 6 RLRLRL 10 LLRLRRRRLR 6 LRRLLL 3 RLR 5 LLRRR 6 RRRRRL 9 LRRRLRRLR 1 R 10 RRRLLRRLLL 6 LRLLLR 9 LLRLRLRLR 7 RRRRLRR 2 LL 10 RRRLLRRLRR 2 RL 7 RRLRRLR 3 LLR 10 LLRLRRRLLR
output:
Bob Alice Bob Alice Alice Bob Alice Bob Alice Bob Bob Alice Alice Bob Alice Bob Bob Bob Alice Alice
result:
wrong answer 1st lines differ - expected: 'Alice', found: 'Bob'