Submission #690906

#TimeUsernameProblemLanguageResultExecution timeMemory
690906MateiKing80Subway (info1cup19_subway)C++17
100 / 100
7 ms724 KiB
#include <bits/stdc++.h> using namespace std; int main() { int k,i=1; cin>>k; while(i*(i+1)/2<=k) i++; i--; if(i*(i+1)/2==k) { cout<<i+1<<'\n'; cout<<0<<" "<<-1<<'\n'; for(int j=1;j<=i;j++) cout<<j<<" "<<j-1<<'\n'; } else { cout<<i+2<<'\n'; cout<<0<<" "<<-1<<'\n'; for(int j=1;j<=i;j++) cout<<j<<" "<<j-1<<'\n'; cout<<i+1<<" "<<k-(i*(i+1)/2)-1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...