QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#426299 | #8689. Compression | UFRJ | WA | 1ms | 3768kb | C++23 | 378b | 2024-05-31 02:18:45 | 2024-05-31 02:18:46 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
using lint = int64_t;
const int mod = 998244353;
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
string s, ans;
cin>>s;
for(char c : s){
if(ans.empty() || ans.back() != c) ans .push_back(c);
}
if(ans.size() >= 4){
cout<<ans[0]<<ans[1]<<"\n";
}
else{
cout<<ans<<"\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3724kb
input:
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
0
result:
ok single line: '0'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3768kb
input:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
0
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
1
output:
1
result:
ok single line: '1'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000...
output:
10
result:
ok single line: '10'
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3684kb
input:
010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101...
output:
01
result:
wrong answer 1st lines differ - expected: '010', found: '01'