結果
問題 |
No.176 2種類の切手
|
ユーザー |
![]() |
提出日時 | 2018-06-16 19:01:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 446 bytes |
コンパイル時間 | 1,554 ms |
コンパイル使用メモリ | 166,468 KB |
実行使用メモリ | 13,752 KB |
最終ジャッジ日時 | 2024-06-30 16:24:23 |
合計ジャッジ時間 | 4,450 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 TLE * 1 -- * 10 |
コンパイルメッセージ
main.cpp:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 11 | main(){ | ^~~~
ソースコード
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=int(a);i<int(b);++i) using namespace std; typedef long long ll; ll INF = (1LL << 60) - 1; int MOD = 1e9+7; ll gcd (ll a,ll b){ return b ? gcd(b,a%b) : a; } main(){ ll A,B,T; cin >> A >> B >> T; ll ans = INF; int i; for(i = 0;i * B <= T;i++){ ans = min(ans, (T - B * i + A - 1) / A * A + B * i); } ans = min(ans, B * i); cout << ans << endl; }