結果

問題 No.557 点対称
コンテスト
ユーザー kotatsugame
提出日時 2026-02-06 23:22:54
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 333 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 779 ms
コンパイル使用メモリ 77,848 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-02-06 23:22:57
合計ジャッジ時間 2,457 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<iostream>
#include<cassert>
#include<atcoder/modint>
using namespace std;
using mint=atcoder::modint1000000007;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	long N;cin>>N;
	if(N==1)cout<<2<<endl;
	else
	{
		mint ans=1;
		if(N%2==1)N--,ans=3;
		N/=2;
		ans*=4*mint(5).pow(N-1);
		cout<<ans.val()<<endl;
	}
}
0