QOJ.ac
QOJ
QOJ is currently under a maintenance. It might be unavailable in the following a few hours.
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#616799 | #8639. 消除 | connection | 0 | 12ms | 5332kb | C++14 | 759b | 2024-10-06 11:53:39 | 2024-10-06 11:53:41 |
Judging History
answer
// #pragma GCC optimize(1)
// #pragma GCC optimize(2)
// #pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
// #include <bits/extc++.h>
// using namespace __gnu_cxx;
// using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
#define mod ll(1e9+7)
string s;int n;
bool check(string s){
if(!s.size())return 1;
bool cur = 0;
for(int i=1;i<s.size()||!cur;i++){
if(s[i]=='0'){
string a = s;
a.erase(i-1,2);
cur|=check(a);
}
}
for(int i=0;i<s.size()-1||!cur;i++){
if(s[i]=='1'){
string a = s;
a.erase(i,2);
cur|=check(a);
}
}
return cur;
}
int main(){
// cin.tie(nullptr).sync_width_stdio(0);
cin>>n>>s;
cout<<16<<endl;
// cout<<check("0100")<<endl;
return 0;
}
詳細信息
Pretests
Final Tests
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3732kb
input:
8 ????????
output:
16
result:
wrong answer 1st numbers differ - expected: '2764', found: '16'
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 3464kb
input:
8 100?011?
output:
16
result:
wrong answer 1st numbers differ - expected: '240', found: '16'
Test #3:
score: 0
Wrong Answer
time: 0ms
memory: 3524kb
input:
4997 ??????1???????????????????1????????????????????????????????????????0?????????01???0????????????????????????1??1?????0???1?1????????????0????0?????????????????????????????0???0??????????0?????1100????0??1???????????1????????????????????????1??000??????????????????????????????0????????????0?????1...
output:
16
result:
wrong answer 1st numbers differ - expected: '481706525', found: '16'
Test #4:
score: 0
Wrong Answer
time: 0ms
memory: 3772kb
input:
4999 011???1011?10?1?00010?10??01?010?00?0?0??0100?010001001???10??00000110001?0??010??10??0?0??0?00??11001011011??11?11?1?11?1???0?1?1??0?1?00100?1011001111101011?101001?0???000?11111010?0010?0000?1111000?01?10???0?1001?1?11????010?1?0?0??10111?1?011??0111111?00???0??0?111??10???0???0?1?00010?1?010...
output:
16
result:
wrong answer 1st numbers differ - expected: '927141779', found: '16'
Test #5:
score: 0
Wrong Answer
time: 0ms
memory: 3536kb
input:
4998 ?1?1???1???0???1???1?1????????0???????????????????????????0??????????????????????10???????????????????????0??1???????0??0???????1???????1?10?????????????????0?0???????00?1?????0???????????0????????0???????????1??1?????0???????????????????????????????0??????????1?????????????????????????????????...
output:
16
result:
wrong answer 1st numbers differ - expected: '527991571', found: '16'
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 3604kb
input:
5000 100?011?00101?0?010?010110??1000?1?01111?0?1?011?11011???101?11?0?110?10?0?01011??10?01??10100?0?0???00?10??11011111?001101?000?00000101?0?01?10?11111110?11?1?01?1?11?01??111?10?101??11011?0?100?11?01100?1???10?1010?110110110011???0?00000??1?111?0001??101?0?10?111?0?00?0?0?011?111111?0000?1010?...
output:
16
result:
wrong answer 1st numbers differ - expected: '775395392', found: '16'
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 3580kb
input:
4997 ??????1???????????????????1????????????????????????????????????????0?????????01???0????????????????????????1??1?????0???1?1????????????0????0?????????????????????????????0???0??????????0?????1100????0??1???????????1????????????????????????1??000??????????????????????????????0????????????0?????1...
output:
16
result:
wrong answer 1st numbers differ - expected: '481706525', found: '16'
Test #8:
score: 0
Wrong Answer
time: 0ms
memory: 3600kb
input:
5000 100?011?00101?0?010?010110??1000?1?01111?0?1?011?11011???101?11?0?110?10?0?01011??10?01??10100?0?0???00?10??11011111?001101?000?00000101?0?01?10?11111110?11?1?01?1?11?01??111?10?101??11011?0?100?11?01100?1???10?1010?110110110011???0?00000??1?111?0001??101?0?10?111?0?00?0?0?011?111111?0000?1010?...
output:
16
result:
wrong answer 1st numbers differ - expected: '775395392', found: '16'
Test #9:
score: 0
Wrong Answer
time: 0ms
memory: 3804kb
input:
4999 ?1?1???1???0???1???1?1????????0???????????????????????????0??????????????????????10???????????????????????0??1???????0??0???????1???????1?10?????????????????0?0???????00?1?????0???????????0????????0???????????1??1?????0???????????????????????????????0??????????1?????????????????????????????????...
output:
16
result:
wrong answer 1st numbers differ - expected: '356481180', found: '16'
Test #10:
score: 0
Wrong Answer
time: 0ms
memory: 3520kb
input:
4998 011???1011?10?1?00010?10??01?010?00?0?0??0100?010001001???10??00000110001?0??010??10??0?0??0?00??11001011011??11?11?1?11?1???0?1?1??0?1?00100?1011001111101011?101001?0???000?11111010?0010?0000?1111000?01?10???0?1001?1?11????010?1?0?0??10111?1?011??0111111?00???0??0?111??10???0???0?1?00010?1?010...
output:
16
result:
wrong answer 1st numbers differ - expected: '300686604', found: '16'
Test #11:
score: 0
Wrong Answer
time: 12ms
memory: 5172kb
input:
999996 ????1??100??????????1?1??????????????????????????????1???????????1?1??????1?????0???????????????10????????????1????????????????????????????????0????????0??1??????????????????????0???1100??01????1????????????????0?0???0???????????????????????1?1???????0???1????????????????0???????????????????1...
output:
16
result:
wrong answer 1st numbers differ - expected: '775312388', found: '16'
Test #12:
score: 0
Wrong Answer
time: 12ms
memory: 5180kb
input:
999999 01?1??1?1??0000111?1?0???1000011?10?1?1??10010???10?011????0?1?000??0110??10?00?0111000001100001100?1?001111?1??1101???01101?101?010011??01??0?1?00?0??1010101?0?11??01?111111010011011?0100000?10010?0?0?10??1??001??00100?0??1?0?00001?11??1111001?0110?111??1????0?11?00110000110?000011?0??0?100?...
output:
16
result:
wrong answer 1st numbers differ - expected: '240432497', found: '16'
Test #13:
score: 0
Wrong Answer
time: 8ms
memory: 5244kb
input:
999998 ???????????0????10??1?????????1???????????????????????1??????1????0?????10????????0??0???0?1??????0???1?????1???0???????????0???????11??????????1????0?????????0????0???????0????01?0?????????????0???????10??????1????????1??1?0?1??????????????1????????????1?1????????????????????????????????????...
output:
16
result:
wrong answer 1st numbers differ - expected: '447215377', found: '16'
Test #14:
score: 0
Wrong Answer
time: 12ms
memory: 5256kb
input:
999998 01?1??1?1??0000111?1?0???1000011?10?1?1??10010???10?011????0?1?000??0110??10?00?0111000001100001100?1?001111?1??1101???01101?101?010011??01??0?1?00?0??1010101?0?11??01?111111010011011?0100000?10010?0?0?10??1??001??00100?0??1?0?00001?11??1111001?0110?111??1????0?11?00110000110?000011?0??0?100?...
output:
16
result:
wrong answer 1st numbers differ - expected: '149098020', found: '16'
Test #15:
score: 0
Wrong Answer
time: 12ms
memory: 5248kb
input:
1000000 ?????0????????11???0???1?????1??????0???????0?1??101???????????0????????????????????1?????????????0?????????????????1????????????????1???????1????????????????0????????????????????????????????00????????1???1???????10????1???10?1?????1?????????????0?1??0?????0????????????????1??????????0??????...
output:
16
result:
wrong answer 1st numbers differ - expected: '934928332', found: '16'
Test #16:
score: 0
Wrong Answer
time: 12ms
memory: 5176kb
input:
999996 10????11?0??1?010??1?1?101??111?111?0100??00?0??01?0??11101?0???0111??1???1?0011?11?00011?1?101??01?00??011011?1?0?1000?0?1??1???10?101?1100????0?0??11?11?1??11111?100010011011?10?00?11?01110?010??10110???1?10?11?1010000?000?10??01?11?001?1?0????11011?0?001001010?01?1????11?0101??0?01010111?1...
output:
16
result:
wrong answer 1st numbers differ - expected: '859594688', found: '16'
Test #17:
score: 0
Wrong Answer
time: 12ms
memory: 5332kb
input:
999997 ????1??100??????????1?1??????????????????????????????1???????????1?1??????1?????0???????????????10????????????1????????????????????????????????0????????0??1??????????????????????0???1100??01????1????????????????0?0???0???????????????????????1?1???????0???1????????????????0???????????????????1...
output:
16
result:
wrong answer 1st numbers differ - expected: '77832459', found: '16'
Test #18:
score: 0
Wrong Answer
time: 12ms
memory: 5292kb
input:
999999 0000110000100?0?1000?100001?100?11?00?111?11?100?0110??001???110?0000111?0?111?01?01?00?10111??1011000??0?110?0010?10?001?????1?000110010011?1?1???0?011011?10?1000?1?1???1?110110111101??10?000100??1??11100?1?000111?101????010010?1010?100??0?00??01??00101?1?1110?00011011111101?1?1??001010?0?01...
output:
16
result:
wrong answer 1st numbers differ - expected: '853633847', found: '16'
Test #19:
score: 0
Wrong Answer
time: 12ms
memory: 5252kb
input:
1000000 ?????0????????11???0???1?????1??????0???????0?1??101???????????0????????????????????1?????????????0?????????????????1????????????????1???????1????????????????0????????????????????????????????00????????1???1???????10????1???10?1?????1?????????????0?1??0?????0????????????????1??????????0??????...
output:
16
result:
wrong answer 1st numbers differ - expected: '934928332', found: '16'
Test #20:
score: 0
Wrong Answer
time: 12ms
memory: 5228kb
input:
999999 0000110000100?0?1000?100001?100?11?00?111?11?100?0110??001???110?0000111?0?111?01?01?00?10111??1011000??0?110?0010?10?001?????1?000110010011?1?1???0?011011?10?1000?1?1???1?110110111101??10?000100??1??11100?1?000111?101????010010?1010?100??0?00??01??00101?1?1110?00011011111101?1?1??001010?0?01...
output:
16
result:
wrong answer 1st numbers differ - expected: '853633847', found: '16'