Submission #00143
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #include<bits/stdc++.h> using namespace std; int main(){ int n,k; scanf ( "%d %d" ,&n,&k); int a[n],b[n]; for ( int i=0;i<k;i++){ scanf ( "%d %d" ,&a[i],&b[i]); } int tile[n][n]; int cmp; if (n/2==0){ cmp=n/2; } else { cmp=(n/2)+1; } int set=0; for ( int x=0;x<cmp;x++){ set++; if (set==4){ set=1; } for ( int i=x;i<n-x;i++){ for ( int j=x;j<n-x;j++){ if (i==x || i==n-x-1 || j==x || j==n-x-1){ tile[i][j]=set; } } } } for ( int i=0;i<k;i++){ printf ( "%d\n" ,tile[b[i]-1][a[i]-1]); tile[b[i]-1][a[i]-1]= '#' ; } for ( int i=0;i<n;i++){ for ( int j=0;j<n;j++){ cout << tile[i][j]; } cout << endl; } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0003 - タイル (Tile) |
ユーザー名 | P_ei1623 |
投稿日時 | 2016-11-09 18:59:25 |
言語 | C++11 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 742 Byte |
最大実行時間 | 190 ms |
最大メモリ使用量 | 5328 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | in1 | 0 / 20 | *1.txt |
2 | in2 | 0 / 20 | *2.txt |
3 | in3 | 0 / 20 | *3.txt |
4 | in4 | 0 / 20 | *4.txt |
5 | in5 | 0 / 20 | *5.txt |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # | ||||
---|---|---|---|---|---|---|---|---|
2011-yo-t3-in1.txt | WA | 18 ms | 480 KB |
1
|
||||
2011-yo-t3-in2.txt | WA | 190 ms | 5328 KB |
2
|
||||
2011-yo-t3-in3.txt | RE | 26 ms | 1404 KB |
3
|
||||
2011-yo-t3-in4.txt | RE | 26 ms | 1392 KB |
4
|
||||
2011-yo-t3-in5.txt | RE | 24 ms | 1380 KB |
5
|