結果
問題 | No.314 ケンケンパ |
ユーザー |
|
提出日時 | 2019-03-06 22:47:23 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 12 ms / 1,000 ms |
コード長 | 1,690 bytes |
コンパイル時間 | 689 ms |
コンパイル使用メモリ | 87,616 KB |
実行使用メモリ | 34,712 KB |
最終ジャッジ日時 | 2024-06-23 14:39:52 |
合計ジャッジ時間 | 1,653 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
//#include <bits/stdc++.h>#include <iostream>#include <complex>#include <sstream>#include <string>#include <algorithm>#include <deque>#include <list>#include <map>#include <numeric>#include <queue>#include <vector>#include <set>#include <limits>#include <cstdio>#include <cctype>#include <cmath>#include <cstring>#include <cstdlib>#include <ctime>#include <climits>#include <iomanip>#define REP(i, n) for(int i = 0; i < (int)(n); i++)#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)#define SORT(v, n) sort(v, v+n)#define REVERSE(v) reverse((v).begin(), (v).end())using namespace std;using ll = long long;const ll MOD=1000000007LL;typedef pair<int, int> P;ll ADD(ll x, ll y) { return (x+y) % MOD; }ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }ll MUL(ll x, ll y) { return x*y % MOD; }ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }template<class T> bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}template<class T> bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}return 0;}ll n;// j:0...pall dp[1000100][4];intmain(void){ios_base::sync_with_stdio(false);cin.tie(0);cin >> n;dp[0][0] = 1;REP(i,n){//kendp[i+1][1] += dp[i][0];//kenkendp[i+1][2] += dp[i][1];//padp[i+1][0] += (dp[i][1] + dp[i][2])%MOD;}ll ans = 0LL;REP(j,3) {ans += dp[n][j];ans %= MOD;}cout << ans << endl;return 0;}