Submission #1090000

#TimeUsernameProblemLanguageResultExecution timeMemory
109000012345678Xor Sort (eJOI20_xorsort)C++17
0 / 100
0 ms348 KiB
#include <bits/stdc++.h> using namespace std; const int nx=2e3+5; int s, n, a[nx]; vector<int> res; int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n>>s; for (int i=1; i<=n; i++) cin>>a[i]; if (s==1) { for (int i=1; i<=n; i++) { for (int j=1; j<n; j++) { if (a[j]>a[j+1]) { res.push_back(j); } } } cout<<res.size()<<'\n'; for (auto x:res) { cout<<x<<' '<<x+1<<'\n'; cout<<x+1<<' '<<x<<'\n'; cout<<x<<' '<<x+1<<'\n'; } } else { return 0; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...