結果

問題 No.538 N.G.S.
ユーザー 💕💖💞
提出日時 2017-07-08 13:58:54
言語 Kotlin
(2.1.0)
結果
AC  
実行時間 344 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 11,868 ms
コンパイル使用メモリ 436,896 KB
実行使用メモリ 56,996 KB
最終ジャッジ日時 2024-11-20 11:32:44
合計ジャッジ時間 31,813 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 51
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:2:11: warning: parameter 'args' is never used
fun main( args : Array<String> ) {
          ^

ソースコード

diff #

import java.lang.Math
fun main( args : Array<String> ) {
  val (a, b, c) = readLine()!!.split(" ").map { it.toLong() }
  // c = n * b + d
  // b = n * a + d
  val n = (c - b) / (b - a).toDouble() 
  val d = c - n * b
  println("${Math.round(n*c + d)}")
}
0