Submission #520501

# Submission time Handle Problem Language Result Execution time Memory
520501 2022-01-30T07:43:21 Z Vimmer MalnaRISC (COI21_malnarisc) C++14
45.8254 / 100
2 ms 332 KB
#include <bits/stdc++.h>
#define in(x) freopen(x, "r", stdin)
#define out(x) freopen(x, "w", stdout)

//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")

#define F first
#define S second
#define PB push_back
#define M ll(1e9 + 7)
#define sz(x) (ll)x.size()
#define N 1000500
#define pri(x) cout << x << endl
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define _ << " " <<

using namespace std;
//typedef tree <ll, null_type, less_equal <ll> , rb_tree_tag, tree_order_statistics_node_update> ordered_set;
//using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef short int si;
typedef unsigned long long ull;

int main()
{
    istream::sync_with_stdio(0); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int n;

    cin >> n;

    vector <vector <pair <int, int> > > vr; vr.clear();

    for (int iter = 1; iter <= n / 2; iter++)
    {
        vr.emplace_back();

        for (int i = 1; i < n; i += 2)
            vr.back().PB({i, i + 1});

        vr.emplace_back();

        for (int i = 2; i < n; i += 2)
            vr.back().PB({i, i + 1});
    }

    pri(sz(vr));

    for (auto it : vr)
    {
        for (auto itr : it)
            cout << "CMPSWP " << "R" << itr.F _ "R" << itr.S << " ";

        cout << endl;
    }
}
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 204 KB Partially correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 204 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 204 KB Partially correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 332 KB Partially correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 332 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 332 KB Partially correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB not sorted
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 332 KB Partially correct