Submission #374332

# Submission time Handle Problem Language Result Execution time Memory
374332 2021-03-07T07:50:43 Z VEGAnn Euklid (COCI20_euklid) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
const ld E = 1e-9;
const int N = 2010;
ll h, g;
int mem[N][N][2];

ll R(ll a, ll b){
    if (b > a)
        return R(b, a);

    if (b == 1) return a;

    return R(a / b, b);
}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

#ifdef _LOCAL
    freopen("in.txt","r",stdin);
#endif // _LOCAL

    for (int i = 1; i <= 2000; i++)
        for (int j = 1; j <= 2000; j++) {
            int fi = __gcd(i, j);
            int se = R(i, j);

            if (fi >= n || se >= n) continue;

            mem[fi][se][0] = i;
            mem[fi][se][1] = j;
        }

    int qq; cin >> qq;

    for (; qq; qq--){
        cin >> g >> h;

        cout << mem[g][h][0] << " " << mem[g][h][1] << '\n';
    }

    return 0;
}

Compilation message

euklid.cpp: In function 'int main()':
euklid.cpp:31:23: error: 'n' was not declared in this scope
   31 |             if (fi >= n || se >= n) continue;
      |                       ^