結果

問題 No.1183 コイン遊び
ユーザー 👑 yumechiyumechi
提出日時 2021-03-02 00:56:21
言語 Scala(Beta)
(3.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 477 bytes
コンパイル時間 11,905 ms
コンパイル使用メモリ 269,144 KB
実行使用メモリ 94,500 KB
最終ジャッジ日時 2024-04-14 04:16:55
合計ジャッジ時間 37,021 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 938 ms
65,200 KB
testcase_01 AC 929 ms
65,308 KB
testcase_02 AC 940 ms
65,104 KB
testcase_03 AC 934 ms
65,348 KB
testcase_04 AC 938 ms
65,448 KB
testcase_05 AC 939 ms
65,492 KB
testcase_06 AC 937 ms
65,072 KB
testcase_07 AC 934 ms
65,260 KB
testcase_08 AC 1,041 ms
65,564 KB
testcase_09 AC 1,041 ms
65,624 KB
testcase_10 AC 1,428 ms
78,152 KB
testcase_11 AC 1,759 ms
75,908 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner
import scala.collection.mutable.ArrayBuffer

object Main extends App {
  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val al = ArrayBuffer.fill(n)(sc.nextInt)
  val bl = ArrayBuffer.fill(n)(sc.nextInt)
  var ans = 0
  var cnt = 0
  var f = al(0) != bl(0)
  while(cnt < n) {
    val c = al(cnt) != bl(cnt)
    if(c) {
      if(f) {
        ans += 1
        f = false
      }
    } else {
      f = true
    }
    cnt += 1
  }
  println(ans)
}
0