Submission #845673

# Submission time Handle Problem Language Result Execution time Memory
845673 2023-09-06T14:51:32 Z vjudge1 Konstrukcija (COCI20_konstrukcija) C++17
0 / 110
1 ms 600 KB
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int int64_t
#define ordered_set                              \
    tree<int, null_type, less<int>, rb_tree_tag, \
         tree_order_statistics_node_update>
#define F first
#define S second
#define I insert
#define PB push_back
#define POB pop_back
#define sqr(a) ((a) * (a))
#define P pop
#define max3(a, b, c) (max(a, max(b, c)))
#define max4(a, b, c, d) (max(max(a, b), max(c, d)))
#define min3(a, b, c) (min(a, min(b, c)))
#define min4(a, b, c, d) (min(min(a, b), min(c, d)))
#define MOD 1000000007
#define mod 998244353
int binpow(int a, int p, int m = MOD) {
    int ans = 1;
    while (p) {
        if (p & 1) ans = ((ans % m) * (a % m)) % m;
        a = sqr(a) % m;
        p >>= 1;
    }
    return ans;
}
void solve() {
    int k;
    cin >> k;
    if (k > 0) {
        cout << k + 2 << ' ' << 2 * k << endl;
        for (int i = 2; i <= k + 1; i++) {
            cout << 1 << ' ' << i << endl << i << ' ' << k + 2 << endl;
        }
    } else if (k == 0) {
        cout << 6 << ' ' << 6 << endl;
        cout << "1 4\n"
             << "1 5\n"
             << "4 3\n"
             << "5 3\n"
             << "3 2\n"
             << "2 6" << endl;
    } else {
        k = abs(k);
        cout << k + 3 << ' ' << 2 * k + 1 << endl;
        for (int i = 2; i <= k + 1; i++) {
            cout << 1 << ' ' << i << endl << i << ' ' << k + 2 << endl;
        }
        cout << k + 2 << ' ' << k + 3 << endl;
    }
}
int32_t main() {
    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong answer.
2 Halted 0 ms 0 KB -