結果

問題 No.2348 Power!! (Easy)
ユーザー valeh agammedovvaleh agammedov
提出日時 2023-06-15 20:52:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 477 bytes
コンパイル時間 1,422 ms
コンパイル使用メモリ 163,340 KB
実行使用メモリ 11,976 KB
最終ジャッジ日時 2023-09-05 23:43:35
合計ジャッジ時間 14,408 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
const int mod = 998244353;
int main()
{
    int t,A,n;
    cin>>t;
    while(t--){
        cin>>A>>n;
        int cem=1;
        if(n>1){
            cem=(cem+A)%mod;
        }
        for(int i=2 ;i<n ;i++){
            long long ustu=i*i%mod,eded=A;
            for(int j=1 ;j<ustu ;j++){
                eded=(eded*A)%mod;
            }
            cem=(cem+eded)%mod;
        }
        cout<<cem<<endl;
    }

    return 0;
}
0