結果

問題 No.933 おまわりさんこいつです
ユーザー 小野寺健小野寺健
提出日時 2021-12-18 14:36:12
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 466 bytes
コンパイル時間 12,115 ms
コンパイル使用メモリ 197,100 KB
実行使用メモリ 5,704 KB
最終ジャッジ日時 2023-10-13 17:56:23
合計ジャッジ時間 15,846 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 1 ms
4,352 KB
testcase_05 AC 1 ms
4,352 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 34 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 45 ms
5,640 KB
testcase_20 WA -
testcase_21 AC 1 ms
4,352 KB
testcase_22 AC 1 ms
4,352 KB
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

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

func main() {
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
    defer w.Flush()
	var N int
	fmt.Fscan(r, &N)
	var k int = 1
	for i := 0; i < N; i++ {
		var x int
		fmt.Fscan(r, &x)
		if x == 0 || k == 0 {
			k = 0
		} else if x % 9 == 0 {
			k *= 9
		} else {
			k *= x % 9
		}
	}
	if k == 0 {
		fmt.Fprintln(w, 0)
	} else if k % 9 == 0 {
		fmt.Fprintln(w, 9)
	} else {
		fmt.Fprintln(w, k % 9)
	}
}
0