結果

問題 No.2079 aaabbc
ユーザー GetDigit()GetDigit()
提出日時 2022-10-22 09:03:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 520 bytes
コンパイル時間 1,431 ms
コンパイル使用メモリ 163,892 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-14 05:28:04
合計ジャッジ時間 7,592 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#include <vector>
#include <tuple>
#include <regex>
#include <string>
#include <stack>
#include <algorithm>
using namespace std;

int main(){
    int N;
    int ord = 0;
    long ans = 1;
    scanf("%d",&N);
    N = N % 998244352;
    for(int i=0;i<N;i++){
        ans = (ans * 3) % 998244353;
        if(ans == 1){
            ord = i;
            break;
        }
    }
    N = N % ord;
    ans = 1;
    for(int i=0;i<N;i++){
        ans = (ans * 3) % 998244353;
    }
    printf("%ld",ans);
}
0