Submission #71364249


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#define debug(arg) cout << "[" << #arg << "]: " << arg << endl
#else
#define debug(arg) 42
#endif

using llu = unsigned long long;
using ll = long long;

#define vec vector
#define all(n) begin(n), end(n)
#define pb push_back

void solv() {
	int x, y, z; cin >> x >> y >> z;
	vec<int> s1, s2, s3;
	if (x == y) {
		s1.assign(x, 0);
		s2.assign(z, 0);
		s3.assign(z, 0);
	} else {
		int d1 = y - x, d2 = z - x;
		s1.assign(y, 0);
		s2.assign(z, 0);
		for (int i = 0; i < d2; ++i) s2[i + x] = 1;
		s3.assign(y + d2, 0);
		for (int i = 0; i < d2; ++i) s3[i + y] = 1;
	}
	cout << s1.size() << ' ';
	for (auto &i : s1) cout << i << ' ';
	cout << '\n';
	cout << s2.size() << ' ';
	for (auto &i : s2) cout << i << ' ';
	cout << '\n';
	cout << s3.size() << ' ';
	for (auto &i : s3) cout << i << ' ';
	cout << '\n';
}

signed main() {
	ios_base::sync_with_stdio(0), cin.tie(0);
	int t = 1;
	//cin >> t;
	while (t--) solv();
	return 0;
}

Submission Info

Submission Time
Task B - Three Sequences
User fisher199
Language C++23 (Clang 21.1.0)
Score 500
Code Size 1038 Byte
Status AC
Exec Time 8 ms
Memory 2988 KiB

Compile Error

./Main.cpp:26:7: warning: unused variable 'd1' [-Wunused-variable]
   26 |                 int d1 = y - x, d2 = z - x;
      |                     ^~
1 warning generated.

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 1
AC × 27
Set Name Test Cases
Sample 00-sample-001.txt
All 00-sample-001.txt, 01-one-001.txt, 01-one-002.txt, 01-one-003.txt, 01-one-004.txt, 01-one-005.txt, 01-one-006.txt, 01-one-007.txt, 01-one-008.txt, 01-one-009.txt, 01-one-010.txt, 01-one-011.txt, 01-one-012.txt, 01-one-013.txt, 01-one-014.txt, 01-one-015.txt, 02-two-001.txt, 02-two-002.txt, 02-two-003.txt, 02-two-004.txt, 02-two-005.txt, 02-two-006.txt, 02-two-007.txt, 02-two-008.txt, 02-two-009.txt, 02-two-010.txt, 02-two-011.txt
Case Name Status Exec Time Memory
00-sample-001.txt AC 8 ms 2864 KiB
01-one-001.txt AC 1 ms 2836 KiB
01-one-002.txt AC 1 ms 2772 KiB
01-one-003.txt AC 1 ms 2940 KiB
01-one-004.txt AC 1 ms 2988 KiB
01-one-005.txt AC 1 ms 2812 KiB
01-one-006.txt AC 1 ms 2988 KiB
01-one-007.txt AC 1 ms 2976 KiB
01-one-008.txt AC 1 ms 2860 KiB
01-one-009.txt AC 1 ms 2812 KiB
01-one-010.txt AC 1 ms 2924 KiB
01-one-011.txt AC 1 ms 2816 KiB
01-one-012.txt AC 1 ms 2756 KiB
01-one-013.txt AC 1 ms 2812 KiB
01-one-014.txt AC 1 ms 2844 KiB
01-one-015.txt AC 1 ms 2820 KiB
02-two-001.txt AC 1 ms 2836 KiB
02-two-002.txt AC 1 ms 2976 KiB
02-two-003.txt AC 1 ms 2816 KiB
02-two-004.txt AC 1 ms 2844 KiB
02-two-005.txt AC 1 ms 2860 KiB
02-two-006.txt AC 1 ms 2812 KiB
02-two-007.txt AC 1 ms 2812 KiB
02-two-008.txt AC 1 ms 2860 KiB
02-two-009.txt AC 1 ms 2812 KiB
02-two-010.txt AC 1 ms 2940 KiB
02-two-011.txt AC 1 ms 2844 KiB