Submission #1182384

#TimeUsernameProblemLanguageResultExecution timeMemory
1182384jerzykRoad Service 2 (JOI24_ho_t5)C++20
0 / 100
1 ms320 KiB
#include <bits/stdc++.h>

using namespace std;
#define pb push_back
#define st first
#define nd second
typedef long long ll;
typedef long double ld;
const ll I = 1000'000'000'000'000'000LL;
const int II = 2'000'000'000;
const ll M = 1000'000'007LL;
const int N = 1<<18;
vector<pair<int, int>> pos;

void Solve()
{
    mt19937 rng(clock());
    int n = 7, m = 7, q = 1000, lim = 1;
    cout << n << " " << m << " " << q << "\n";
    for(int i = 1; i <= n; ++i)
        for(int j = 1; j <= m; ++j)
            pos.pb(pair{i, j});
    for(int i = 1; i <= n; ++i)
    {
        for(int j = 1; j < m; ++j)
            if(rng() % 10 < 4)
                cout << '1';
            else
                cout << '0';
        cout << "\n";
    }
    for(int i = 1; i < n; ++i)
    {
        for(int j = 1; j <= m; ++j)
            if(rng() % 10 < 4)
                cout << '1';
            else
                cout << '0';
        cout << "\n";
    }
    for(int i = 1; i <= n; ++i)
        cout << rng() % 2 + 1 << " ";
    cout << "\n";
    for(int i = 1; i <= q; ++i)
    {
        int il = 4;
        vector<pair<int, int>> akt;
        cout << il << " ";
        for(int j = 1; j <= il; ++j)
        {
            int l = rng() % (int)pos.size();
            cout << pos[l].st << " " << pos[l].nd << " ";
            akt.pb(pos[l]);
            swap(pos[l], pos.back());
            pos.pop_back();
        }
        for(int i = 0; i < (int)akt.size(); ++i)
            pos.pb(akt[i]);
        cout << "\n";
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    //int t; cin >> t;
    //while(t--)
        Solve();

    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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...