結果
| 問題 |
No.220 世界のなんとか2
|
| コンテスト | |
| ユーザー |
kwkm0429
|
| 提出日時 | 2018-01-22 14:37:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 780 bytes |
| コンパイル時間 | 2,165 ms |
| コンパイル使用メモリ | 158,216 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-25 23:38:03 |
| 合計ジャッジ時間 | 3,073 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 WA * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define EPS (1e-7)
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
int vx[]={0,1,0,-1};
int vy[]={1,0,-1,0};
int dx[]={1,0,-1,1,-1,1,0,-1};
int dy[]={1,1,1,0,0,-1,-1,-1};
const ll mod=1e9+7;
const int INF=INT_MAX/2;
const int MAX=1e9;
int main(){
int p;
cin>>p;
int dp[p+1][3][2]; //digit,mod,exist3
REP(i,p+1)REP(j,3)REP(k,2)dp[i][j][k]=0;
dp[0][0][0]=1;
REP(i,p)REP(j,3)REP(k,10)REP(l,2){
dp[i+1][(j+k)%3][l || k==3]+=dp[i][j][l];
}
int ans=0;
ans+=dp[p][0][0]+dp[p][0][1];
ans+=dp[p][1][1]+dp[p][2][1];
cout<<ans-1<<endl;
return 0;
}
kwkm0429