Submission #73295289
Source Code Expand
// Best papa ikam template — Absolute Performance Limit
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std; using namespace __gnu_pbds;
// --- Types ---
using ll = long long; using ull = unsigned long long; using ld = long double;
using pii = pair<int,int>; using pll = pair<ll,ll>; using vi = vector<int>; using vll = vector<ll>;
template<class T> using min_heap = priority_queue<T, vector<T>, greater<T>>;
// --- Constants ---
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const ll LLINF = 1e18 + 7;
const ld PI = acos(-1.0L);
const ld EPS = 1e-9;
// --- Macros ---
#define nn '\n'
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define each(x,a) for(auto& x:a)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
// --- RNG & Hash (SplitMix64 + Golden Ratio) ---
static mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count() ^ (ull)unique_ptr<char>(new char).get());
struct chash {
static ull sm64(ull x) {
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}
size_t operator()(ull x) const {
static const ull R = rng(); return (size_t)sm64(x + R);
}
template<class A, class B> size_t operator()(const pair<A, B>& p) const {
static const ull R = rng();
return (size_t)(sm64((ull)p.fi + R) ^ (sm64((ull)p.se + R) >> 1));
}
};
// --- PBDS ---
template<class K, class V> using hash_map = gp_hash_table<K, V, chash>;
template<class K> using hash_set = gp_hash_table<K, null_type, chash>;
template<class T> using ord_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// --- Math & Modular ---
template<int M> struct mint {
int v; constexpr mint(ll x = 0) : v((int)(x % M < 0 ? x % M + M : x % M)) {}
mint& operator+=(mint o) { v += o.v; if (v >= M) v -= M; return *this; }
mint& operator-=(mint o) { v -= o.v; if (v < 0) v += M; return *this; }
mint& operator*=(mint o) { v = (int)((ll)v * o.v % M); return *this; }
mint pow(ll e) const { mint r = 1, a = *this; for (; e; e >>= 1, a *= a) if (e & 1) r *= a; return r; }
mint inv() const { return pow(M - 2); }
mint operator-() const { return v ? M - v : 0; }
mint& operator/=(mint o) { return *this *= o.inv(); }
friend mint operator+(mint a, mint b) { return a += b; }
friend mint operator-(mint a, mint b) { return a -= b; }
friend mint operator*(mint a, mint b) { return a *= b; }
friend mint operator/(mint a, mint b) { return a /= b; }
friend bool operator==(mint a, mint b) { return a.v == b.v; }
friend bool operator!=(mint a, mint b) { return a.v != b.v; }
friend istream& operator>>(istream& i, mint& x) { ll t; i >> t; x = t; return i; }
friend ostream& operator<<(ostream& o, mint x) { return o << x.v; }
};
using mint_t = mint<MOD>;
struct Combs {
vector<mint_t> f, i;
Combs(int n) : f(n + 1), i(n + 1) {
f[0] = 1; rep(j, 1, n + 1) f[j] = f[j - 1] * j;
i[n] = f[n].inv(); for (int j = n - 1; j >= 0; --j) i[j] = i[j + 1] * (j + 1);
}
mint_t nCr(int n, int r) { return (r < 0 || r > n) ? 0 : f[n] * i[r] * i[n - r]; }
};
// --- Bit & Math Utils ---
inline ll gcd(ll a, ll b) { while (b) a %= b, swap(a, b); return a; }
inline ll binpow(ll a, ll e) {
ll r = 1; for (; e; e >>= 1, a = a * a) if (e & 1) r = r * a; return r;
}
inline ll mod_pow(ll a, ll e, ll m = MOD) {
ll r = 1; a %= m; for (; e; e >>= 1, a = (ll)((__int128)a * a % m)) if (e & 1) r = (ll)((__int128)r * a % m); return r;
}
#define popcnt __builtin_popcountll
inline int msb(ll x) { return x ? 63 - __builtin_clzll((ull)x) : -1; }
inline bool is_pow2(ull x) { return x && !(x & (x - 1)); }
void solve() {
int n; cin >> n;
vector<string> a(n);
int len = 0;
each(x, a) {
cin >> x;
len = max(sz(x), len);
}
each(x, a) {
for (int i=0; i<(len - sz(x))/2; ++i) cout << '.';
cout << x;
for (int i=0; i<(len - sz(x))/2; ++i) cout << '.';
cout << nn;
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
int T = 1;
// cin >> T;
while (T--) solve();
return 0;
}
Submission Info
| Submission Time |
|
| Task |
B - Center Alignment |
| User |
ikam |
| Language |
C++23 (GCC 15.2.0) |
| Score |
200 |
| Code Size |
4635 Byte |
| Status |
AC |
| Exec Time |
1 ms |
| Memory |
3664 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
200 / 200 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
00_sample_01.txt, 00_sample_02.txt |
| All |
00_sample_01.txt, 00_sample_02.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 02_min_01.txt, 03_max_01.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 00_sample_01.txt |
AC |
1 ms |
3444 KiB |
| 00_sample_02.txt |
AC |
1 ms |
3468 KiB |
| 01_random_01.txt |
AC |
1 ms |
3596 KiB |
| 01_random_02.txt |
AC |
1 ms |
3624 KiB |
| 01_random_03.txt |
AC |
1 ms |
3604 KiB |
| 01_random_04.txt |
AC |
1 ms |
3624 KiB |
| 01_random_05.txt |
AC |
1 ms |
3528 KiB |
| 01_random_06.txt |
AC |
1 ms |
3624 KiB |
| 02_min_01.txt |
AC |
1 ms |
3592 KiB |
| 03_max_01.txt |
AC |
1 ms |
3664 KiB |