結果
問題 | No.2348 Power!! (Easy) |
ユーザー |
|
提出日時 | 2023-06-15 20:52:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 477 bytes |
コンパイル時間 | 1,639 ms |
コンパイル使用メモリ | 166,172 KB |
実行使用メモリ | 10,020 KB |
最終ジャッジ日時 | 2024-06-23 18:55:01 |
合計ジャッジ時間 | 14,069 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | TLE * 1 |
other | -- * 12 |
ソースコード
#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; }