結果
| 問題 |
No.176 2種類の切手
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-25 09:40:46 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 584 bytes |
| コンパイル時間 | 703 ms |
| コンパイル使用メモリ | 115,360 KB |
| 実行使用メモリ | 8,988 KB |
| 最終ジャッジ日時 | 2024-06-12 05:14:19 |
| 合計ジャッジ時間 | 3,944 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 18 WA * 1 TLE * 1 -- * 9 |
ソースコード
import std.stdio;
import std.array;
import std.string;
import std.conv;
import std.algorithm;
import std.typecons;
import std.range;
import std.random;
import std.math;
import std.container;
import std.numeric;
import std.bigint;
import core.bitop;
void main() {
auto input = readln.split.map!(to!long);
auto A = input[0];
auto B = input[1];
auto T = input[2];
if (T % A == 0 || T % B == 0) {writeln(T); return;}
auto ans = long.max;
foreach (i; 0..T/A+2) {
auto j = T - A*i - 1 <= 0 ? 0 : (T - A*i - 1) / B + 1;
ans = min(ans, A*i+B*j);
}
writeln(ans);
}