結果
| 問題 |
No.232 めぐるはめぐる (2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-29 23:30:39 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,513 bytes |
| コンパイル時間 | 758 ms |
| コンパイル使用メモリ | 110,284 KB |
| 実行使用メモリ | 18,048 KB |
| 最終ジャッジ日時 | 2024-07-07 21:18:14 |
| 合計ジャッジ時間 | 3,426 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 5 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
namespace YukiCoderNo232
{
class Program
{
static void Main()
{
string[] buffer = (Console.ReadLine()).Split(' ');
int turn = int.Parse(buffer[0]);
int posY = int.Parse(buffer[1]);
int posX = int.Parse(buffer[2]);
int nowPosX = 0;
int nowPosY = 0;
int posMax = Math.Max(posX, posY);
int stepCount = 0;
if ((turn >= posMax) && (!((posX == 0) && (posY == 0) && ((turn % 2) != 0))))
{
Console.WriteLine("YES");
int step = turn - posMax;
int dummyStepCount = (step / 2);
for (int i = 0; i < dummyStepCount; i++)
{
Console.WriteLine(">");
Console.WriteLine("<");
stepCount += 2;
}
int posMin = Math.Min(posX, posY);
int posDiff = Math.Abs(posY - posX);
if ((step % 2) == 0)
{
for (int i = 0; i < posMin; i++)
{
Console.WriteLine("^>");
nowPosX++;
nowPosY++;
stepCount++;
}
}
else
{
Console.WriteLine("^");
Console.WriteLine(">");
nowPosX++;
nowPosY++;
stepCount += 2;
for (int i = 1; i < posMin; i++)
{
Console.WriteLine("^>");
nowPosX++;
nowPosY++;
stepCount++;
}
}
if (posX > posY)
{
for (int i = 0; i < posDiff; i++)
{
Console.WriteLine(">");
nowPosX++;
stepCount++;
}
}
else if (posX < posY)
{
for (int i = 0; i < posDiff; i++)
{
Console.WriteLine("^");
nowPosY++;
stepCount++;
}
}
}
else
{
Console.WriteLine("NO");
}
}
}
}