Submission #219364

#TimeUsernameProblemLanguageResultExecution timeMemory
219364VEGAnnKonstrukcija (COCI20_konstrukcija)C++14
15 / 110
5 ms384 KiB
#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); // freopen("in.txt","r",stdin); 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; i++){ int i1 = (i - 1) * 3 + 1; int i2 = (i - 1) * 3 + 2; int i3 = (i - 1) * 3 + 3; vc.PB(MP(i1, i2)); vc.PB(MP(i2, i3)); vc.PB(MP(i3, 3 * k + 1)); } vc.PB(MP(3 * k + 1, 3 * k + 2)); cout << 3 * k + 2 << " " << sz(vc) << '\n'; for (pii cr : vc) cout << cr.ft << " " << cr.sd << '\n'; return 0; } return -1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...