結果
問題 |
No.839 Keep Distance and Nobody Explodes
|
ユーザー |
![]() |
提出日時 | 2019-01-15 00:12:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,323 bytes |
コンパイル時間 | 954 ms |
コンパイル使用メモリ | 109,172 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 04:50:58 |
合計ジャッジ時間 | 2,363 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 30 |
ソースコード
#include<iostream> #include<string> #include<cstdio> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<unordered_map> #include<utility> using namespace std; typedef long long ll; typedef unsigned int ui; const ll mod = 1000000007; const ll INF = (ll)1000000007 * 1000000007; typedef pair<int, int> P; #define stop char nyaa;cin>>nyaa; #define rep(i,n) for(int i=0;i<n;i++) #define per(i,n) for(int i=n-1;i>=0;i--) #define Rep(i,sta,n) for(int i=sta;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define per1(i,n) for(int i=n;i>=1;i--) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) typedef long double ld; typedef complex<ld> Point; const ld eps = 1e-11; const ld pi = acos(-1.0); typedef pair<ll, ll> LP; typedef pair<ld, ld> LDP; typedef unsigned long long ul; int ans[300][300]; int main() { int n; cin >> n; rep(i, n / 2) { rep(j, n) { int x = i; int y = j; if (i % 2) { y = n - 1 - j; } ans[x][y] = 2 * n*i + 2 * j + 1; ans[x + n / 2][(y+n/2)%n] = 2 * n*i + 2 * j + 2; } } ans[1][0] = 0; rep(i, n) { rep(j, n) { if (j > 0)cout << " "; cout << ans[i][j]; } cout << endl; } //stop return 0; }