結果

問題 No.26 シャッフルゲーム
ユーザー TaK7907
提出日時 2017-10-28 05:07:24
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,564 bytes
コンパイル時間 3,490 ms
コンパイル使用メモリ 106,368 KB
実行使用メモリ 19,328 KB
最終ジャッジ日時 2024-11-22 00:58:05
合計ジャッジ時間 3,116 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #
プレゼンテーションモードにする

using System;
using System.Collections.Generic;
using System.Linq;
namespace yukicodeX {
public class Program {
public static int Solver(System.IO.TextReader reader) {
var n =1 << (3-int.Parse( reader.ReadLine()));
var m = int.Parse( reader.ReadLine() );
for (var i = 0; i != m; ++i) {
var p = MyLib.GetIntList( reader.ReadLine() );
var nn = n & ( p[ 0 ] | p[ 1 ] );
if (nn > 0) n = n ^ ( p[ 0 ] | p[ 1 ] );
}
return (int)(3 - Math.Log( n ) / Math.Log( 2 ));
}
private static void Main() {
Console.WriteLine( Solver( Console.In ) );
}
}
public class MyLib {
public static string Ordinalization(int num) {
string surfix = "stndrdth";
return string.Format( "{0}{1}", num,
( 0 < num % 10 && num % 10 <= 4 ) && ( ( num % 100 ) / 10 != 1 ) ?
surfix.Substring( ( num % 10 - 1 ) * 2, 2 ) : surfix.Substring( 6 ) );
}
public static List<int> GetIntList(string input) {
return input.Split().ToList<string>().ConvertAll<int>( int.Parse );
}
public static List<int> GetIntList(string input, char delimitor) {
return input.Split( delimitor ).ToList<string>().ConvertAll<int>( int.Parse );
}
public static List<int> GetIntList(string input, char[] delimitors) {
return input.Split( delimitors ).ToList<string>().ConvertAll<int>( int.Parse );
}
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0