Submission #601451

#TimeUsernameProblemLanguageResultExecution timeMemory
601451czhang2718Sob (COCI19_sob)C++17
0 / 110
55 ms5076 KiB
#include "bits/stdc++.h" using namespace std; int n, m; int main(){ cin.tie(0)->sync_with_stdio(0); cin >> n >> m; int j=m; int i=n-1; int k=0; while(i>=0){ while(i+(1<<k)<j) k++; for(int p=j; p<=i+(1<<k); p++){ cout << p-(1<<k) << " " << p << "\n"; } int d=i+(1<<k)-j+1; j+=d; i-=d; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...