結果
| 問題 |
No.176 2種類の切手
|
| コンテスト | |
| ユーザー |
sio_puyo
|
| 提出日時 | 2015-04-04 06:58:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 347 bytes |
| コンパイル時間 | 1,556 ms |
| コンパイル使用メモリ | 157,272 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-08 03:07:08 |
| 合計ジャッジ時間 | 2,290 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int a,b,t;
int main(){
cin >> a >> b >> t;
int ans=2147483647;
for(int i=0;i<a;++i){
if(i*b>t) {
ans=min(ans,i*b);
break;
}
if((t-i*b)%a==0) ans=t;
else ans=min(ans,i*b+((t-i*b)/a+1)*a);
}
cout << ans << endl;
return 0;
}
sio_puyo