結果
| 問題 |
No.232 めぐるはめぐる (2)
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2015-06-27 12:02:41 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,691 bytes |
| コンパイル時間 | 814 ms |
| コンパイル使用メモリ | 115,676 KB |
| 実行使用メモリ | 26,044 KB |
| 最終ジャッジ日時 | 2024-07-07 19:54:57 |
| 合計ジャッジ時間 | 5,296 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 2 WA * 15 RE * 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.Linq;
using System.Text;
using System.Threading.Tasks;
namespace foryuki
{
class Program
{
static void Main(string[] args)
{
string[] s = Console.ReadLine().Split();
int t = int.Parse(s[0]);
int a = int.Parse(s[1]);
int b = int.Parse(s[2]);
int[,] z = new int[a, b];
int x = 0;
int y = 0;
List<string> li = new List<string>();
int k = t;
if (a == b && a == 0)
{
x--;
y--;
k--;
}
//たどり着けるか判定
if (t > ((a > b) ? a : b))
{
Console.WriteLine("NO");
return;
}
//斜め移動
while (x < b - 1 && y < a - 1)
{
x++;
y++;
k--;
li.Add(">^");
}
//水平移動
while (x < t - 1)
{
x++;
k--;
li.Add(">");
}
//垂直移動
while (y > t - 1)
{
y++;
k--;
li.Add("^");
}
while (k > 0)
{
//左下 中央下
if (k == 1)
{
x++;
y++;
k--;
li.Add(">^");
break;
}
else
{
x++;
k--;
li.Add(">");
}
if (k == 1)
{
y++;
k--;
li.Add("^");
break;
}
else
{
x--;
k--;
li.Add("<");
}
}
Console.WriteLine("YES");
foreach (var item in li)
{
Console.WriteLine(item);
}
}
//-------------------------------------------------------------
static int[] ConvertStringArrayToIntArray(string[] array)
{
return Array.ConvertAll(array, str => int.Parse(str));
}
static List<int> ConvertStringArrayToIntList(string[] str)
{
var list = new List<int>();
foreach (var c in str) list.Add(int.Parse(c));
return list;
}
}
}
No