結果

問題 No.457 (^^*)
ユーザー kuuso1kuuso1
提出日時 2016-12-08 22:55:32
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,588 bytes
コンパイル時間 3,565 ms
コンパイル使用メモリ 107,520 KB
実行使用メモリ 24,576 KB
最終ジャッジ日時 2023-08-19 02:36:37
合計ジャッジ時間 9,156 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
20,480 KB
testcase_01 AC 46 ms
24,576 KB
testcase_02 AC 45 ms
20,432 KB
testcase_03 AC 45 ms
22,548 KB
testcase_04 WA -
testcase_05 AC 45 ms
20,596 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 566 ms
20,548 KB
testcase_13 AC 510 ms
20,528 KB
testcase_14 AC 507 ms
20,448 KB
testcase_15 AC 568 ms
20,520 KB
testcase_16 AC 509 ms
22,448 KB
testcase_17 AC 508 ms
20,476 KB
testcase_18 AC 46 ms
20,452 KB
testcase_19 AC 45 ms
22,436 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Text;

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

class Sol{
	public void Solve(){
		
		int[] Ans = new int[2];
		for(int t=0;t<2;t++){
			String s = S[t];
			int N = s.Length;
			for(int i=0;i<N;i++){
				bool[] dp = new bool[5];
				for(int j=i;j<N;j++){
					switch(s[j]){
						case '(':dp[0] = true; break;
						case '^':dp[2] |= dp[1];dp[1] |= dp[0]; break;
						case '*':dp[3] |= dp[2]; break;
						case ')':dp[4] |= dp[3]; break;
						default: break;
					}
					if(s[j] ==')' && dp[4]) Ans[t]++;
				}
			}
		}
		Console.WriteLine(String.Join(" ",Ans));
	}
	String[] S;
	public Sol(){
		S = new String[2];
		S[0] = rs();
		var ca = S[0].ToCharArray();
		Array.Reverse(ca);
		for(int i=0;i<ca.Length;i++){
			if(ca[i] == '(') ca[i] = ')';
			else if(ca[i] == ')') ca[i] = '(';
		}
		S[1] = new String(ca);
	}

	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(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}
0