Submission #1100469


Source Code Expand

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <vector>

#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define all(v) begin(v), end(v)
#define debug(x) cerr<< #x <<": "<<x<<endl
#define debug2(x,y) cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<endl

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
template<class T> using vv=vector<vector< T > >;

int main() {
  int na, nb;
  scanf("%d %d", &na, &nb);
  set<int> a, common;
  rep (i, na) {
    int tmp;
    scanf("%d", &tmp);
    a.insert(tmp);
  }
  auto universe = a;
  rep (i, nb) {
    int tmp;
    scanf("%d", &tmp);
    universe.insert(tmp);
    if (a.find(tmp) != end(a)) {
      common.insert(tmp);
    }
  }
  printf("%.9f\n", (double)common.size() / (double)universe.size());

  return 0;
}

Submission Info

Submission Time
Task B - メタ構文変数
User tspcx
Language C++11 (GCC 4.8.1)
Score 100
Code Size 1323 Byte
Status AC
Exec Time 183 ms
Memory 14956 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:40:27: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &na, &nb);
                           ^
./Main.cpp:44:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &tmp);
                      ^
./Main.cpp:50:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &tmp);
                      ^

Judge Result

Set Name Sample Subtask1 Subtask2 Subtask3
Score / Max Score 0 / 0 40 / 40 30 / 30 30 / 30
Status
AC × 2
AC × 11
AC × 19
AC × 26
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
Subtask1 sample_01.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt
Subtask2 sample_01.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt
Subtask3 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask3_01.txt, subtask3_02.txt, subtask3_03.txt, subtask3_04.txt, subtask3_05.txt, subtask3_06.txt, subtask3_07.txt, subtask3_08.txt
Case Name Status Exec Time Memory
sample_01.txt AC 18 ms 1044 KB
sample_02.txt AC 18 ms 920 KB
subtask1_01.txt AC 17 ms 1044 KB
subtask1_02.txt AC 19 ms 916 KB
subtask1_03.txt AC 20 ms 1044 KB
subtask1_04.txt AC 20 ms 1048 KB
subtask1_05.txt AC 20 ms 1048 KB
subtask1_06.txt AC 18 ms 1176 KB
subtask1_07.txt AC 20 ms 1048 KB
subtask1_08.txt AC 20 ms 1048 KB
subtask1_09.txt AC 19 ms 916 KB
subtask1_10.txt AC 18 ms 1040 KB
subtask2_01.txt AC 73 ms 6188 KB
subtask2_02.txt AC 180 ms 14932 KB
subtask2_03.txt AC 82 ms 7016 KB
subtask2_04.txt AC 180 ms 14956 KB
subtask2_05.txt AC 46 ms 4392 KB
subtask2_06.txt AC 82 ms 7916 KB
subtask2_07.txt AC 138 ms 12332 KB
subtask2_08.txt AC 180 ms 14896 KB
subtask3_01.txt AC 102 ms 9836 KB
subtask3_02.txt AC 160 ms 14884 KB
subtask3_03.txt AC 56 ms 4716 KB
subtask3_04.txt AC 183 ms 14956 KB
subtask3_05.txt AC 90 ms 10284 KB
subtask3_06.txt AC 162 ms 14892 KB
subtask3_07.txt AC 115 ms 12008 KB
subtask3_08.txt AC 176 ms 14892 KB