| Task: | Ruudukko |
| Sender: | Yytsi |
| Submission time: | 2025-11-29 21:14:58 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | 100 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 16 |
| #2 | ACCEPTED | 42 |
| #3 | ACCEPTED | 42 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
| #2 | ACCEPTED | 0.06 s | 2, 3 | details |
| #3 | ACCEPTED | 0.05 s | 2, 3 | details |
| #4 | ACCEPTED | 0.23 s | 3 | details |
| #5 | ACCEPTED | 0.18 s | 3 | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:11:28: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
11 | else for (int t = g[2&j^1]+j/6, k = g[j+j&2]+j%2; k <= N; fen[t][k] += 1-30%j, k += k & -k);
| ~^~
input/code.cpp:11:46: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
11 | else for (int t = g[2&j^1]+j/6, k = g[j+j&2]+j%2; k <= N; fen[t][k] += 1-30%j, k += k & -k);
| ~^~Code
#include <bits/stdc++.h>
using namespace std;
#define N 2003
int n, m, fen[N][N], g[4], r;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cin>>n>>m;
for (int q = 0; q < m; q++) {
for (int j = 0; j < 8; j++) {
if (j < 4) cin>>g[j];
else for (int t = g[2&j^1]+j/6, k = g[j+j&2]+j%2; k <= N; fen[t][k] += 1-30%j, k += k & -k);
}
}
for (int y = 1; y <= n; y++, r = 0) {
for (int x = 1; x <= n; x++) {
for (int k = y; k >= 1; r += fen[x][k], k -= k & -k);
cout << ".#"[r&1];
} cout<<"\n";
}
}Test details
Test 1
Group: 1, 2, 3
Verdict: ACCEPTED
| input |
|---|
| 10 100 6 7 8 9 2 6 7 10 7 5 9 6 6 1 6 2 ... |
| correct output |
|---|
| ..##..##.. ##....##.# ..####..## ##.##..... ####....## ... |
| user output |
|---|
| ..##..##.. ##....##.# ..####..## ##.##..... ####....## ... |
Test 2
Group: 2, 3
Verdict: ACCEPTED
| input |
|---|
| 500 100000 133 109 167 178 204 337 481 477 242 476 445 485 452 198 460 321 ... |
| correct output |
|---|
| .##....####.####..##....#.##.#... |
| user output |
|---|
| .##....####.####..##....#.##.#... |
Test 3
Group: 2, 3
Verdict: ACCEPTED
| input |
|---|
| 500 100000 33 7 485 482 50 38 456 459 34 20 479 493 13 6 479 485 ... |
| correct output |
|---|
| .....#.####.#.#...####.##....#... |
| user output |
|---|
| .....#.####.#.#...####.##....#... |
Test 4
Group: 3
Verdict: ACCEPTED
| input |
|---|
| 2000 100000 126 95 1489 1619 1473 29 1697 78 1290 1031 1588 1047 1209 1794 1546 1818 ... |
| correct output |
|---|
| ..........................####... |
| user output |
|---|
| ..........................####... |
Test 5
Group: 3
Verdict: ACCEPTED
| input |
|---|
| 2000 100000 55 51 1842 1905 47 60 1997 1890 117 45 1920 1840 48 175 1987 1852 ... |
| correct output |
|---|
| #.#...#...###.#...#####..####.... |
| user output |
|---|
| #.#...#...###.#...#####..####.... |
