結果

問題 No.1500 Super Knight
ユーザー karinohito
提出日時 2021-07-23 11:31:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 595 bytes
コンパイル時間 1,276 ms
コンパイル使用メモリ 170,036 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-18 07:51:01
合計ジャッジ時間 2,090 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

//#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
//using namespace atcoder;
using ll = long long;
#define all(A) A.begin(),A.end()
using vll = vector<ll>;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using Graph = vector<vector<ll>>;
Graph G;
vll dist;
vector<bool> seen;
ll gcd(ll(a), ll(b)) {
	ll c = a;
	while (a % b != 0) {
		c = a % b;
		a = b;
		b = c;
	}
	return b;
}
int main() {
	ll N;
	cin>>N;
	ll m=1e9+7;
	if(N==0)cout<<1<<endl;
	else if(N==1)cout<<"12"<<endl;
	else if(N==2)cout<<65<<endl;
	else{
		cout<<((N*N)%m*17+6*N+1)%m<<endl;
	}
	
}
0