結果
| 問題 | No.3555 Use Money Wisely |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-25 20:33:36 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,258 bytes |
| 記録 | |
| コンパイル時間 | 3,311 ms |
| コンパイル使用メモリ | 329,152 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-29 18:40:27 |
| 合計ジャッジ時間 | 5,775 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_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;
const ll INF = 1LL << 60;
#define all(a) begin(a), end(a)
#define sz(a) ssize(a)
template<class T, class U> bool chmin(T& a, U b) { return a > b ? a = b, 1 : 0; }
template<class T, class U> bool chmax(T& a, U b) { return a < b ? a = b, 1 : 0; }
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vll = vector<ll>;
using vvll = vector<vll>;
#define _O(_1, _2, _3, n, ...) n
#define _r1(i, n) for(ll i = 0; i < (ll)(n); i++)
#define _r2(i, l, r) for(ll i = (ll)(l); i < (ll)(r); i++)
#define rep(...) _O(__VA_ARGS__, _r2, _r1)(__VA_ARGS__)
#define _rr1(i, n) for(ll i = (ll)(n) - 1; i >= 0; i--)
#define _rr2(i, l, r) for(ll i = (ll)(r) - 1; i >= (ll)(l); i--)
#define rrep(...) _O(__VA_ARGS__, _rr2, _rr1)(__VA_ARGS__)
template<class T> ostream& operator<<(ostream& o, const vector<T>& v) {
ll i = 0;
for(auto& x : v) o << (i++ ? " " : "") << x;
return o;
}
template<class H, class... T> void out(const H& h, const T&... t) {
cout << h;
((cout << " " << t), ...);
cout << endl;
}
int main(){
std::cin.tie(nullptr), std::ios_base::sync_with_stdio(false);
ll y,n,a; cin >> y >> n;
rep(i,n){
cin >> a;
y -= a;
}
if(y < 0) out("red");
else out(y);
}