結果
問題 |
No.604 誕生日のお小遣い
|
ユーザー |
|
提出日時 | 2018-01-10 13:38:45 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 378 bytes |
コンパイル時間 | 791 ms |
コンパイル使用メモリ | 98,444 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 23:28:00 |
合計ジャッジ時間 | 1,610 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string; void main() { long a, b, c; read3(a, b, c); auto d = c / (a + b - 1); auto e = c % (a + b - 1); writeln(e <= a - 1 ? d * a + e : d * a + a); } void read3(S,T,U)(ref S a, ref T b, ref U c) { auto r = readln.splitter; a = r.front.to!S; r.popFront(); b = r.front.to!T; r.popFront(); c = r.front.to!U; }