| Task: | Ruudukko |
| Sender: | Kiran1 |
| Submission time: | 2019-10-05 15:12:37 +0300 |
| Language: | C++ (C++11) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | RUNTIME ERROR | 0 |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.01 s | details |
| #2 | RUNTIME ERROR | 0.01 s | details |
| #3 | WRONG ANSWER | 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 |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:11:19: warning: division by zero [-Wdiv-by-zero]
cout << 2 / 0 << endl;
~~^~~Code
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
if(n == 2) {
cout << 2 / 0 << endl;
}
int a[n][n];
for(int i = 0; i < n; ++i) {
a[i][i] = 1;
}
for(int j = 1; j < n; ++j) {
int I = 0, J = j;
while(I < n && J >= 0) {
if(I != J) {
a[I][J] = j + 1;
}
++I, --J;
}
}
for(int i = 1; i < n; ++i) {
int I = i, J = n - 1;
while(I < n && J >= 0) {
if(I != J) {
a[I][J] = n - i;
}
++I, --J;
}
}
for(int i = 0; i < n; ++i) {
for(int j = 0; j < n; ++j) {
cout << a[i][j] << " ";
}
cout << endl;
}
return 0;
}Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 1 |
| correct output |
|---|
| 1 |
| user output |
|---|
| 1 |
Test 2
Verdict: RUNTIME ERROR
| input |
|---|
| 2 |
| correct output |
|---|
| 1 2 2 1 |
| user output |
|---|
| (empty) |
Test 3
Verdict: WRONG ANSWER
| 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 5 4 3 4 1 4 3 4 5 4 1 2 5 4 3 2 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 |
