Submission #755761

#TimeUsernameProblemLanguageResultExecution timeMemory
755761DJeniUpCostinland (info1cup19_costinland)C++17
0 / 100
1 ms308 KiB
#include "bits/stdc++.h" #pragma GCC optimize("Ofast") #pragma GCC optimize("O3") using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll,ll>pairll; typedef pair<ll,ull>pairull; typedef pair<ll,pairll>pair3l; typedef long double ld; typedef pair<ld,ll>pairld; #define fr first #define sc second #define pb push_back #define endl '\n' #define N 100007 //#define MOD 998244353 #define INF 1000000000000000007 #define eps 0.0000000001 ll t,n,d[107][107],f[107][107]; int main(){ n=49; cin>>t; f[1][1]=1; t--; for(int i=1;i<n;i++){ for(int j=1;j<i;j++){ f[j][i]=min(f[j][i],ll(INF)); f[i][j]=min(f[i][j],ll(INF)); f[i][i]=min(f[i][i],ll(INF)); if(t>=f[j][i]){ d[j][i]=1; f[j+1][i]+=f[j][i]; f[j][i+1]+=f[j][i]; t-=f[j][i]; }else{ f[j+1][i]+=f[j][i]; f[j][i+1]+=f[j][i]; } if(t>=f[i][j]){ d[i][j]=1; f[i+1][j]+=f[i][j]; f[i][j+1]+=f[i][j]; t-=f[i][j]; }else{ f[i+1][j]+=f[i][j]; f[i][j+1]+=f[i][j]; } } if(t>=f[i][i]){ d[i][i]=1; f[i+1][i]+=f[i][i]; f[i][i+1]+=f[i][i]; t-=f[i][i]; }else{ f[i+1][i]+=f[i][i]; f[i][i+1]+=f[i][i]; } } //cout<<t<<endl; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(j==n && i!=n)cout<<"d"; else if(i==n && j!=n)cout<<"r"; else if(d[i][j]==1)cout<<"X"; else cout<<"."; } cout<<endl; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...