Submission #1090000

# Submission time Handle Problem Language Result Execution time Memory
1090000 2024-09-17T14:09:43 Z 12345678 Xor Sort (eJOI20_xorsort) C++17
0 / 100
0 ms 348 KB
#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 time Memory Grader output
1 Incorrect 0 ms 348 KB Not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -