結果

問題 No.557 点対称
ユーザー 👑 obakyan
提出日時 2019-03-31 22:42:31
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 708 bytes
コンパイル時間 2,020 ms
コンパイル使用メモリ 71,708 KB
実行使用メモリ 13,696 KB
最終ジャッジ日時 2024-11-22 13:50:24
合計ジャッジ時間 38,920 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 TLE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <iostream>
#include <iomanip>

#define ASDF (1000000007)

int main(void)
{
	long n;
	std::cin >> n;
    if(n == 1){
        std::cout << 2 << std::endl;
    } else if(n == 2){
        std::cout << 4 << std::endl;
    } else if(n == 3){
        std::cout << 12 << std::endl;
    } else {
        long tot = 1 + (n % 2) * 2;//1(even) or 3(odd)
        // tot * 4 * 5^([n/2] - 1)
        tot *= 4;
        long cnt = n / 2 - 1;
        for(long i = 0; i < cnt; i++){
            tot = (tot * 5) % ASDF;
        }
        std::cout << tot << std::endl;
    }
	return 0;
}

0