Submission #363354

# Submission time Handle Problem Language Result Execution time Memory
363354 2021-02-05T16:55:00 Z mosiashvililuka Costinland (info1cup19_costinland) C++14
63.589 / 100
2 ms 1228 KB
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d,e,i,j,ii,jj,zx,xc,X,p[1009],pi,t,tes;
char ch[1009][1009];
int main(){
	ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>X;
	for(i=0; i<=1000; i++){
		for(j=0; j<=1000; j++){
			ch[i][j]='r';
		}
	}
	while(X>1){
		if(X%2==0){
			pi++;
			p[pi]=2;
			X/=2;
		}else{
			pi++;
			p[pi]=1;
			X=(X+1)/2;
		}
	}
	for(i=1; i<=pi/2; i++) swap(p[i],p[pi-i+1]);
	/*cout<<pi<<endl;
	for(i=1; i<=pi; i++){
		cout<<p[i]<<" ";
	}
	return 0;*/
	for(t=1; t<=pi; t++){
		if(p[t]==1){
			for(i=1; i<t; i++){
				j=t+1-i;
				ch[i][j]='X';
			}
			ch[t][1]='d';
		}else{
			for(i=1; i<=t; i++){
				j=t+1-i;
				ch[i][j]='X';
			}
		}
	}
	a=pi+1;b=pi+1;
	for(i=1; i<=a; i++) ch[i][b]='d';
	ch[a][b]='.';
	cout<<a<<" "<<b<<endl;
	for(i=1; i<=a; i++){
		for(j=1; j<=b; j++){
			cout<<ch[i][j];
		}
		if(i!=a) cout<<endl;
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1228 KB Correct! Your size: 3
2 Correct 2 ms 1228 KB Correct! Your size: 3
3 Correct 2 ms 1228 KB Correct! Your size: 4
4 Correct 2 ms 1228 KB Correct! Your size: 4
5 Correct 2 ms 1228 KB Correct! Your size: 4
6 Correct 2 ms 1228 KB Correct! Your size: 4
7 Correct 2 ms 1228 KB Correct! Your size: 5
8 Correct 2 ms 1228 KB Correct! Your size: 5
9 Partially correct 2 ms 1228 KB Partially Correct! Your size: 6
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 1228 KB Partially Correct! Your size: 60
2 Partially correct 2 ms 1228 KB Partially Correct! Your size: 60
3 Partially correct 2 ms 1228 KB Partially Correct! Your size: 61
4 Partially correct 2 ms 1228 KB Partially Correct! Your size: 61
5 Partially correct 2 ms 1228 KB Partially Correct! Your size: 61
6 Partially correct 2 ms 1228 KB Partially Correct! Your size: 61
7 Partially correct 2 ms 1228 KB Partially Correct! Your size: 61
8 Partially correct 2 ms 1228 KB Partially Correct! Your size: 59