結果
問題 | No.5002 stick xor |
ユーザー |
![]() |
提出日時 | 2018-05-25 23:29:11 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 5 ms / 1,000 ms |
コード長 | 1,016 bytes |
コンパイル時間 | 1,508 ms |
実行使用メモリ | 1,504 KB |
スコア | -23 |
最終ジャッジ日時 | 2018-05-25 23:29:15 |
ジャッジサーバーID (参考情報) |
judge9 / |
純コード判定しない問題か言語 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 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 = 1;y2 = L[i];x1 = chunibyou % N + 1;x2 = chunibyou % N + 1;} else {y1 = chunibyou % N + 1;y2 = chunibyou % N + 1;x1 = L[i];x2 = 1;}}if( y1 == y2 || x1 == x2){cout << y1 << " " << x1 << " " << y2 << " " << x2 << endl;}}return 0;}