Submission #1151611

#TimeUsernameProblemLanguageResultExecution timeMemory
1151611KluydQCostinland (info1cup19_costinland)C++20
63.59 / 100
0 ms328 KiB
#include <bits/stdc++.h> //#include "grader.h" #define respagold ios_base::sync_with_stdio(0), cin.tie(0); #define int long long #define ll long long #define int2 __int128_t #define FOR( i, x, n, d ) for( int i = x; i <= n; i += d ) #define FORR( i, x, n, d ) for( int i = x; i >= n; i -= d ) #define F first #define S second #define all(x) x.begin(), x.end() #define sz(x) (int)(x.size()) #define pb push_back #define ins insert #define lb lower_bound #define ub upper_bound #define pii pair <int, int> #define mkp make_pair using namespace std; const int N1 = 2e5 + 123; int a[N1], b[N1], c[N1], n, m, k, z, w, ans, x, y; char mat[101][101]; mt19937 rng( chrono::steady_clock::now().time_since_epoch().count()); int rand( int l, int r ) { uniform_int_distribution <int> uid( l, r ); return uid( rng ); } void solve() { cin >> k; FOR( i, 1, 100, 1 ) { FOR( j, 1, 100, 1 ) mat[i][j] = '.'; } FOR( i, 0, 60, 1 ) { if( (k >> i) & 1ll ) a[i] = 1, z = i; } x = 1, y = 1, w = 0; while( w < z ) { mat[x][y] = 'X'; mat[x + 1][y] = ( a[w] ? 'X' : 'r' ); mat[x][y + 1] = 'd'; x ++, y ++, w ++; } cout << x + 1 << ' ' << y + 1 << '\n'; FOR( i, 1, x + 1, 1 ) { FOR( j, 1, y + 1, 1 ) { if( i == x + 1 && j == y + 1 ) cout << '.'; else if( i == x + 1 ) cout << 'r'; else if( j == y + 1 ) cout << 'd'; else cout << mat[i][j]; } cout << '\n'; } } signed main() { // freopen("connect.in", "r", stdin); // freopen("connect.out", "w", stdout); respagold int test = 1; if( !test ) cin >> test; while( test -- ) { solve(); } } // solved by KluydQ
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...