結果
問題 | No.773 コンテスト |
ユーザー |
![]() |
提出日時 | 2019-01-01 22:29:08 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 622 bytes |
コンパイル時間 | 15,727 ms |
コンパイル使用メモリ | 232,964 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 11:26:25 |
合計ジャッジ時間 | 16,616 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
package mainimport ("bufio""fmt""os""strconv")func main() {fmt.Println(run())}func run() int {setSpace()start := readN()end := readN()m := make(map[int]bool, 31)for i := start - 1; i < end; i++ {m[i] = true}cnt := 0if m[22] {cnt++}if m[23] {cnt++}if m[24] {cnt++}return 3 - cnt}var sc = bufio.NewScanner(os.Stdin)func setSpace() {sc.Split(bufio.ScanWords)}func setLine() {sc.Split(bufio.ScanLines)}func read() string {sc.Scan()return sc.Text()}func readN() int {n, err := strconv.Atoi(read())if err != nil {panic(err)}return n}