Submission #2740356
Source Code Expand
using System; using System.Collections.Generic; using System.Text; namespace AtTest.CumulativeSum { class ABC_098_C { static void Main(string[] args) { Method(args); Console.ReadLine(); } static void Method(string[] args) { int n = int.Parse(Console.ReadLine()); string input = Console.ReadLine(); int[] weArray = new int[n]; for (int i = 0; i < n; i++) { if (input[i] == 'W') { weArray[i] = -1; } else { weArray[i] = 1; } } int min = 3 * 100000; for(int i = 0; i < n; i++)//leader { int changeCnt = 0; for(int j = 0; j < n; j++) { if (j == i) continue; if (j < i&&weArray[j]==-1) { changeCnt++; } else if (i < j && weArray[j] == 1) { changeCnt++; } } if (changeCnt < min) { min = changeCnt; } } Console.WriteLine(min); } } }
Submission Info
Submission Time | |
---|---|
Task | C - Attention |
User | MiuraMiuMiu |
Language | C# (Mono 4.6.2.0) |
Score | 0 |
Code Size | 1459 Byte |
Status | TLE |
Exec Time | 2108 ms |
Memory | 12768 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | sample_01.txt, sample_02.txt, sample_03.txt, sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt, subtask_1_09.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_16.txt, subtask_1_17.txt, subtask_1_18.txt, subtask_1_19.txt, subtask_1_20.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 20 ms | 9044 KB |
sample_02.txt | AC | 20 ms | 9044 KB |
sample_03.txt | AC | 20 ms | 9044 KB |
subtask_1_01.txt | TLE | 2108 ms | 10464 KB |
subtask_1_02.txt | TLE | 2108 ms | 10848 KB |
subtask_1_03.txt | TLE | 2108 ms | 9952 KB |
subtask_1_04.txt | TLE | 2108 ms | 9824 KB |
subtask_1_05.txt | TLE | 2108 ms | 9184 KB |
subtask_1_06.txt | TLE | 2108 ms | 10720 KB |
subtask_1_07.txt | TLE | 2108 ms | 10720 KB |
subtask_1_08.txt | TLE | 2108 ms | 10592 KB |
subtask_1_09.txt | TLE | 2108 ms | 12128 KB |
subtask_1_10.txt | TLE | 2108 ms | 12768 KB |
subtask_1_11.txt | TLE | 2108 ms | 10720 KB |
subtask_1_12.txt | TLE | 2108 ms | 10720 KB |
subtask_1_13.txt | TLE | 2108 ms | 12768 KB |
subtask_1_14.txt | TLE | 2108 ms | 10720 KB |
subtask_1_15.txt | TLE | 2108 ms | 12768 KB |
subtask_1_16.txt | TLE | 2108 ms | 12768 KB |
subtask_1_17.txt | TLE | 2108 ms | 12768 KB |
subtask_1_18.txt | TLE | 2108 ms | 10720 KB |
subtask_1_19.txt | TLE | 2108 ms | 10720 KB |
subtask_1_20.txt | TLE | 2108 ms | 12768 KB |