結果

問題 No.2432 Flip and Move
ユーザー 👑 potato167potato167
提出日時 2023-08-15 22:46:37
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 202 ms / 2,000 ms
コード長 458 bytes
コンパイル時間 2,502 ms
コンパイル使用メモリ 205,452 KB
実行使用メモリ 73,472 KB
最終ジャッジ日時 2024-05-06 02:10:20
合計ジャッジ時間 7,073 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 49 ms
5,376 KB
testcase_03 AC 202 ms
73,472 KB
testcase_04 AC 45 ms
5,376 KB
testcase_05 AC 40 ms
5,376 KB
testcase_06 AC 27 ms
5,376 KB
testcase_07 AC 126 ms
48,896 KB
testcase_08 AC 129 ms
52,736 KB
testcase_09 AC 194 ms
71,040 KB
testcase_10 AC 32 ms
5,376 KB
testcase_11 AC 36 ms
5,376 KB
testcase_12 AC 29 ms
5,376 KB
testcase_13 AC 32 ms
5,376 KB
testcase_14 AC 47 ms
19,072 KB
testcase_15 AC 164 ms
61,056 KB
testcase_16 AC 19 ms
5,376 KB
testcase_17 AC 43 ms
5,376 KB
testcase_18 AC 15 ms
5,376 KB
testcase_19 AC 35 ms
5,376 KB
testcase_20 AC 48 ms
5,376 KB
testcase_21 AC 30 ms
5,376 KB
testcase_22 AC 35 ms
5,376 KB
testcase_23 AC 12 ms
5,376 KB
testcase_24 AC 40 ms
5,376 KB
testcase_25 AC 31 ms
5,376 KB
testcase_26 AC 41 ms
5,376 KB
testcase_27 AC 5 ms
5,376 KB
testcase_28 AC 3 ms
5,376 KB
testcase_29 AC 30 ms
5,376 KB
testcase_30 AC 39 ms
5,376 KB
testcase_31 AC 34 ms
5,376 KB
testcase_32 AC 5 ms
5,376 KB
testcase_33 AC 39 ms
5,376 KB
testcase_34 AC 22 ms
5,376 KB
testcase_35 AC 31 ms
5,376 KB
testcase_36 AC 2 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(p) p.begin(),p.end()
#define rep(i,a,b) for(int i=(int)a;i<(int)b;i++)

int main(){
	ll H,W,K;
	cin>>H>>W>>K;
	K%=(4ll*H*W);
	vector S(H,vector<bool>(W));
	int x=0,y=0,dx=1,dy=1;
	rep(rp,0,K){
		S[x][y]=!S[x][y];
		if(x+dx==-1||x+dx==H) dx*=-1;
		else x+=dx;
		if(y+dy==-1||y+dy==W) dy*=-1;
		else y+=dy;		
	}
	rep(i,0,H){
		rep(j,0,W) cout<<(S[i][j]?"#":".");
		cout<<"\n";
	}
}
0