結果
| 問題 |
No.201 yukicoderじゃんけん
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-22 22:58:14 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,008 bytes |
| コンパイル時間 | 793 ms |
| コンパイル使用メモリ | 113,772 KB |
| 実行使用メモリ | 26,600 KB |
| 最終ジャッジ日時 | 2024-10-15 04:27:31 |
| 合計ジャッジ時間 | 2,452 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 WA * 3 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
using System.Collections.Generic;
public class yukicoder
{
public static int convert(string s)
{
if(s == "r") return 0;
else if(s == "s") return 1;
else return 2;
}
public static void Main()
{
string[] a = Console.ReadLine().Split(' ');
string[] b = Console.ReadLine().Split(' ');
int compareAtoB = a[1].CompareTo(b[1]);
int aaa = convert(a[2]);
int bbb = convert(b[2]);
if(compareAtoB != 0)
{
if(compareAtoB == 1)
{
Console.WriteLine(a[0]);
}
else
{
Console.WriteLine(b[0]);
}
}
else
{
if(aaa == bbb)
{
Console.WriteLine("-1");
}
else if(aaa - bbb == -1 || aaa - bbb == 2)
{
Console.WriteLine(a[0]);
}
else
{
Console.WriteLine(b[0]);
}
}
}
}