結果
問題 |
No.22 括弧の対応
|
ユーザー |
![]() |
提出日時 | 2016-01-31 19:54:01 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,127 bytes |
コンパイル時間 | 719 ms |
コンパイル使用メモリ | 111,776 KB |
実行使用メモリ | 27,748 KB |
最終ジャッジ日時 | 2024-09-21 19:43:07 |
合計ジャッジ時間 | 1,779 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 19 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Text; using System.Linq; using System.IO; namespace N { class P { static void Main() { Console.SetIn(new StreamReader(Console.OpenStandardInput(10000))); string CSL = Console.ReadLine(); int N = 0; int K = 0; for (int i = 0; i < CSL.Length; i++) { if (CSL[i] == ' ') { N = int.Parse(CSL.Substring(0, i)); K = int.Parse(CSL.Substring(i)); break; } } string Text = Console.ReadLine(); int W_K = 0; int Ans = 0; char T = Text[K - 1]; for (int i = 0; ; i++) { if (Text[i] == '(') W_K++; if (Text[i] == ')') W_K--; if (i == K - 1) break; } if(T=='(') { } else { } Console.WriteLine(N); Console.WriteLine(Text.Length); } } }