結果
| 問題 |
No.392 2分木をたどれ
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2016-08-12 02:33:19 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 953 bytes |
| コンパイル時間 | 5,037 ms |
| コンパイル使用メモリ | 105,824 KB |
| 最終ジャッジ日時 | 2024-11-14 19:48:42 |
| 合計ジャッジ時間 | 5,429 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved. Main.cs(24,32): error CS8389: Omitting the type argument is not allowed in the current context Main.cs(24,32): error CS7003: Unexpected use of an unbound generic name
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
class Program {
static string ReadLine() { return Console.ReadLine(); }
static int ReadInt() { return int.Parse(ReadLine()); }
static int[] ReadInts() { return ReadLine().Split().Select(int.Parse).ToArray(); }
static string[] ReadStrings() { return ReadLine().Split(); }
static void Display<T> (IEnumerable<T> xs) { Console.WriteLine(string.Join(" ", xs)); }
static string Calc(int x) {
var ans = new List<string>();
while (x > 0) {
if (x % 2 == 0) {
ans.Add("R");
}
else {
ans.Add("L");
}
x = (x - 1) / 2;
}
return string.Join("", ans.Reverse<>());
}
static void Main() {
int n = ReadInt();
for (int i = 0; i < n; i++) {
int x = ReadInt();
Console.WriteLine(Calc(x));
}
}
}
norioc