QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#574856#8689. CompressiondeepthoughtAC ✓1ms3968kbC++23618b2024-09-19 02:52:492024-09-19 02:52:49

Judging History

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

  • [2024-09-19 02:52:49]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3968kb
  • [2024-09-19 02:52:49]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int MAXX = 10005;

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    string s;
    cin >> s;
    vector <char> v;
    char last = s[0];
    v.push_back(last);
    for(int i = 1; i < s.length(); i++) {
        if(s[i] == last) continue;
        else {
            last = s[i];
            v.push_back(last);
        }
    }
    if(v.size() < 3) for(auto x: v) cout << x;
    else if(v.size() % 2 == 1) cout << v[0] << v[1] << v[2];
    else cout << v[0] << v[1];
    cout << endl;

}


/*

10110

1010


*/


详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3708kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok single line: '0'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3708kb

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

1

result:

ok single line: '1'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

0

output:

0

result:

ok single line: '0'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

1

output:

1

result:

ok single line: '1'

Test #5:

score: 0
Accepted
time: 1ms
memory: 3700kb

input:

111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000...

output:

10

result:

ok single line: '10'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101...

output:

010

result:

ok single line: '010'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010...

output:

101

result:

ok single line: '101'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

00

output:

0

result:

ok single line: '0'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

11

output:

1

result:

ok single line: '1'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101...

output:

01

result:

ok single line: '01'

Test #11:

score: 0
Accepted
time: 1ms
memory: 3968kb

input:

110101111001011001110110001001100100110000101010011101010101100111001111101100110011010110110010010101010011101010101000001011110010100001000101000100011011000001111010110100001111111010010001011000111110110011000111010000001010100001011010110110101010011001011101110110001000000011000011011000110011...

output:

101

result:

ok single line: '101'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3928kb

input:

000010111010011001100100011111101100000011110010111101101000101111011110101100000001010101101111000110100001101001111101100010011100011101000010010000010010011101111011110100111010101000011001010010000011001000100011011011000011100100111011101100110111111101011111100111000010000011101111100110011001...

output:

01

result:

ok single line: '01'

Test #13:

score: 0
Accepted
time: 1ms
memory: 3780kb

input:

001000001111111011111011010110001100101101111110101001000101000001001011100111101100001001011111001001100001011010100001001000111111010101000011111110101100010111110100100011000011000010010101101110011111100001001110000100110000111010110101110100001010111100010111100000100110110100101101001011100010...

output:

01

result:

ok single line: '01'

Test #14:

score: 0
Accepted
time: 1ms
memory: 3708kb

input:

000101111110101001111001111001001010010010111010001000010010101011100110001000100101010001110000111110111101011111000100100110000110000000010100001010011110011000000001000000001000010111111010010101000011101110100101010010000110001110001101001000110001101011001100111101010010111101011011111110100110...

output:

01

result:

ok single line: '01'

Test #15:

score: 0
Accepted
time: 1ms
memory: 3772kb

input:

111100001101110111100000100000100000010001110101001111101001111011101110011000101101101100010011101110100101110011011101011001101011011011101010101011000001001000000011100100001000000011100001110010110101111101000110110100011011011101110111010101110100011111111011011110010001000010111011100111111001...

output:

101

result:

ok single line: '101'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

111000000000001111001110101010000010110110001011001001100111111011000010100111000000100101010001010111110011111011111101000100101110001001011000111011000101011110000000001100111101111011101011110011001110001100011110110010001111111000011101001100011000101110000110010010000111011101001011110011111001...

output:

10

result:

ok single line: '10'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

000101001001011101111111111101011010000001100001111111110001010101101000101110011111011110101010111101010000010011110101010000110111000010000100000010111101101000110100000100111010000001011001001000100001011110111011111101110000111101111110100010101001000110111001001110001011000011010000010000100010...

output:

010

result:

ok single line: '010'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

101010011101000100011111010101100110101101111010101000110100011010100111101101100111001111000110000011000100000100001110110110010100111110010001100111010010000110000000111111100101001000001001011101111101011111111111001010101111110110000010011001111110001110001101010100011110111100011001111001000001...

output:

101

result:

ok single line: '101'

Test #19:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

001101001011011011011100101101000000100101001001101010000010111000000010101010100111111111101111110111010001110001101010101011100010111100001001010111000010111100110100010100001001010000011111100100011001111110110110111011010011111110011000110101111110000100100110001100100100000001101000100000100110...

output:

010

result:

ok single line: '010'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

01101010111111011101010001011101010000110011110001010100010110110111011001100000110010000001001100010000111001001000101

output:

01

result:

ok single line: '01'

Test #21:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

1011101100100001001001001110110110101101001000110001111

output:

101

result:

ok single line: '101'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3696kb

input:

011110101011011011101101111001111111110000100001111111010110010101100100011011110011011101101100101010000000101101010001100110101100001000000101000000101001101011100010011101100010101101100100010111010111010110011111001001010010100011101101101000001111111010010010010000001101000111011011010000100110...

output:

01

result:

ok single line: '01'

Test #23:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

001110110000110011101010010001111001100011001001010000101110111110001101101101100001100100111010110111001110000110011010010000010111111000110111100010101111111010100001100011001011010000111100101100110101100001100010101001001101101110011001110000001100111110000111010111101010101111100010001000010111...

output:

01

result:

ok single line: '01'

Test #24:

score: 0
Accepted
time: 0ms
memory: 3672kb

input:

010001000010001111010111100101010101111111001010110010001001110110101101000111101110010111011011000001100100001001010001100101110000001101110001111000100011000110001000000000110110001111011010000000011111101000100110100100010101101000000111100000111001000011111111001110100101111110100001101010001001...

output:

010

result:

ok single line: '010'

Test #25:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

111110010010111010110100000100011010100000001010000010011111111101110010110101100101010000001000010111001011010100001000010000001101110111101100111001111000001011011000011010111100001011110001011010000100110110111000000010000101000110011100000010000011011101110010111101100011011011101110010000101010...

output:

101

result:

ok single line: '101'

Test #26:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

111010001

output:

101

result:

ok single line: '101'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

011101101

output:

01

result:

ok single line: '01'

Test #28:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

010

output:

010

result:

ok single line: '010'

Test #29:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

0111010

output:

010

result:

ok single line: '010'

Test #30:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

1001110100

output:

10

result:

ok single line: '10'

Extra Test:

score: 0
Extra Test Passed