結果

問題 No.1500 Super Knight
ユーザー 沙耶花
提出日時 2021-05-07 21:35:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 497 bytes
コンパイル時間 4,121 ms
コンパイル使用メモリ 252,152 KB
最終ジャッジ日時 2025-01-21 08:03:14
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint1000000007;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001

int main(){

	int N;
	cin>>N;
	
	if(N==1)cout<<12<<endl;
	else if(N==2)cout<<65<<endl;
	else if(N==3)cout<<172<<endl;
	else{
		N-=3;
		mint ans = 91;
		ans *= N;
		ans += 172;
		mint t = N;
		t *= N+1;
		t /= 2;
		t *= 34;
		ans += t;
		cout<<ans.val()<<endl;
	}
		
    return 0;
}
0