結果
問題 | No.176 2種類の切手 |
ユーザー |
![]() |
提出日時 | 2020-10-23 15:58:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 318 bytes |
コンパイル時間 | 1,542 ms |
コンパイル使用メモリ | 165,332 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-21 10:16:18 |
合計ジャッジ時間 | 2,749 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <bits/stdc++.h>#define rep(i,n) for(int i=0;i<(n);i++)using namespace std;using lint=long long;const long long INF=1LL<<61;int main(){lint a,b,n; cin>>a>>b>>n;lint ans=INF;for(lint l=0;l<=a&&l<=(n+b-1)/b;l++){lint k=(n-l*b+a-1)/a;ans=min(ans,k*a+l*b);}cout<<ans<<'\n';return 0;}