結果

問題 No.2339 Factorial Paths
ユーザー 沙耶花沙耶花
提出日時 2023-06-02 22:52:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 1,053 bytes
コンパイル時間 4,147 ms
コンパイル使用メモリ 262,368 KB
実行使用メモリ 7,560 KB
最終ジャッジ日時 2023-08-28 05:07:35
合計ジャッジ時間 24,405 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
7,360 KB
testcase_01 AC 9 ms
7,460 KB
testcase_02 AC 9 ms
7,364 KB
testcase_03 AC 9 ms
7,368 KB
testcase_04 AC 9 ms
7,536 KB
testcase_05 AC 9 ms
7,364 KB
testcase_06 AC 9 ms
7,364 KB
testcase_07 AC 9 ms
7,404 KB
testcase_08 AC 9 ms
7,424 KB
testcase_09 AC 9 ms
7,360 KB
testcase_10 AC 9 ms
7,392 KB
testcase_11 AC 10 ms
7,560 KB
testcase_12 AC 9 ms
7,400 KB
testcase_13 AC 9 ms
7,492 KB
testcase_14 AC 9 ms
7,356 KB
testcase_15 AC 9 ms
7,364 KB
testcase_16 AC 9 ms
7,368 KB
testcase_17 AC 9 ms
7,464 KB
testcase_18 AC 9 ms
7,420 KB
testcase_19 AC 10 ms
7,416 KB
testcase_20 AC 9 ms
7,492 KB
testcase_21 AC 10 ms
7,468 KB
testcase_22 AC 9 ms
7,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 4000000000000000001

int main(){
	
	int n;
	cin>>n;
	
	int sz = 2000;
	vector<string> S(sz,string(sz,'#'));
	int x = 0,y = 0;
	int cur = 1;
	int T = 0;
	vector<int> rem(1,n);
	while(rem.size()>0){
		if(rem[0]==1){
			rem.erase(rem.begin());
			continue;
		}
		int A = rem[0]/2;
		int B = rem[0] - A;
	
		if(x>y){
			rep(i,A+1){
				rep(j,B+1){
					S[x+i][y+j] = '.';
				}
			}
			x += A;
			y += B+1;
		}
		else{
			rep(i,A+1){
				rep(j,B+1){
					S[x+j][y+i] = '.';
				}
			}
			x += B+1;
			y += A;
		}
		rep(i,1)rem.push_back(A);
		rep(i,1)rem.push_back(B);
		rem.erase(rem.begin());
	}
	//cout<<x<<' '<<y<<endl;
	//return 0;
	S[x][y] = '.';
	while(x!=sz-1){
		x++;
		S[x][y] = '.';
	}
	while(y!=sz-1){
		y++;
		S[x][y] = '.';
	}
	cout<<sz<<' '<<sz<<endl;
	rep(i,S.size()){
		cout<<S[i]<<endl;
	}
	
		
	
	return 0;
}
0