QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#347563 | #7533. Jeopardized Betting | ucup-team1209 | AC ✓ | 1ms | 3896kb | C++20 | 818b | 2024-03-09 14:16:23 | 2024-03-09 14:16:23 |
Judging History
answer
#include<bits/stdc++.h>
using std::cin;
using std::cout;
using ll = long long;
using u64 = unsigned long long;
void IOinit() {
std::ios::sync_with_stdio(false), cin.tie(0);
#ifdef zqj
// freopen("1.in", "r", stdin);
#endif
}
const int N = 105;
u64 dp[N][N];
int main() {
IOinit();
int n;
cin >> n;
u64 w = ((u64)1 << 2 * n);
for(int i = 0;i < n;++i) {
dp[i][n] = 0;
dp[n][i] = 2 * w;
}
for(int i = n - 1;i >= 0;--i)
for(int j = n - 1;j >= 0;--j)
dp[i][j] = (dp[i + 1][j] + dp[i][j + 1]) / 2;
int a = 0, b = 0;
for(int i = 0;i < n * 2;++i) {
u64 p = dp[a + 1][b] - dp[a][b];
cout << p << std::endl;
std::string s;
cin >> s;
if(s[0] == 'W') {
w += p;
++ a;
} else {
w -= p;
++ b;
}
if(a == n || b == n) {
return 0;
}
}
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3832kb
input:
3 Lost Won Won Won
output:
24 24 32 32
result:
ok Ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
4 Won Lost Won Lost Won Lost Won
output:
80 80 96 96 128 128 256
result:
ok Ok
Test #3:
score: 0
Accepted
time: 1ms
memory: 3896kb
input:
30 Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won
output:
120269065998164160 120269065998164160 118159082384161280 113939115156155520 107724254329456128 99744679934681600 90334804469145600 79911557799628800 68943304768307200 57912376005378048 47275408983982080 37426365445652480 28667003320074240 21188654627880960 15067487735382016 10273287092305920 6689582...
result:
ok Ok
Test #4:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
30 Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost
output:
120269065998164160 120269065998164160 118159082384161280 113939115156155520 107724254329456128 99744679934681600 90334804469145600 79911557799628800 68943304768307200 57912376005378048 47275408983982080 37426365445652480 28667003320074240 21188654627880960 15067487735382016 10273287092305920 6689582...
result:
ok Ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
7 Won Won Won Won Won Won Won
output:
3696 3696 3360 2688 1792 896 256
result:
ok Ok
Test #6:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
7 Lost Lost Lost Lost Lost Lost Lost
output:
3696 3696 3360 2688 1792 896 256
result:
ok Ok
Test #7:
score: 0
Accepted
time: 1ms
memory: 3892kb
input:
30 Lost Won Lost Won Lost Won Lost Lost Won Lost Lost Won Won Lost Lost Won Won Lost Won Lost Lost Won Won Lost Lost Lost Won Lost Lost Won Won Lost Won Won Won Won Lost Won Won Lost Lost Won Won Won Won Won Lost Lost Lost Lost Won Lost Lost Won Won Lost Lost Won Won
output:
120269065998164160 120269065998164160 122379049612167040 122379049612167040 124604123241479168 124604123241479168 126955144434714624 126955144434714624 124465827877171200 129444460992258048 126802737298538496 121519289911099392 129275840330956800 134896529040998400 131898828395642880 125903427104931...
result:
ok Ok
Test #8:
score: 0
Accepted
time: 1ms
memory: 3892kb
input:
30 Won Lost Lost Lost Won Won Lost Won Won Won Won Won Lost Lost Lost Lost Lost Lost Won Lost Lost Lost Lost Won Won Lost Won Lost Won Won Lost Lost Lost Lost Won Won Lost Won Lost Won Lost Lost Won Won Lost Won Won Won Won Lost Won Won Lost Won Lost Won Lost Won Lost
output:
120269065998164160 120269065998164160 122379049612167040 122379049612167040 120153975982854912 124604123241479168 126955144434714624 126955144434714624 129444460992258048 129444460992258048 126802737298538496 121519289911099392 113762739491241984 123655151620915200 131898828395642880 137894229686353...
result:
ok Ok
Test #9:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
1 Won
output:
4
result:
ok Ok
Test #10:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
1 Lost
output:
4
result:
ok Ok
Test #11:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
30 Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won Won
output:
120269065998164160 120269065998164160 118159082384161280 113939115156155520 107724254329456128 99744679934681600 90334804469145600 79911557799628800 68943304768307200 57912376005378048 47275408983982080 37426365445652480 28667003320074240 21188654627880960 15067487735382016 10273287092305920 6689582...
result:
ok Ok
Test #12:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
30 Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost Lost
output:
120269065998164160 120269065998164160 118159082384161280 113939115156155520 107724254329456128 99744679934681600 90334804469145600 79911557799628800 68943304768307200 57912376005378048 47275408983982080 37426365445652480 28667003320074240 21188654627880960 15067487735382016 10273287092305920 6689582...
result:
ok Ok
Test #13:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
30 Won Won Lost Lost Lost Lost Won Won Lost Won Lost Lost Won Lost Lost Won Lost Lost Won Lost Lost Won Won Won Won Lost Won Won Lost Lost Won Won Lost Lost Won Lost Won Won Won Won Lost Lost Won Lost Won Lost Won Lost Won Lost Won Lost Lost Won Won Won Lost Won
output:
120269065998164160 120269065998164160 118159082384161280 122379049612167040 124604123241479168 124604123241479168 122253102048243712 126955144434714624 129444460992258048 129444460992258048 132086184685977600 132086184685977600 129275840330956800 134896529040998400 131898828395642880 125903427104931...
result:
ok Ok
Test #14:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
30 Won Lost Lost Won Won Lost Won Won Won Lost Lost Won Lost Lost Won Lost Lost Lost Won Lost Won Won Won Lost Won Won Lost Lost Won Won Won Lost Won Lost Lost Lost Won Won Lost Lost Lost Won Won Lost Won Won Lost Lost Won Won Lost Won Lost Lost Lost Lost Won Lost
output:
120269065998164160 120269065998164160 122379049612167040 122379049612167040 124604123241479168 124604123241479168 126955144434714624 126955144434714624 124465827877171200 119487194762084352 126802737298538496 132086184685977600 129275840330956800 134896529040998400 137894229686353920 137894229686353...
result:
ok Ok
Test #15:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
29 Won Lost Lost Lost Lost Won Won Lost Won Won Won Lost Lost Lost Won Won Won Won Won Lost Lost Lost Won Won Won Lost Lost Lost Won Lost Lost Won Won Won Lost Won Won Lost Won Won Won Won Won Lost Lost Lost Lost Lost Won Won Lost Lost Lost Lost Lost Won Won
output:
30594762403041760 30594762403041760 31151030810369792 31151030810369792 30563275512060928 29387764915443200 31116456969292800 32361115248064512 31700684324634624 33021546171494400 33724132260249600 33724132260249600 34473557421588480 34473557421588480 33671846783877120 35275268059299840 361356404509...
result:
ok Ok
Test #16:
score: 0
Accepted
time: 1ms
memory: 3896kb
input:
29 Lost Lost Won Lost Lost Won Won Won Lost Won Won Won Won Won Lost Won Won Lost Lost Lost Lost Won Won Won Won Lost Lost Won Won Lost Lost Lost Won Lost Won Lost Won Won Lost Won Lost Lost Lost Lost Lost Lost Won Won Lost Won Lost Won Won Lost Lost Won Lost
output:
30594762403041760 30594762403041760 30038493995713728 31151030810369792 30563275512060928 29387764915443200 31116456969292800 32361115248064512 33021546171494400 33021546171494400 33724132260249600 33724132260249600 32974707098910720 31475856776232960 29279866768588800 32068425508454400 297219553492...
result:
ok Ok
Test #17:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
29 Won Lost Won Won Won Lost Won Won Won Lost Won Lost Won Lost Won Lost Lost Lost Lost Lost Lost Lost Lost Won Won Won Won Won Won Won Won Won Won Won Lost Won Won Won Lost Won Won Won Won Won
output:
30594762403041760 30594762403041760 31151030810369792 31151030810369792 30563275512060928 29387764915443200 31116456969292800 29871798690521088 28042913056407552 25706003635040256 28440684872810496 25967581840392192 28852868711546880 26229880646860800 29279866768588800 26491308028723200 297219553492...
result:
ok Ok
Test #18:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
28 Lost Lost Won Won Lost Won Lost Won Lost Lost Won Won Lost Lost Lost Lost Lost Won Lost Lost Lost Lost Lost Lost Lost Lost Won Lost Won Lost Lost Lost Lost Lost Lost Won Lost Lost
output:
7787757702592448 7787757702592448 7640818878015232 7934696527169664 8090278812016128 8090278812016128 8255386542873600 8255386542873600 8431033065062400 8431033065062400 8243676774727680 8618389355397120 8818817014824960 8818817014824960 8603723916902400 8173537721057280 7544804050206720 67506141501...
result:
ok Ok
Test #19:
score: 0
Accepted
time: 1ms
memory: 3800kb
input:
5 Won Lost Won Won Lost Won Lost Won
output:
280 280 320 320 256 384 256 512
result:
ok Ok
Test #20:
score: 0
Accepted
time: 1ms
memory: 3876kb
input:
5 Lost Won Lost Lost Lost Won Won Lost
output:
280 280 320 320 256 128 256 512
result:
ok Ok