# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
685219 | alexdd | Costinland (info1cup19_costinland) | C++17 | 2 ms | 724 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize("O3,unroll-loops")
#include<bits/stdc++.h>
using namespace std;
//ofstream fout("costin.out");
#define int long long
const int INF = 1000000007;
char mat[1000][1000];
void afisare()
{
int undex=0,undey=0;
for(int i=1;i<=500;i++)
{
for(int j=1;j<=500;j++)
{
if(mat[i][j]=='X')
{
undex=i;
undey=max(undey,j);
}
}
}
undex++;
undey++;
for(int i=1;i<=undex;i++)
mat[i][undey]='d';
for(int i=1;i<=undey;i++)
mat[undex][i]='r';
mat[undex][undey]='.';
cout<<undex<<" "<<undey<<"\n";
for(int i=1;i<=undex;i++)
{
for(int j=1;j<=undey;j++)
{
cout<<mat[i][j];
}
cout<<"\n";
}
}
signed main()
{
ios_base::sync_with_stdio(0);cin.tie(0);
for(int i=1;i<=500;i++)
for(int j=1;j<=500;j++)
mat[i][j]='.';
int k,cate=1,unde=0,sca=0;
cin>>k;
for(int i=0;i<500;i++)
{
if(k==0)
break;
unde=i+1;
if((k&(cate))!=0)
{
k-=cate;
if(k>0)
{
mat[i+1][i+1] = 'X';
mat[i+1][i+2] = 'X';
mat[i+2][i+1] = 'r';
}
cate*=2;
}
else
{
mat[i+1][i+1] = 'X';
mat[i+1][i+2] = 'd';
mat[i+2][i+1] = 'r';
cate=cate*2;
}
}
afisare();
return 0;
}
/**
*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |