結果
| 問題 | No.220 世界のなんとか2 |
| コンテスト | |
| ユーザー |
syoken_desuka
|
| 提出日時 | 2015-07-24 01:33:17 |
| 言語 | C++11(廃止可能性あり) (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,939 bytes |
| 記録 | |
| コンパイル時間 | 555 ms |
| コンパイル使用メモリ | 88,484 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-08 12:42:19 |
| 合計ジャッジ時間 | 1,196 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 17 |
コンパイルメッセージ
main.cpp:80:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
80 | #endif _DEBUG
| ^~~~~~
ソースコード
#include <algorithm>
#include <array>
#include <sstream>
#include <cstdio>
#include <functional>
#include <cstdlib>
#include <cctype>
#include <ostream>
#include<complex>
#include <cmath>
#include <iostream>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <bitset>
#include <iomanip>
#include <string>
#include <vector>
#include <string>
using namespace std;
#define OB (bitset<32>)
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define ALLOF(c) begin(), (c),end()
typedef long long ll;
#define PI acos(-1)
#define EPS 1e-11
#define MOD 1000000007
int main()
{
int n ;
cin >> n;
ll dp3[20];
ll dp3andmod3[20][10];
fill(dp3,dp3+20,0);
fill(*dp3andmod3,*dp3andmod3+20*10,0);
ll e10 = 1;
dp3[0] = 0;
dp3andmod3[0][3] =1;
for (int i = 1; i < n+1; i++)
{
for (int j = 0; j < 10; j++)
{
if (j == 3)
{
dp3[i] += e10 ;
}
else
{
dp3[i] += dp3[i-1];
}
}
for (int j = 0; j < 10; j++)
{
for (int k = 0; k < 10; k++)
{
if ((k+j)% 3 == 0)
{
if (j == 3)
{
dp3andmod3[i][j] += e10;
}
else
{
#ifdef _DEBUG
cout <<"j " << j << endl;
cout <<" val = " << k << endl;
#endif _DEBUG
dp3andmod3[i][j] += dp3andmod3[i-1][k];
}
}
}
}
e10 *= 10;
}
int sum = 0;
for (int k = 0; k < 10; k++)
{
sum += dp3andmod3[n-1][k];
}
cout <<dp3[n] +e10 /3 - sum << endl;
return 0;
}
syoken_desuka