結果
| 問題 |
No.176 2種類の切手
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-25 09:46:51 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 605 bytes |
| コンパイル時間 | 827 ms |
| コンパイル使用メモリ | 114,048 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-12 05:14:25 |
| 合計ジャッジ時間 | 2,523 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 WA * 1 |
ソースコード
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);
if (j > B) break;
}
writeln(ans);
}