結果
問題 | No.63 ポッキーゲーム |
ユーザー |
![]() |
提出日時 | 2019-05-13 22:09:26 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 375 bytes |
コンパイル時間 | 367 ms |
コンパイル使用メモリ | 57,560 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 08:30:48 |
合計ジャッジ時間 | 1,084 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include<iostream> #include<string> #include<math.h> using namespace std; int main() { long int l; long int k; long int amari; long int kaisu; cin >> l >> k; amari = l % k; kaisu = l / k; l = l - amari; if (amari == 0) { if (kaisu %2 == 0) { cout << k * (kaisu / 2) - k; } else { cout << k * (kaisu / 2); } } else { cout << k * (kaisu / 2); } }