結果

問題 No.208 王将
ユーザー kuuso1
提出日時 2015-05-15 23:01:43
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,779 bytes
コンパイル時間 924 ms
コンパイル使用メモリ 114,000 KB
実行使用メモリ 29,260 KB
最終ジャッジ日時 2024-07-06 04:13:18
合計ジャッジ時間 2,365 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Collections.Generic;
using System.Linq;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		
		if(A[1]==0 && A[1]==B[1]){
			if(Math.Abs(B[0])>Math.Abs(A[0])){
				Console.WriteLine(Math.Abs(A[0]));
			}else{
				Console.WriteLine(Math.Abs(A[0]));
			}
			return;
		}
		if(A[0]==0 && A[0]==B[0]){
			if(Math.Abs(B[1])>Math.Abs(A[1])){
				Console.WriteLine(Math.Abs(A[1]));
			}else{
				Console.WriteLine(Math.Abs(A[1]));
			}
			return;
		}
		if(A[0]==A[1]&&B[0]==B[1]){
			if(Math.Abs(B[1])>Math.Abs(A[1])){
				Console.WriteLine(Math.Abs(A[1]));
			}else if(A[0]*B[0]<0){
				Console.WriteLine(Math.Abs(A[1]));
			}else{
				Console.WriteLine(Math.Abs(A[1])+2);
			}
			return;
		}
		if(A[0]==-A[1]&&B[0]==-B[1]){
			if(Math.Abs(B[1])>Math.Abs(A[1])){
				Console.WriteLine(Math.Abs(A[1]));
			}else if(A[0]*B[0]<0){
				Console.WriteLine(Math.Abs(A[1]));
			}else{
				Console.WriteLine(Math.Abs(A[1])+2);
			}
			return;
		}
		
		
		
		if(A[0]<0)A[0]*=-1;
		if(A[1]<0)A[1]*=-1;
		Console.WriteLine(A.Max());
		return;
		
	}
	long[] A,B;
	public Sol(){
		A=rla();B=rla();
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
0