結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
![]() |
提出日時 | 2016-11-19 20:35:55 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 890 bytes |
コンパイル時間 | 15,264 ms |
コンパイル使用メモリ | 227,192 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 06:15:44 |
合計ジャッジ時間 | 15,081 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
package main import ( "bufio" "fmt" _ "math" "os" _ "reflect" "regexp" "strconv" _ "strings" ) func main() { scanner := bufio.NewScanner(os.Stdin) th := 0 lines := []string{} for scanner.Scan() { th += 1 text := scanner.Text() lines = append(lines, text) if th == 2 { break } } a, ae := strconv.ParseInt(lines[0], 10, 64) b, be := strconv.ParseInt(lines[1], 10, 64) if ae != nil || be != nil || a > 12345 || b > 12345 || (len(lines[0]) > 1 && regexp.MustCompile(`^0{1,}`).MatchString(lines[0])) || (len(lines[1]) > 1 && regexp.MustCompile(`^0{1,}`).MatchString(lines[1])) { fmt.Println("NG") } else { fmt.Println("OK") } }