QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#865959 | #7533. Jeopardized Betting | ushg8877# | WA | 1ms | 3584kb | C++20 | 573b | 2025-01-22 09:43:39 | 2025-01-22 09:43:43 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
#define mid ((l+r)>>1)
#define lowbit(i) (i&(-i))
using namespace std;
int dp[35][35];
signed main(){
int n; cin>>n;
for(int j=0;j<n;j++) dp[n][j]=(1ll<<(2*n+1)),dp[j][n]=0;
for(int i=n-1;i>=0;i--){
for(int j=n-1;j>=0;j--){
dp[i][j]=(dp[i][j+1]+dp[i+1][j])/2;
}
}
assert(dp[0][0]==(1ll<<(2*n)));
int nowx=0,nowy=0;
while(nowx!=n&&nowy!=n){
cout<<llabs(dp[nowx+1][nowy]-dp[nowx][nowy])<<"\n"; fflush(stdout);
string ret; cin>>ret;
if(ret=="Win") nowx++;
else nowy++;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3584kb
input:
3 Lost Won Won
output:
24 24 16
result:
wrong answer format Unexpected end of file - int64 expected