Submission #19387


Source Code Expand

Copy
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sandbox
{
    class Program
    {
        static void Main(string[] args)
        {
            string input1 = Console.ReadLine();
            string input2 = Console.ReadLine();
            int numOfUnits = int.Parse(input1);
            int numOfA = CountChar(input2, 'A');
            int numOfB = CountChar(input2, 'B');
            int numOfC = CountChar(input2, 'C');
            int numOfD = CountChar(input2, 'D');
            int numOfF = CountChar(input2, 'F');

            
//            string strTmp = args[0].Replace("\r", "/");
//            strTmp = strTmp.Replace("\n", "/");
//            strTmp = strTmp.Replace("//", "/");
//            string[] str = strTmp.Split('/');
//            int numOfUnits = int.Parse(str[0]);
//            int numOfA = CountChar(str[1], 'A');
//            int numOfB = CountChar(str[1], 'B');
//            int numOfC = CountChar(str[1], 'C');
//            int numOfD = CountChar(str[1], 'D');
//            int numOfF = CountChar(str[1], 'F');

            double gpa = (numOfA * 4.0f + numOfB * 3.0f + numOfC * 2.0f + numOfD * 1.0f) / numOfUnits;
            Console.WriteLine(gpa.ToString());
            Console.WriteLine();
        }

        public static int CountChar(string s, char c)
        {
            return s.Length - s.Replace(c.ToString(), "").Length;
        }
    }

}

Submission Info

Submission Time
Task A - GPA計算
User jack1568
Language C# (Mono 2.10.8.1)
Score 100
Code Size 1483 Byte
Status AC
Exec Time 155 ms
Memory 7588 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 123 ms 7584 KB
00_sample_02.txt AC 134 ms 7588 KB
01_rnd_01.txt AC 126 ms 7524 KB
01_rnd_02.txt AC 125 ms 7580 KB
01_rnd_03.txt AC 126 ms 7508 KB
01_rnd_04.txt AC 126 ms 7520 KB
01_rnd_05.txt AC 134 ms 7576 KB
01_rnd_06.txt AC 123 ms 7540 KB
01_rnd_07.txt AC 123 ms 7524 KB
01_rnd_08.txt AC 125 ms 7564 KB
01_rnd_09.txt AC 155 ms 7548 KB
01_rnd_10.txt AC 125 ms 7520 KB
02_rndmax_01.txt AC 127 ms 7520 KB
02_rndmax_02.txt AC 130 ms 7588 KB
02_rndmax_03.txt AC 127 ms 7480 KB
02_rndmax_04.txt AC 123 ms 7524 KB
02_rndmax_05.txt AC 127 ms 7524 KB
02_rndmax_06.txt AC 121 ms 7468 KB
02_rndmax_07.txt AC 128 ms 7520 KB
02_rndmax_08.txt AC 125 ms 7564 KB
02_rndmax_09.txt AC 124 ms 7516 KB
02_rndmax_10.txt AC 126 ms 7520 KB
03_mini_01.txt AC 129 ms 7504 KB
03_mini_02.txt AC 123 ms 7568 KB
03_mini_03.txt AC 124 ms 7460 KB
03_mini_04.txt AC 125 ms 7496 KB
03_mini_05.txt AC 127 ms 7452 KB
04_samemax_01.txt AC 125 ms 7520 KB
04_samemax_02.txt AC 130 ms 7520 KB
04_samemax_03.txt AC 133 ms 7544 KB
04_samemax_04.txt AC 128 ms 7520 KB
04_samemax_05.txt AC 135 ms 7520 KB