結果

問題 No.1183 コイン遊び
ユーザー 👑 yumechiyumechi
提出日時 2021-03-02 00:48:31
言語 Go
(1.22.1)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 556 bytes
コンパイル時間 11,616 ms
コンパイル使用メモリ 227,956 KB
実行使用メモリ 48,960 KB
最終ジャッジ日時 2024-04-14 04:13:25
合計ジャッジ時間 15,387 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 3 ms
6,816 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 3 ms
6,944 KB
testcase_07 AC 3 ms
6,940 KB
testcase_08 AC 3 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 4 ms
9,820 KB
testcase_11 AC 6 ms
11,896 KB
testcase_12 AC 50 ms
32,500 KB
testcase_13 AC 38 ms
30,448 KB
testcase_14 AC 73 ms
44,792 KB
testcase_15 AC 82 ms
48,956 KB
testcase_16 AC 83 ms
48,960 KB
testcase_17 AC 79 ms
48,952 KB
testcase_18 AC 83 ms
48,952 KB
testcase_19 AC 83 ms
48,956 KB
testcase_20 AC 83 ms
48,952 KB
testcase_21 AC 77 ms
48,952 KB
testcase_22 AC 73 ms
48,956 KB
testcase_23 AC 72 ms
48,956 KB
testcase_24 AC 76 ms
48,956 KB
testcase_25 AC 80 ms
48,956 KB
testcase_26 AC 79 ms
48,956 KB
testcase_27 AC 79 ms
48,956 KB
testcase_28 AC 79 ms
48,956 KB
testcase_29 AC 77 ms
48,956 KB
testcase_30 AC 73 ms
48,952 KB
testcase_31 AC 80 ms
48,956 KB
testcase_32 AC 79 ms
48,956 KB
testcase_33 AC 79 ms
48,956 KB
testcase_34 AC 79 ms
48,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	r := bufio.NewReaderSize(os.Stdin, 8 * 1000000)
	w := bufio.NewWriterSize(os.Stdout, 8 * 1000000)
	defer w.Flush()

	var n int
	fmt.Fscanln(r, &n)
	sb, _, _ := r.ReadLine()
	s := string(sb)
	tb, _, _ := r.ReadLine()
	t := string(tb)

	an := strings.Split(s, " ")
	bn := strings.Split(t, " ")

	var ans int = 0
	var f bool = an[0] != bn[0]
	for i := 0; i < n; i++ {
		if an[i] != bn[i] {
			if f {
				ans += 1
				f = false
			}
		} else {
			f = true
		}
	}
	fmt.Fprintln(w, ans)
}
0