結果
問題 | No.5002 stick xor |
ユーザー |
![]() |
提出日時 | 2018-05-25 23:45:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,110 bytes |
コンパイル時間 | 1,303 ms |
実行使用メモリ | 1,504 KB |
スコア | 0 |
最終ジャッジ日時 | 2018-05-25 23:45:25 |
ジャッジサーバーID (参考情報) |
judge10 / |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 32 |
ソースコード
#include<stdio.h> #include<iostream> using namespace std; int N,K; int d[60][60]; int main (){ cin >> N >> K; int L[K]; int dark = 0; for(int i=0; i<K; i++){ cin >> L[i]; } for(int i=0; i<N; i++){ for(int j=0; j<N; j++){ char a; cin >> a; a = a - '0'; d[i][j] = a; if( a == 1) dark++; } } int chunibyou = 0; for(int i=0; i<K; i++){ int y1,y2,x1,x2; for(int j=0; j<N; j++){ chunibyou += dark; if( j % 2 == 0 ){ y1 = (L[i] + chunibyou) % N + 1; y2 = (L[i] + chunibyou) % N + 1; x1 = chunibyou % N + 1; x2 = chunibyou % N + 1; } else { y1 = chunibyou % N + 1; y2 = chunibyou % N + 1; x1 = (L[i] + chunibyou) % N + 1; x2 = (L[i] + chunibyou) % N + 1; } } if( y1 == y2 || x1 == x2){ cout << y1 << " " << x1 << " " << y2 << " " << x2 << endl; } } return 0; }