結果
| 問題 |
No.1208 anti primenumber game
|
| コンテスト | |
| ユーザー |
risujiroh
|
| 提出日時 | 2020-08-30 13:54:21 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 34 ms / 2,000 ms |
| コード長 | 482 bytes |
| コンパイル時間 | 3,881 ms |
| コンパイル使用メモリ | 247,472 KB |
| 最終ジャッジ日時 | 2025-01-13 21:27:56 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 |
ソースコード
#include <bits/extc++.h>
#ifndef DUMP
#define DUMP(...) void(0)
#endif
using namespace std;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int64_t n, m;
cin >> n >> m;
vector<int64_t> a(n);
for (auto&& e : a) cin >> e;
int64_t dp = 0;
for (int i = n; i--;) {
int64_t ndp = a[i] - m - dp;
if (a[i] >= 2) ndp = max(ndp, a[i] + m - 2 + dp);
swap(dp, ndp);
}
DUMP(dp);
cout << (dp > 0 ? "First" : "Second") << '\n';
}
risujiroh