Submission #17995


Source Code Expand

Copy
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cctype>
#include <cassert>
#include <cstring>
#include <climits>

using namespace std;

#define FOR(k,a,b) for(typeof(a) k=(a); k < (b); k++)
#define FORE(k,a,b) for(typeof(a) k=(a); k <= (b); k++)
#define REP(k,a) for(int k=0; k < (a); k++)

#define SZ size()
#define ALL(c) (c).begin(), (c).end()
#define PB push_back
#define MP make_pair
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define EXIST(s,e) ((s).find(e)!=(s).end())

#define dump(x) cerr << #x << ": " << (x) << endl;

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

const int INF = 1000 * 1000 * 1000;
const double EPS = 1e-10;

int N;

int points[256];

int main()
{
  points['A'] = 4;
  points['B'] = 3;
  points['C'] = 2;
  points['D'] = 1;
  points['F'] = 0;


  
  cin >> N;
  char c;
  int sum = 0;
  REP(i, N) {
    cin >> c;
    sum += points[c];
  }

  printf("%.10f\n", 1.0 * sum / N);
  
  return 0;
}

Submission Info

Submission Time
Task A - GPA計算
User kohei0418
Language C++ (GCC 4.4.7)
Score 100
Code Size 1415 Byte
Status AC
Exec Time 23 ms
Memory 824 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 21 ms 792 KB
00_sample_02.txt AC 21 ms 760 KB
01_rnd_01.txt AC 21 ms 788 KB
01_rnd_02.txt AC 21 ms 784 KB
01_rnd_03.txt AC 21 ms 796 KB
01_rnd_04.txt AC 20 ms 788 KB
01_rnd_05.txt AC 20 ms 784 KB
01_rnd_06.txt AC 19 ms 784 KB
01_rnd_07.txt AC 21 ms 824 KB
01_rnd_08.txt AC 21 ms 788 KB
01_rnd_09.txt AC 21 ms 784 KB
01_rnd_10.txt AC 21 ms 784 KB
02_rndmax_01.txt AC 21 ms 792 KB
02_rndmax_02.txt AC 21 ms 784 KB
02_rndmax_03.txt AC 20 ms 788 KB
02_rndmax_04.txt AC 21 ms 780 KB
02_rndmax_05.txt AC 21 ms 788 KB
02_rndmax_06.txt AC 21 ms 792 KB
02_rndmax_07.txt AC 20 ms 780 KB
02_rndmax_08.txt AC 23 ms 820 KB
02_rndmax_09.txt AC 21 ms 784 KB
02_rndmax_10.txt AC 21 ms 788 KB
03_mini_01.txt AC 21 ms 788 KB
03_mini_02.txt AC 22 ms 788 KB
03_mini_03.txt AC 21 ms 792 KB
03_mini_04.txt AC 21 ms 816 KB
03_mini_05.txt AC 21 ms 756 KB
04_samemax_01.txt AC 21 ms 788 KB
04_samemax_02.txt AC 22 ms 816 KB
04_samemax_03.txt AC 20 ms 788 KB
04_samemax_04.txt AC 20 ms 792 KB
04_samemax_05.txt AC 21 ms 812 KB