Submission #457660

#TimeUsernameProblemLanguageResultExecution timeMemory
457660idasCoins (LMIO19_monetos)C++11
6.57 / 100
20 ms852 KiB
#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]; void g1() { FOR(i, 0, n) { FOR(j, 0, n) { if(i>=n/2) cout << 1 << " "; else cout << 0 << " "; } cout << '\n'; } } void g2() { FOR(i, 0, n) { FOR(j, 0, n) { if(j>=n/2) cout << 1 << " "; else cout << 0 << " "; } cout << '\n'; } } void g3() { FOR(i, 0, n-1) cout << 0 << " "; cout << 1 << '\n'; FOR(i, 1, n-1) { FOR(j, 0, n) { if(j>=n/2){ cout << 1 << " "; } else cout << 0 << " "; } cout << '\n'; } cout << 0 << " "; FOR(i, 0, n-1) cout << 1 << " "; } int main() { FAST_IO; cin >> ts >> n >> k1 >> k2; FOR(i, 0, n) { FOR(j, 0, n) { cin >> g[i][j]; } } if(ts%3==0) g1(); else if(ts%3==1) g2(); else g3(); }
#Verdict Execution timeMemoryGrader output
Fetching results...