Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <cstring>
- #include <cstdlib>
- #include <cmath>
- #include <ctime>
- #include <cctype>
- #include <algorithm>
- #include <random>
- #include <bitset>
- #include <queue>
- #include <functional>
- #include <set>
- #include <map>
- #include <vector>
- #include <chrono>
- #include <iostream>
- #include <limits>
- #include <numeric>
- #define LOG(FMT...) fprintf(stderr, FMT)
- using namespace std;
- typedef long long ll;
- typedef unsigned long long ull;
- // mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
- template <class T>
- istream& operator>>(istream& is, vector<T>& v) {
- for (T& x : v)
- is >> x;
- return is;
- }
- template <class T>
- ostream& operator<<(ostream& os, const vector<T>& v) {
- if (!v.empty()) {
- os << v.front();
- for (int i = 1; i < v.size(); ++i)
- os << ' ' << v[i];
- }
- return os;
- }
- const int P = 998244353;
- int norm(int x) { return x >= P ? (x - P) : x; }
- void add(int& x, int y) { if ((x += y) >= P) x -= P; }
- void sub(int& x, int y) { if ((x -= y) < 0) x += P; }
- void exGcd(int a, int b, int& x, int& y) {
- if (!b) {
- x = 1;
- y = 0;
- return;
- }
- exGcd(b, a % b, y, x);
- y -= a / b * x;
- }
- int inv(int a) {
- int x, y;
- exGcd(a, P, x, y);
- return norm(x + P);
- }
- int mpow(int x, int k) {
- int ret = 1;
- while (k) {
- if (k & 1)
- ret = ret * (ll)x % P;
- x = x * (ll)x % P;
- k >>= 1;
- }
- return ret;
- }
- int main() {
- #ifdef ELEGIA
- freopen("test.in", "r", stdin);
- int nol_cl = clock();
- #endif
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- int T;
- cin >> T;
- while (T--) {
- int n;
- cin >> n;
- int ans;
- if (n <= 3) ans = mpow(26, n);
- else
- ans = 26 * 25 * 24;
- cout << ans << '\n';
- }
- #ifdef ELEGIA
- LOG("Time: %dms\n", int ((clock()
- -nol_cl) / (double)CLOCKS_PER_SEC * 1000));
- #endif
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment