Submission #229491

# Submission time Handle Problem Language Result Execution time Memory
229491 2020-05-04T17:11:06 Z VEGAnn Konstrukcija (COCI20_konstrukcija) C++14
30 / 110
5 ms 384 KB
#include <bits/stdc++.h>
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define PB push_back
#define pii pair<int,int>
#define MP make_pair
#define ft first
#define sd second
using namespace std;
const int N = 60;
const int K = 1520;
const int oo = 2e9;
const int md = int(1e9) + 7;
vector<pii> vc;
int k;

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

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

    cin >> k;

    if (0 <= k && k < 500) {
        for (int i = 1; i <= k + 1; i++){
            vc.PB(MP(1, i + 1));
            vc.PB(MP(i + 1, k + 3));
        }

        cout << k + 3 << " " << sz(vc) << '\n';

        for (pii cr : vc)
            cout << cr.ft << " " << cr.sd << '\n';

        return 0;
    }

    if (-300 < k && k < 0){

        k = -k;

        for (int i = 1; i <= k + 1; i++){
            vc.PB(MP(1, i + 1));
            vc.PB(MP(i + 1, k + 3));
            vc.PB(MP(i + 1, k + 4));
        }

        vc.PB(MP(k + 3, k + 5));
        vc.PB(MP(k + 4, k + 5));

        cout << k + 5 << " " << sz(vc) << '\n';

        for (pii cr : vc)
            cout << cr.ft << " " << cr.sd << '\n';

        return 0;
    }

    return -1;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Correct.
2 Correct 5 ms 384 KB Correct.
3 Correct 5 ms 384 KB Correct.
4 Correct 4 ms 384 KB Correct.
5 Correct 5 ms 384 KB Correct.
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Correct.
2 Correct 5 ms 384 KB Correct.
3 Correct 5 ms 384 KB Correct.
4 Correct 5 ms 384 KB Correct.
5 Correct 5 ms 384 KB Correct.
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Correct.
2 Correct 5 ms 384 KB Correct.
3 Correct 5 ms 384 KB Correct.
4 Correct 4 ms 384 KB Correct.
5 Correct 5 ms 384 KB Correct.
6 Correct 5 ms 384 KB Correct.
7 Correct 5 ms 384 KB Correct.
8 Correct 5 ms 384 KB Correct.
9 Correct 5 ms 384 KB Correct.
10 Correct 5 ms 384 KB Correct.
11 Runtime error 5 ms 384 KB Execution failed because the return code was nonzero
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Correct.
2 Correct 5 ms 384 KB Correct.
3 Correct 5 ms 384 KB Correct.
4 Correct 4 ms 384 KB Correct.
5 Correct 5 ms 384 KB Correct.
6 Correct 5 ms 384 KB Correct.
7 Correct 5 ms 384 KB Correct.
8 Correct 5 ms 384 KB Correct.
9 Correct 5 ms 384 KB Correct.
10 Correct 5 ms 384 KB Correct.
11 Runtime error 5 ms 384 KB Execution failed because the return code was nonzero
12 Halted 0 ms 0 KB -