結果
| 問題 | No.3555 Use Money Wisely |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-30 09:34:41 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,293 bytes |
| 記録 | |
| コンパイル時間 | 3,607 ms |
| コンパイル使用メモリ | 328,380 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-30 09:34:52 |
| 合計ジャッジ時間 | 5,695 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
| 純コード判定待ち |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| 部分点1 | 20 % | AC * 11 |
| 部分点2 | 10 % | AC * 15 |
| 部分点3 | 30 % | AC * 16 |
| 部分点4 | 40 % | AC * 31 |
| 合計 | 100 点 |
ソースコード
#include <bits/stdc++.h>
//#include <atcoder/all>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define Max(v) *max_element(all(v))
#define Min(v) *min_element(all(v))
#define yn(flag) if (flag) {cout << "Yes\n";} else {cout << "No\n";}
using namespace std;
//using namespace atcoder;
using str = string;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
//using mint = modint998244353;
//using mint = modint1000000007;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const ll INF = 1LL << 60;
const ll mINF = -1 * INF;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
//cout << fixed << setprecision(16);
ll Y, N; cin >> Y >> N;
ll use = 0;
for (ll i = 0; i < N; ++i) {
ll A; cin >> A;
use += A;
}
if (use > Y) {
cout << "red\n";
} else {
cout << Y - use << "\n";
}
return 0;
}