提出 #475089


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define mp(a,b) make_pair((a),(b))
#define debug(x) #x << "=" << (x)
 
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define dump(x)
#endif

typedef long long int ll;
typedef pair<int,int> pii;
//template<typename T> using vec=std::vector<T>;

const int INF=1<<30;
const long long int INFLL=1LL<<58;
const double EPS=1e-9;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
	os << "[";
	for (const auto &v : vec) {
		os << v << ",";
	}
	os << "]";
	return os;
}

void Solve(){
    int a[20];
    a[0]=a[1]=100;
    a[2]=200;
    rep(i,3,20) a[i]=a[i-1]+a[i-2]+a[i-3];
    cout << a[19] << endl;
}

int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	Solve();
	return 0;
}

提出情報

提出日時
問題 A - 天下一プログラマーコンテスト1998
ユーザ kjfakjfks
言語 C++11 (GCC 4.9.2)
得点 10
コード長 970 Byte
結果 AC
実行時間 23 ms
メモリ 796 KiB

ジャッジ結果

セット名 All
得点 / 配点 10 / 10
結果
AC × 1
セット名 テストケース
All no_input.txt
ケース名 結果 実行時間 メモリ
no_input.txt AC 23 ms 796 KiB