結果

問題 No.1755 Almost Palindrome
ユーザー chocoruskchocorusk
提出日時 2021-11-20 14:12:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 954 bytes
コンパイル時間 6,424 ms
コンパイル使用メモリ 188,152 KB
実行使用メモリ 7,580 KB
最終ジャッジ日時 2023-09-02 08:14:15
合計ジャッジ時間 8,047 ms
ジャッジサーバーID
(参考情報)
judge13 / judge16
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
7,400 KB
testcase_01 AC 101 ms
7,580 KB
testcase_02 AC 272 ms
7,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
using mint=modint998244353;

int main()
{
    int t;cin>>t;
    mint x[1000010];
    x[1]=0, x[2]=650;
    for(int i=3; i<=1000000; i++){
        x[i]+=x[i-2]*26;
        x[i]+=mint(26).pow(i/2)*25*2;
        if(i%2==0){
            x[i]-=26*25;
        }
    }
    while(t--){
        int n;cin>>n;
        cout<<x[n].val()<<endl;
    }
    return 0;
}
0