結果
問題 |
No.176 2種類の切手
|
ユーザー |
|
提出日時 | 2016-10-04 21:24:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 520 ms / 1,000 ms |
コード長 | 274 bytes |
コンパイル時間 | 522 ms |
コンパイル使用メモリ | 63,616 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 16:50:54 |
合計ジャッジ時間 | 1,904 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <iostream> using namespace std; int main() { int a, b, t; cin >> a >> b >> t; int y = (t + b-1)/b*b; for (int i = 0; i <= t and t < y; i += b) { int x = i + (t-i + a-1)/a*a; if (x < y) y = x; } cout << y << endl; return 0; }