CSES - Datatähti 2021 alku - Results
Submission details
Task:Ratsun reitit
Sender:Mahtimursu
Submission time:2020-10-14 13:34:13 +0300
Language:C++ (C++11)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:19:5: error: 'table' was not declared in this scope
     table[101][101];
     ^~~~~
input/code.cpp:19:5: note: suggested alternative: 'tanl'
     table[101][101];
     ^~~~~
     tanl
input/code.cpp:28:31: error: 'm' was not declared in this scope
                 table[i][j] = m(i, j) + m(i,j) % 2;
                               ^

Code

#include <bits/stdc++.h>
typedef long long ll;
#define M 1000000007
using namespace std;
int calc(double i, double j) {
return ceil(max(max(i / 2, j / 2), (i+j)/3));
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
table[101][101];
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
if (i == j && i == 0) continue;
if (i + j == 1) table[i][j] = 3;
else if (i == j && i == 2) table[i][j] = 4;
else {
table[i][j] = m(i, j) + m(i,j) % 2;
}
}
}
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
cout << table[i][j] << " ";
}
cout << endl;
}
return 0;
}