結果
| 問題 | No.3453 Crape Shop |
| コンテスト | |
| ユーザー |
ロロ宮
|
| 提出日時 | 2026-02-28 13:33:58 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| コード長 | 1,082 bytes |
| 記録 | |
| コンパイル時間 | 6,653 ms |
| コンパイル使用メモリ | 362,576 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-02-28 13:34:09 |
| 合計ジャッジ時間 | 7,882 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
#ifdef LOCAL
#include <library/my_library/utility/debug.hpp>
#else
#define debug(...)
#endif
using namespace std;
namespace rv = std::views; // NOLINT
// clang-format off
using lint = long long;
using P = pair<lint, lint>;
#define ALL(a) (a).begin(), (a).end()
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; }
inline void Yes(bool b = true) { println("{}",(b ? "Yes" : "No")); }
inline void No() { println("{}", "No");}
// clang-format on
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int N, A, B;
cin >> N >> A >> B;
int ans = -1;
for (int i = 0; i < N; i++) {
int op;
cin >> op;
if (op == 1) {
A--;
} else if (op == 2) {
B--;
} else {
A--;
B--;
}
if (A < 0 || B < 0) {
ans = i + 1;
break;
}
}
println("{}", ans);
}
ロロ宮