結果
問題 |
No.176 2種類の切手
|
ユーザー |
![]() |
提出日時 | 2016-10-04 17:39:18 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 304 bytes |
コンパイル時間 | 785 ms |
コンパイル使用メモリ | 56,288 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-11-21 15:53:39 |
合計ジャッジ時間 | 7,967 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 4 TLE * 4 |
ソースコード
#include <iostream> #include <algorithm> using namespace std; int main() { int a, b, t; cin >> a >> b >> t; if (a > b)swap(a, b); int mn = 1000000001; int x; for (int i = 0; i*b <= t; i++){ mn = min(mn, (a - (t - i*b) % a)%a); //cout << mn << endl; } cout << mn + t << endl; return 0; }