Submission #335235

#TimeUsernameProblemLanguageResultExecution timeMemory
335235ronnithKonstrukcija (COCI20_konstrukcija)C++14
0 / 110
1 ms364 KiB
#include <bits/stdc++.h> typedef long long ll; #define sz(a) int((a).size()) #define trav(a, b) for(auto a : b) #define mk make_pair #define f first #define s second #define pb push_back using namespace std; vector<pair<int, int>> edge; int cnt = 2; int main(){ // ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); ll k;scanf("%lld", &k); // cerr << k << '\n'; for(int i = 0;i < k;i ++){ edge.pb(mk(1,++cnt)); edge.pb(mk(cnt, 2)); } // cerr << "yes"; printf("%d %d\n", cnt, sz(edge)); trav(e, edge){ if(e.f == 2)e.f = cnt; else if(e.f == cnt)e.f = 2; if(e.s == 2)e.s = cnt; else if(e.s == cnt)e.s = 2; printf("%d %d\n", e.f, e.s); } return 0; }

Compilation message (stderr)

konstrukcija.cpp: In function 'int main()':
konstrukcija.cpp:16:12: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   16 |  ll k;scanf("%lld", &k);
      |       ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...