Submission #457597

# Submission time Handle Problem Language Result Execution time Memory
457597 2021-08-07T08:38:45 Z idas Coins (LMIO19_monetos) C++11
0 / 100
463 ms 804 KB
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin); i<(end); i++)
#define F first
#define S second
#define PB push_back
#define FAST_IO ios_base::sync_with_stdio(0); cin.tie(nullptr)

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef map<int, int> mii;


const int N=310;
int ts, n, k1, k2, g[N][N];

int main()
{
    FAST_IO;
    cin >> ts >> n >> k1 >> k2;
    vector<pair<int, pii>> inf;
    FOR(i, 0, n)
    {
        FOR(j, 0, n)
        {
            cin >> g[i][j];
        }
    }

    bool going=true;
    while(going){
        going=false;
        FOR(i, 0, n-1)
        {
            FOR(j, 0, n-1)
            {
                if(g[i][j]==0) continue;
                if(g[i+1][j]==0){
                    swap(g[i][j], g[i+1][j]);
                    going=true;
                }
                else if(g[i][j+1]==0){
                    swap(g[i][j], g[i][j+1]);
                    going=true;
                }
            }
        }
    }

    FOR(i, 0, n)
    {
        FOR(j, 0, n)
        {
            cout << g[i][j] << " ";
        }
        cout << '\n';
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB improper placement
2 Incorrect 1 ms 332 KB K = 616
3 Incorrect 77 ms 796 KB improper placement
4 Incorrect 160 ms 788 KB improper placement
5 Incorrect 71 ms 804 KB improper placement
6 Incorrect 133 ms 792 KB improper placement
7 Incorrect 157 ms 804 KB improper placement
8 Incorrect 186 ms 792 KB improper placement
9 Incorrect 175 ms 788 KB improper placement
10 Incorrect 463 ms 800 KB improper placement