結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
|
提出日時 | 2022-12-25 11:00:56 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,107 bytes |
コンパイル時間 | 908 ms |
コンパイル使用メモリ | 107,872 KB |
実行使用メモリ | 26,580 KB |
最終ジャッジ日時 | 2024-11-18 22:22:53 |
合計ジャッジ時間 | 2,147 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 11 WA * 2 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; namespace _0446 { class Program { static void Main(string[] args) { var a = Console.ReadLine(); var b = Console.ReadLine(); int x = 0; int y = 0; var f = false; // 文字列が入っていないかをチェック if (int.TryParse(a, out x) && int.TryParse(b, out y)) { // 0<= a,b <= 12345以内かつ、先頭数値が0ではないか if(x >= 0 && x <= 12345 && y >= 0 && y <= 12345) { if (a.Length >= 2 && a.StartsWith("0") && b.Length >= 2 && b.StartsWith("0")) { Console.WriteLine("NG"); } else { Console.WriteLine("OK"); } } else { Console.WriteLine("NG"); } } else { Console.WriteLine("NG"); } } } }