結果

問題 No.842 初詣
ユーザー severrabaenseverrabaen
提出日時 2019-07-10 18:01:35
言語 C++11
(gcc 11.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,808 bytes
コンパイル時間 951 ms
コンパイル使用メモリ 158,528 KB
最終ジャッジ日時 2024-04-27 02:53:15
合計ジャッジ時間 1,357 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp:43:1: error: ‘make_v’ function uses ‘auto’ type specifier without trailing return type
   43 | auto make_v(size_t a, Ts... ts) {
      | ^~~~
main.cpp:43:1: note: deduced return type only available with ‘-std=c++14’ or ‘-std=gnu++14’

ソースコード

diff #

//↓template↓

#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
#define rall(n) n.rbegin(),n.rend()
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const double pi = acos(-1);
const ll SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
ll fac[200005], finv[200005], inv[200005];
vector<ll>dij;
struct edge { ll to, cost; };
vector<vector<edge> >G;

ll mod_pow(ll a, ll b) {
	ll res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}

	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }

template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v) {
	for (auto &e : t) fill_v(e, v);
}

template<typename T>
void outp(vector<T>v) {
	for (int i = 0; i < v.size(); ++i) {
		cout << v[i];
		if (i != v.size() - 1) { cout << " "; }
	}
}

//↑template↑


string ans = "NO";
int main() {
	int a, b, c, d, e, f, g;
	cin >> a >> b >> c >> d >> e >> f >> g;

	while (a && g >= 500) {
		--a;
		g -= 500;
	}
	while (b && g >= 100) {
		--b;
		g -= 100;
	}
	while (c && g >= 50) {
		--c;
		g -= 50;
	}
	while (d && g >= 10) {
		--d;
		g -= 10;
	}
	while (e && g >= 5) {
		--e;
		g -= 5;
	}
	while (f && g >= 1) {
		--f;
		--g;
	}

	if (g == 0) { ans = "YES"; }

	cout << ans << endl;
}
0