Submission #442833

#TimeUsernameProblemLanguageResultExecution timeMemory
442833marlicuSob (COCI19_sob)C++14
110 / 110
101 ms7172 KiB
#include <bits/stdc++.h> using namespace std; int n, m; bool podudaranje(int a, int b) { for (int i = 0; i < 20; i++) { if ((a & (1 << i)) && !(b & (1 << i))) return false; } return true; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cin >> n >> m; int prvi = n - 1; int drugi = m; while (prvi >= 0) { int koliko = 0; while (!podudaranje(prvi, drugi + koliko)) koliko++; //cerr << "podudaranje " << prvi << " " << drugi + koliko << " " << drugi << " " << koliko << '\n'; for (int i = koliko; i >= 0; i--, prvi--) { cout << prvi << " " << drugi + i << '\n'; } drugi += koliko + 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...