結果
| 問題 |
No.2339 Factorial Paths
|
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2023-06-02 22:52:09 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 2,000 ms |
| コード長 | 1,053 bytes |
| コンパイル時間 | 3,995 ms |
| コンパイル使用メモリ | 254,796 KB |
| 最終ジャッジ日時 | 2025-02-13 19:49:20 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
#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;
}
沙耶花