Submission #3440789
Source Code Expand
using System; using System.Collections.Generic; using System.Linq; namespace AtCoder { class Program { static int n; static char[] people; static void Main(string[] args) { //[summary]C - Attention n = int.Parse(Console.ReadLine().TrimEnd()); string s = Console.ReadLine().TrimEnd(); people = s.ToCharArray(); int min = GetMinimumTurnedPeople(); Console.WriteLine(min); } static int GetMinimumTurnedPeople() { int min = n; for(int i = 0; i < n; i++) { int count = CountTurnedPeople(i); if (count == 0) { return 0; } else if (count < min) { min = count; } } return min; } static int CountTurnedPeople(int index) { int count = 0; if (index > 0) { count = people.Take(index - 1).Count(c => c == 'W'); } if (index < n - 1) { var reversePeople = people.Reverse().ToList(); count += reversePeople.Take(n - index - 1).Count(c => c == 'E'); } return count; } } }
Submission Info
Submission Time | |
---|---|
Task | C - Attention |
User | tad092626 |
Language | C# (Mono 4.6.2.0) |
Score | 0 |
Code Size | 1466 Byte |
Status | TLE |
Exec Time | 2112 ms |
Memory | 31316 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 | 26 ms | 11220 KB |
sample_02.txt | AC | 25 ms | 11348 KB |
sample_03.txt | AC | 24 ms | 11348 KB |
subtask_1_01.txt | TLE | 2109 ms | 28688 KB |
subtask_1_02.txt | AC | 27 ms | 11988 KB |
subtask_1_03.txt | TLE | 2108 ms | 30500 KB |
subtask_1_04.txt | TLE | 2109 ms | 30532 KB |
subtask_1_05.txt | TLE | 2108 ms | 27460 KB |
subtask_1_06.txt | TLE | 2108 ms | 28760 KB |
subtask_1_07.txt | TLE | 2112 ms | 28716 KB |
subtask_1_08.txt | TLE | 2108 ms | 28440 KB |
subtask_1_09.txt | TLE | 2108 ms | 30208 KB |
subtask_1_10.txt | TLE | 2108 ms | 28568 KB |
subtask_1_11.txt | TLE | 2108 ms | 28548 KB |
subtask_1_12.txt | TLE | 2112 ms | 30628 KB |
subtask_1_13.txt | AC | 39 ms | 13024 KB |
subtask_1_14.txt | TLE | 2112 ms | 31316 KB |
subtask_1_15.txt | TLE | 2108 ms | 30644 KB |
subtask_1_16.txt | TLE | 2112 ms | 26564 KB |
subtask_1_17.txt | TLE | 2112 ms | 30632 KB |
subtask_1_18.txt | TLE | 2108 ms | 28580 KB |
subtask_1_19.txt | TLE | 2108 ms | 26508 KB |
subtask_1_20.txt | TLE | 2108 ms | 30624 KB |