| Task: | Ruudukko |
| Sender: | Microwave Abuser |
| Submission time: | 2019-09-30 19:17:57 +0300 |
| Language: | C++ (C++11) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.01 s | details |
| #2 | ACCEPTED | 0.01 s | details |
| #3 | ACCEPTED | 0.01 s | details |
| #4 | WRONG ANSWER | 0.01 s | details |
| #5 | WRONG ANSWER | 0.01 s | details |
| #6 | WRONG ANSWER | 0.01 s | details |
Code
//g++ -std=c++11 -O2 -Wall microwave.cpp -o microwave
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
//COMMENCE CODE
int gayarray[111][111];
for(int x = 1; x <= 104; x++)
{
if(x % 4 == 0)
{
int i = 1;
for(int y = x; y <= 104;)
{
gayarray[x][y] = i;
gayarray[y][x] = i;
i++;
gayarray[x][y-1] = i;
gayarray[y-1][x] = i;
i++;
gayarray[x][y-2] = i;
gayarray[y-2][x] = i;
i++;
gayarray[x][y-3] = i;
gayarray[y-3][x] = i;
i++;
y += 4;
}
}
else if(x % 3 == 0)
{
int i = 1;
for(int y = x; y <= 103;)
{
gayarray[x][y] = i;
gayarray[y][x] = i;
i++;
gayarray[x][y+1] = i;
gayarray[y+1][x] = i;
i++;
gayarray[x][y-2] = i;
gayarray[y-2][x] = i;
i++;
gayarray[x][y-1] = i;
gayarray[y-1][x] = i;
i++;
y += 4;
}
}
else if(x % 2 == 0)
{
int i = 1;
for(int y = x; y <= 102;)
{
gayarray[x][y] = i;
gayarray[y][x] = i;
i++;
gayarray[x][y-1] = i;
gayarray[y-1][x] = i;
i++;
gayarray[x][y+2] = i;
gayarray[y+2][x] = i;
i++;
gayarray[x][y+1] = i;
gayarray[y+1][x] = i;
i++;
y += 4;
}
}
else
{
int i = 1;
for(int y = x; y <= 109;)
{
gayarray[x][y] = i;
gayarray[y][x] = i;
y++;
i++;
}
}
}
//Ask table size
int n;
cin >> n;
//print
for(int y = 1; y <= n; y++)
{
for(int x = 1; x <= n; x++)
{
printf("%d", gayarray[x][y]);
if(x != n)
{
printf(" ");
}
}
if(y != n)
{
printf("\n");
}
}
}Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 1 |
| correct output |
|---|
| 1 |
| user output |
|---|
| 1 |
Test 2
Verdict: ACCEPTED
| input |
|---|
| 2 |
| correct output |
|---|
| 1 2 2 1 |
| user output |
|---|
| 1 2 2 1 |
Test 3
Verdict: ACCEPTED
| input |
|---|
| 5 |
| correct output |
|---|
| 1 2 3 4 5 2 1 4 3 6 3 4 1 2 7 4 3 2 1 8 5 6 7 8 1 |
| user output |
|---|
| 1 2 3 4 5 2 1 4 3 6 3 4 1 2 7 4 3 2 1 8 5 6 7 8 1 |
Test 4
Verdict: WRONG ANSWER
| input |
|---|
| 42 |
| correct output |
|---|
| 1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
| user output |
|---|
| 1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 99 |
| correct output |
|---|
| 1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
| user output |
|---|
| 1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 100 |
| correct output |
|---|
| 1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
| user output |
|---|
| 1 2 3 4 5 6 7 8 9 10 11 12 13 ... Truncated |
