結果
| 問題 | 
                            No.63 ポッキーゲーム
                             | 
                    
| コンテスト | |
| ユーザー | 
                             _yoshih_
                         | 
                    
| 提出日時 | 2018-09-20 17:48:41 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 624 bytes | 
| コンパイル時間 | 429 ms | 
| コンパイル使用メモリ | 64,632 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-18 08:35:32 | 
| 合計ジャッジ時間 | 1,028 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;
    }
    */
    cout << (l - 1) / c * k << endl;
}
int main(int argc, char **argv)
{
    setup();
    run();
    return 0;
}
            
            
            
        
            
_yoshih_