結果

問題 No.1500 Super Knight
ユーザー chocoruskchocorusk
提出日時 2021-05-07 23:23:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,422 bytes
コンパイル時間 2,955 ms
コンパイル使用メモリ 187,100 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-13 14:44:51
合計ジャッジ時間 4,523 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,352 KB
testcase_05 AC 1 ms
4,352 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,352 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,352 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,352 KB
testcase_13 AC 2 ms
4,352 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 1 ms
4,352 KB
testcase_17 AC 2 ms
4,352 KB
testcase_18 AC 1 ms
4,352 KB
testcase_19 AC 2 ms
4,352 KB
testcase_20 AC 1 ms
4,348 KB
testcase_21 AC 1 ms
4,352 KB
testcase_22 AC 2 ms
4,352 KB
testcase_23 AC 1 ms
4,348 KB
testcase_24 AC 1 ms
4,348 KB
testcase_25 AC 1 ms
4,352 KB
testcase_26 AC 1 ms
4,352 KB
testcase_27 AC 1 ms
4,352 KB
testcase_28 AC 1 ms
4,352 KB
testcase_29 AC 1 ms
4,352 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,352 KB
testcase_32 AC 1 ms
4,348 KB
testcase_33 AC 1 ms
4,352 KB
testcase_34 AC 1 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
bool a[101][101];
int dx[]={3,3,2,0,-2,-3,-3,-3,-2,0,2,3}, dy[]={0,2,3,3,3,2,0,-2,-3,-3,-3,-2};
ll ans[]={1,12,65,172,297,456};
int main()
{
	// int n; cin>>n;
	// const int mid=50;
	// a[mid][mid]=1;
	// for(int i=0; i<n; i++){
	// 	bool na[101][101]={};
	// 	for(int j=0; j<101; j++){
	// 		for(int k=0; k<101; k++){
	// 			if(!a[j][k]) continue;
	// 			for(int l=0; l<12; l++){
	// 				int j1=j+dx[l], k1=k+dy[l];
	// 				na[j1][k1]=1;
	// 			}
	// 		}
	// 	}
	// 	int cnt=0;
	// 	for(int j=0; j<101; j++){
	// 		for(int k=0; k<101; k++){
	// 			a[j][k]=na[j][k];
	// 			if(a[j][k]) cnt++;
	// 		}
	// 	}
	// 	cout<<i+1<<" "<<cnt<<endl;
	// }
	using mint=modint1000000007;
	ll n; cin>>n;
	if(n<=5) cout<<ans[n]<<endl;
	else cout<<(mint(172)+mint(125)*mint(n-3)+mint(17)*mint(n-3)*mint(n-4)).val()<<endl;
    return 0;
}
0