結果
| 問題 |
No.63 ポッキーゲーム
|
| コンテスト | |
| ユーザー |
_yoshih_
|
| 提出日時 | 2018-09-20 17:45:33 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 571 bytes |
| コンパイル時間 | 406 ms |
| コンパイル使用メモリ | 63,588 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-18 08:35:29 |
| 合計ジャッジ時間 | 1,041 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
static void setup()
{
cin.tie(0);
ios::sync_with_stdio(false);
}
static void run()
{
int l, k;
cin >> l >> k;
// 割り切れる場合 → ユウちゃんが1回分少なくなる
// 割り切れない場合 → 割り切れる文だけユウちゃんが食べる
const auto c = k * 2;
if ((l % c) == 0) {
cout << (l/c - 1) * k << endl;
}
else {
cout << l/c*k << endl;
}
}
int main(int argc, char **argv)
{
setup();
run();
return 0;
}
_yoshih_