結果
問題 | No.223 1マス指定の魔方陣 |
ユーザー | 沙耶花 |
提出日時 | 2024-11-06 23:23:22 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,287 bytes |
コンパイル時間 | 4,786 ms |
コンパイル使用メモリ | 264,776 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-06 23:23:30 |
合計ジャッジ時間 | 6,778 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 2 ms
6,816 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 2 ms
6,820 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 2 ms
6,816 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:61:16: warning: 'jj' may be used uninitialized [-Wmaybe-uninitialized] 61 | while(y!=jj){ | ~^~~~ main.cpp:48:16: note: 'jj' was declared here 48 | int ii,jj; | ^~ main.cpp:56:16: warning: 'ii' may be used uninitialized [-Wmaybe-uninitialized] 56 | while(x!=ii){ | ~^~~~ main.cpp:48:13: note: 'ii' was declared here 48 | int ii,jj; | ^~
ソースコード
#include <stdio.h> #include <atcoder/all> #include <bits/stdc++.h> using namespace std; using namespace atcoder; using mint = modint1000000007; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 1000000000000000001 int main(){ vector<vector<int>> a = {{6,12,7,9},{15,1,14,4},{10,8,11,5},{3,13,2,16}}; int n; cin>>n; if(n>=8){ rep(i,4){ rep(j,4)a[i].push_back(a[i][j]); } rep(i,4)a.push_back(a[i]); rep(i,8){ rep(j,8){ int x = i/4,y = j/4; if(x&&y)a[i][j] += 48; else if(x)a[i][j] += 16; else if(y)a[i][j] += 32; } } } if(n>=16){ rep(i,8){ rep(j,8)a[i].push_back(a[i][j]); } rep(i,8)a.push_back(a[i]); rep(i,16){ rep(j,16){ int x = i/8,y = j/8; if(x&&y)a[i][j] += 96; else if(x)a[i][j] += 32; else if(y)a[i][j] += 64; } } } int x,y,z; cin>>x>>y>>z; x--,y--; int ii,jj; rep(i,a.size()){ rep(j,a.size()){ if(a[i][j]==z){ ii = i,jj = j; } } } while(x!=ii){ a.insert(a.begin(),a.back()); a.pop_back(); ii = (ii+1)%n; } while(y!=jj){ rep(i,a.size()){ a[i].insert(a[i].begin(),a[i].back()); a[i].pop_back(); } jj = (jj+1)%n; } rep(i,n){ rep(j,n){ if(j)printf(" "); printf("%d",a[i][j]); } printf("\n"); } return 0; }