QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#176476 | #1442. Even More Exciting Game | Crysfly | WA | 1ms | 3588kb | C++17 | 1.4kb | 2023-09-11 18:09:26 | 2023-09-11 18:09:26 |
Judging History
answer
// what is matter? never mind.
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2")
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
//#define int long long
#define ull unsigned long long
using namespace std;
inline int read()
{
char c=getchar();int x=0;bool f=0;
for(;!isdigit(c);c=getchar())f^=!(c^45);
for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
if(f)x=-x;return x;
}
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;
#define maxn 200005
#define inf 0x3f3f3f3f
int cnt[38],n;
bool chk(){
if(cnt[25]==n) return cnt[25]%3==2;
if(cnt[25]<n-1) return 1;
assert(cnt[25]==n-1);
For(j,0,24)
if(cnt[j]) return (26-j)%3==0;
assert(0);
}
char s[maxn];
string opt;
signed main()
{
cin>>n>>opt>>s;
For(i,0,n-1) ++cnt[s[i]-'a'];
if(opt[0]=='O'){
if(chk())puts("Lose");
else puts("Win");
return 0;
}
if(n==1){
puts("Win");
return 0;
}
For(i,0,25){
if(cnt[i]){
--cnt[i],--n;
if(!chk())puts("Win"),exit(0);
++cnt[i],++n;
if(i!=25){
--cnt[i],++cnt[i+1];
if(!chk())puts("Win"),exit(0);
++cnt[i],--cnt[i+1];
}
}
}
puts("Lose");
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3416kb
input:
1 Petro a
output:
Win
result:
ok "Win"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
17 Oleg-Andriy olegandriywillwin
output:
Lose
result:
ok "Lose"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3420kb
input:
3 Oleg-Andriy zzz
output:
Win
result:
ok "Win"
Test #4:
score: 0
Accepted
time: 1ms
memory: 3364kb
input:
5 Petro zzzzz
output:
Win
result:
ok "Win"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3416kb
input:
9 Oleg-Andriy bfslyychn
output:
Lose
result:
ok "Lose"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3364kb
input:
8 Petro yzdtaows
output:
Lose
result:
ok "Lose"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
7 Oleg-Andriy wsnbbfp
output:
Lose
result:
ok "Lose"
Test #8:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
8 Oleg-Andriy tmwjdxhn
output:
Lose
result:
ok "Lose"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3416kb
input:
7 Petro rghrdob
output:
Lose
result:
ok "Lose"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
3495 Oleg-Andriy zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
output:
Win
result:
ok "Win"
Test #11:
score: -100
Wrong Answer
time: 1ms
memory: 3440kb
input:
2563 Oleg-Andriy zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzyzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
output:
Win
result:
wrong answer 1st words differ - expected: 'Lose', found: 'Win'