Submission #19084


Source Code Expand

Copy
using System;
using System.Collections.Generic;

public class Myon
{
    public static void Main()
    {
        new Myon().Solve();
    }

    public void Solve()
    {
        decimal N = int.Parse(Console.ReadLine());
        string score = Console.ReadLine();
        int i;
        decimal a = 0;
        decimal b = 0;
        decimal c = 0;
        decimal d = 0;
        decimal f = 0;

        for (i = 0; i < N; i++)
        {
            if (score[i] == 'A')
                a++;
            else if (score[i] == 'B')
                b++;
            else if (score[i] == 'C')
                c++;
            else if (score[i] == 'D')
                d++;
            else if (score[i] == 'F')
                f++;
        }

        Console.WriteLine((4 * a + 3 * b + 2 * c + 1 * d + 0 * f) / N);
    }
}

Submission Info

Submission Time
Task A - GPA計算
User meg73
Language C# (Mono 2.10.8.1)
Score 100
Code Size 854 Byte
Status AC
Exec Time 153 ms
Memory 7632 KB

Judge Result

Set Name all
Score / Max Score 100 / 100
Status
AC × 32
Set Name Test Cases
all 00_sample_01.txt, 00_sample_02.txt, 01_rnd_01.txt, 01_rnd_02.txt, 01_rnd_03.txt, 01_rnd_04.txt, 01_rnd_05.txt, 01_rnd_06.txt, 01_rnd_07.txt, 01_rnd_08.txt, 01_rnd_09.txt, 01_rnd_10.txt, 02_rndmax_01.txt, 02_rndmax_02.txt, 02_rndmax_03.txt, 02_rndmax_04.txt, 02_rndmax_05.txt, 02_rndmax_06.txt, 02_rndmax_07.txt, 02_rndmax_08.txt, 02_rndmax_09.txt, 02_rndmax_10.txt, 03_mini_01.txt, 03_mini_02.txt, 03_mini_03.txt, 03_mini_04.txt, 03_mini_05.txt, 04_samemax_01.txt, 04_samemax_02.txt, 04_samemax_03.txt, 04_samemax_04.txt, 04_samemax_05.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 133 ms 7484 KB
00_sample_02.txt AC 129 ms 7544 KB
01_rnd_01.txt AC 129 ms 7548 KB
01_rnd_02.txt AC 130 ms 7540 KB
01_rnd_03.txt AC 129 ms 7488 KB
01_rnd_04.txt AC 128 ms 7488 KB
01_rnd_05.txt AC 153 ms 7552 KB
01_rnd_06.txt AC 132 ms 7508 KB
01_rnd_07.txt AC 129 ms 7488 KB
01_rnd_08.txt AC 129 ms 7484 KB
01_rnd_09.txt AC 129 ms 7548 KB
01_rnd_10.txt AC 129 ms 7632 KB
02_rndmax_01.txt AC 129 ms 7544 KB
02_rndmax_02.txt AC 128 ms 7488 KB
02_rndmax_03.txt AC 129 ms 7488 KB
02_rndmax_04.txt AC 128 ms 7608 KB
02_rndmax_05.txt AC 129 ms 7508 KB
02_rndmax_06.txt AC 128 ms 7552 KB
02_rndmax_07.txt AC 131 ms 7480 KB
02_rndmax_08.txt AC 129 ms 7576 KB
02_rndmax_09.txt AC 126 ms 7484 KB
02_rndmax_10.txt AC 130 ms 7480 KB
03_mini_01.txt AC 129 ms 7480 KB
03_mini_02.txt AC 131 ms 7524 KB
03_mini_03.txt AC 129 ms 7540 KB
03_mini_04.txt AC 129 ms 7548 KB
03_mini_05.txt AC 128 ms 7608 KB
04_samemax_01.txt AC 130 ms 7484 KB
04_samemax_02.txt AC 129 ms 7488 KB
04_samemax_03.txt AC 130 ms 7452 KB
04_samemax_04.txt AC 130 ms 7548 KB
04_samemax_05.txt AC 129 ms 7484 KB