結果
問題 | No.604 誕生日のお小遣い |
ユーザー |
![]() |
提出日時 | 2017-12-04 00:39:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 509 bytes |
コンパイル時間 | 830 ms |
コンパイル使用メモリ | 81,596 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 19:14:57 |
合計ジャッジ時間 | 1,640 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <iostream> #include <iomanip> #include <cstring> #include <algorithm> #include <math.h> #include <queue> #include <functional> #include <map> #include <vector> #include <string> using namespace std; typedef long long ll; int main(void){ ll a, b, c; cin >> a >> b >> c; ll ans = 0; ans += a*(c / (a + b - 1)); if ((a + b - 1)*(c / (a + b - 1)) + a - 1 < c){ ans += a; } else{ ans += c - (a + b - 1)*(c / (a + b - 1)); } cout << ans << endl; }