QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#426299#8689. CompressionUFRJWA 1ms3768kbC++23378b2024-05-31 02:18:452024-05-31 02:18:46

Judging History

你现在查看的是最新测评结果

  • [2024-05-31 02:18:46]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3768kb
  • [2024-05-31 02:18:45]
  • 提交

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'