Submission #3407521
Source Code Expand
#include<bits/stdc++.h>
#define F first
#define S second
#define int long long
#define double long double
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> iP;
typedef pair<P,int> Pi;
typedef pair<P,P> PP;
double eps=1e-8;
int mod=1e9+7;
int inf=1LL<<55;
priority_queue<P,vector<P>,greater<P> > pq;
template <typename T>
int Count(const vector<T> &v, T l,T r){
//counting [l,r]
auto L = lower_bound(v.begin(), v.end(), l );
auto R = upper_bound(v.begin(), v.end(), r );
// [l,r) change upper -> lower
return R-L;
}
char c[1000][1000];
bool used[1000][1000];
signed main(){
int n,cn=0;
int dx[4]={0,0,1,-1},dy[4]={1,-1,0,0};
cin>>n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if((i*3+j)%5==0){
c[i][j]='X',cn++;
used[i][j]=1;
for(int k=0;k<4;k++){
int nx=j+dx[k];
int ny=i+dy[k];
if(nx<0||nx>=n||ny<0||ny>=n)continue;
used[ny][nx]=1;
}
}
else c[i][j]='.';
}
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(!used[i][j])c[i][j]='X',cn++;
cout<<c[i][j];
}
cout<<endl;
}
return 0;
}
Submission Info
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
500 / 500 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
sample_01.txt, sample_02.txt, sample_03.txt |
| All |
in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, in11.txt, in12.txt, sample_01.txt, sample_02.txt, sample_03.txt |
| Case Name |
Status |
Exec Time |
Memory |
| in01.txt |
AC |
35 ms |
3200 KiB |
| in02.txt |
AC |
35 ms |
3200 KiB |
| in03.txt |
AC |
36 ms |
3200 KiB |
| in04.txt |
AC |
35 ms |
3200 KiB |
| in05.txt |
AC |
35 ms |
3200 KiB |
| in06.txt |
AC |
7 ms |
1152 KiB |
| in07.txt |
AC |
3 ms |
768 KiB |
| in08.txt |
AC |
2 ms |
512 KiB |
| in09.txt |
AC |
1 ms |
256 KiB |
| in10.txt |
AC |
1 ms |
256 KiB |
| in11.txt |
AC |
1 ms |
256 KiB |
| in12.txt |
AC |
1 ms |
256 KiB |
| sample_01.txt |
AC |
1 ms |
256 KiB |
| sample_02.txt |
AC |
1 ms |
256 KiB |
| sample_03.txt |
AC |
1 ms |
256 KiB |