結果
| 問題 |
No.380 悪の台本
|
| コンテスト | |
| ユーザー |
14番
|
| 提出日時 | 2016-06-18 03:59:43 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 3,195 bytes |
| コンパイル時間 | 966 ms |
| コンパイル使用メモリ | 106,680 KB |
| 実行使用メモリ | 19,456 KB |
| 最終ジャッジ日時 | 2024-11-06 22:56:31 |
| 合計ジャッジ時間 | 2,109 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 3 WA * 5 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
class Program
{
public void Proc()
{
Reader.IsDebug = false;
string correct = "CORRECT (maybe)";
string wrong = "WRONG!";
string inpt = string.Empty;
do {
inpt = Reader.ReadLine();
if(inpt == null) {
continue;
}
int pos = inpt.IndexOf(" ");
if(pos < 0) {
Console.WriteLine(wrong);
continue;
}
string name = inpt.Substring(0,pos);
string dialog = inpt.Substring(pos + 1);
bool isCorrect = false;
if(name.Equals("digi")) {
string temp = dialog.Substring(Math.Max(0, dialog.Length - 6)).ToLower();
if(temp.Contains("nyo")) {
isCorrect = true;
}
} else if(name.Equals("petit")) {
string temp = dialog.Substring(Math.Max(0, dialog.Length - 6)).ToLower();
if(temp.Contains("nyu")) {
isCorrect = true;
}
} else if(name.Equals("rabi"))
{
foreach (char c in dialog)
{
if(c >= 'a' && c <= 'z') {
isCorrect = true;
break;
} else if(c >= 'A' && c <= 'Z') {
isCorrect = true;
break;
} else if(c >= '0' && c <= '9')
{
isCorrect = true;
break;
}
}
} else if(name.Equals("gema"))
{
string temp = dialog.Substring(Math.Max(0, dialog.Length - 7)).ToLower();
if(temp.Contains("gema")) {
isCorrect = true;
}
} else if(name.Equals("piyo")) {
string temp = dialog.Substring(Math.Max(0, dialog.Length - 6)).ToLower();
if(temp.Contains("pyo")) {
isCorrect = true;
}
} else {
}
if(isCorrect) {
Console.WriteLine(correct);
} else
{
Console.WriteLine(wrong);
}
} while (inpt != null);
}
public class Reader
{
public static bool IsDebug = true;
private static String PlainInput = @"
digi correct-da-nyo
digi KOREMO CORRECT DA NYO
digi KoReDeMo Correct NanDa Nyo!!
petit petit ha digi ja nai nyo
";
private static System.IO.StringReader Sr = null;
public static string ReadLine()
{
if (IsDebug)
{
if (Sr == null)
{
Sr = new System.IO.StringReader(PlainInput.Trim());
}
return Sr.ReadLine();
}
else
{
return Console.ReadLine();
}
}
}
static void Main()
{
Program prg = new Program();
prg.Proc();
}
}
14番