QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#560354#8689. CompressionYaremaWA 1ms3936kbC++20866b2024-09-12 15:17:282024-09-12 15:17:29

Judging History

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

  • [2024-09-12 15:17:29]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3936kb
  • [2024-09-12 15:17:28]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef double db;

void solve()
{
	string s;
	cin >> s;
	if (*min_element(ALL(s)) == *max_element(ALL(s)))
		cout << s[0] << '\n';
	else
	{
		int x = s[0] - '0';
		if (s[0] == s.back())
			cout << x << ' ' << 1 - x << ' ' << x << '\n';
		else
			cout << x << ' ' << 1 - x << '\n';
	}
}


int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int t = 1;
	while(t--)
		solve();
	
	return 0;
}




详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3752kb

input:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

0

result:

ok single line: '0'

Test #2:

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

input:

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

1

result:

ok single line: '1'

Test #3:

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

input:

0

output:

0

result:

ok single line: '0'

Test #4:

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

input:

1

output:

1

result:

ok single line: '1'

Test #5:

score: -100
Wrong Answer
time: 1ms
memory: 3668kb

input:

111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000111110000011111000001111100000...

output:

1 0

result:

wrong answer 1st lines differ - expected: '10', found: '1 0'