結果
| 問題 | No.3555 Use Money Wisely |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-06-04 02:41:34 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 621 bytes |
| 記録 | |
| コンパイル時間 | 2,530 ms |
| コンパイル使用メモリ | 329,408 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-04 02:41:39 |
| 合計ジャッジ時間 | 3,857 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
| 純コード判定待ち |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| 部分点1 | 20 % | AC * 11 |
| 部分点2 | 10 % | AC * 15 |
| 部分点3 | 30 % | AC * 16 |
| 部分点4 | 40 % | AC * 31 |
| 合計 | 100 点 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, t) for (ll i = s; i < (ll)(t); i++)
#define all(x) begin(x), end(x)
template <class T> bool chmin(T& x, T y) {
return x > y ? (x = y, true) : false;
}
template <class T> bool chmax(T& x, T y) {
return x < y ? (x = y, true) : false;
}
void solve() {
int y, n;
cin >> y >> n;
rep(i, 0, n) {
int a;
cin >> a;
y -= a;
}
if (y < 0) cout << "red\n";
else cout << y << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
int t = 1;
// cin >> t;
while (t--) solve();
}