結果
問題 |
No.176 2種類の切手
|
ユーザー |
|
提出日時 | 2016-04-12 12:28:13 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 410 bytes |
コンパイル時間 | 2,291 ms |
コンパイル使用メモリ | 74,444 KB |
実行使用メモリ | 63,144 KB |
最終ジャッジ日時 | 2024-10-08 03:42:26 |
合計ジャッジ時間 | 5,098 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | WA * 1 TLE * 1 -- * 27 |
ソースコード
package yukicoder; import java.util.*; public class Main{ public static void main(String[] args)throws Exception{ new Main().solve(); } void solve(){ Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int b=sc.nextInt(); int n=sc.nextInt(); int min=999999999; for(int i=0;i<=b;i++){ if(a*i>n)break; min=Math.min(a*i+((n-a*i+b-1)/b)*b, min); } System.out.println(min); } }