結果
問題 | No.176 2種類の切手 |
ユーザー |
|
提出日時 | 2020-03-01 16:57:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 255 bytes |
コンパイル時間 | 443 ms |
コンパイル使用メモリ | 63,360 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 20:44:18 |
合計ジャッジ時間 | 1,493 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream>using namespace std;int A,B,T;main(){cin>>A>>B>>T;int lim=(T+B-1)/B;if(lim>A)lim=A;int ans=(T+B-1)/B*B;for(int i=0;i<=lim;i++){int now=i*B;if(T>i*B)now+=(T-i*B+A-1)/A*A;if(ans>now)ans=now;}cout<<ans<<endl;}