結果
| 問題 |
No.457 (^^*)
|
| コンテスト | |
| ユーザー |
kuuso1
|
| 提出日時 | 2016-12-08 22:55:32 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,588 bytes |
| コンパイル時間 | 2,311 ms |
| コンパイル使用メモリ | 115,568 KB |
| 実行使用メモリ | 25,948 KB |
| 最終ジャッジ日時 | 2024-11-28 15:33:04 |
| 合計ジャッジ時間 | 8,659 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 7 |
コンパイルメッセージ
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;
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));}
}
kuuso1