結果
| 問題 |
No.63 ポッキーゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-31 05:57:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 463 bytes |
| コンパイル時間 | 586 ms |
| コンパイル使用メモリ | 73,608 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 17:28:02 |
| 合計ジャッジ時間 | 1,397 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <iostream> //cin, cout
#include <vector> //vector
#include <algorithm> //sort,min,max
#include <string> //string
#include <ios> //fixed
#include <iomanip> //setprecision
#include <utility> //swap
#include <cstdlib> //abs(int)
using namespace std;
int main() {
int L, K;
cin >> L >> K;
int a = L / (K * 2);
int b = L % (K * 2);
int ans = 0;
if (b != 0) {
ans = a * K;
}
else {
ans = (a - 1) * K;
}
cout << ans << endl;
return 0;
}