Task: | Coloring cube |
Sender: | aalto2024f_002 |
Submission time: | 2024-10-02 16:44:43 +0300 |
Language: | C++ (C++20) |
Status: | READY |
Result: | ACCEPTED |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | ACCEPTED | 0.01 s | details |
#6 | ACCEPTED | 0.02 s | details |
#7 | ACCEPTED | 0.02 s | details |
#8 | ACCEPTED | 0.04 s | details |
#9 | ACCEPTED | 0.05 s | details |
#10 | ACCEPTED | 0.05 s | details |
Code
#include <algorithm> #include <bits/stdc++.h> #include <string> using namespace std; #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() #define int long long string to_string(string s) { return '"' + s + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(bool b) { return (b ? "true" : "false"); } template <typename A, typename B> string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; } template <typename A> string to_string(A v) { bool first = true; string res = "{"; for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); } res += "}"; return res; } void debug_out() { cerr << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); } #ifdef LOCAL #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #else #define debug(...) 42 #endif const int N = 105; const string S = "RBG"; int n; void solve() { cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { for (int k = 0; k < n; k++) { cout << S[(i + j + k) % 3] << ' '; } cout << '\n'; } cout << '\n'; } } signed main() { cin.tie(0)->sync_with_stdio(0); int t = 1; // cin >> t; while (t--) { solve(); } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
3 |
correct output |
---|
R G B G B R B R G G B R ... |
user output |
---|
R B G B G R G R B B G R ... |
Test 2
Verdict: ACCEPTED
input |
---|
5 |
correct output |
---|
R G B R G G B R G B B R G B R R G B R G G B R G B ... |
user output |
---|
R B G R B B G R B G G R B G R R B G R B B G R B G ... Truncated |
Test 3
Verdict: ACCEPTED
input |
---|
6 |
correct output |
---|
R G B R G B G B R G B R B R G B R G R G B R G B G B R G B R ... |
user output |
---|
R B G R B G B G R B G R G R B G R B R B G R B G B G R B G R ... Truncated |
Test 4
Verdict: ACCEPTED
input |
---|
10 |
correct output |
---|
R G B R G B R G B R G B R G B R G B R G B R G B R G B R G B R G B R G B R G B R G B R G B R G B R G ... |
user output |
---|
R B G R B G R B G R B G R B G R B G R B G R B G R B G R B G R B G R B G R B G R B G R ... Truncated |
Test 5
Verdict: ACCEPTED
input |
---|
50 |
correct output |
---|
R G B R G B R G B R G B R G B ... |
user output |
---|
R B G R B G R B G R B G R B G ... Truncated |
Test 6
Verdict: ACCEPTED
input |
---|
53 |
correct output |
---|
R G B R G B R G B R G B R G B ... |
user output |
---|
R B G R B G R B G R B G R B G ... Truncated |
Test 7
Verdict: ACCEPTED
input |
---|
63 |
correct output |
---|
R G B R G B R G B R G B R G B ... |
user output |
---|
R B G R B G R B G R B G R B G ... Truncated |
Test 8
Verdict: ACCEPTED
input |
---|
95 |
correct output |
---|
R G B R G B R G B R G B R G B ... |
user output |
---|
R B G R B G R B G R B G R B G ... Truncated |
Test 9
Verdict: ACCEPTED
input |
---|
99 |
correct output |
---|
R G B R G B R G B R G B R G B ... |
user output |
---|
R B G R B G R B G R B G R B G ... Truncated |
Test 10
Verdict: ACCEPTED
input |
---|
100 |
correct output |
---|
R G B R G B R G B R G B R G B ... |
user output |
---|
R B G R B G R B G R B G R B G ... Truncated |