답안 #402023

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
402023 2021-05-11T08:00:58 Z IloveN Languages (IOI10_languages) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#include "grader.h"
using namespace std;
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(vr) vr.begin(),vr.end()
#define vi vector<int>
#define vll vector<ll>
const int N = 1e5 + 10;

int in[60][N], cnt[60][N];

void excerpt(int E[])
{
    set<int> st;
    for (int i = 0; i < 100; ++i) st.insert(E[i]);
    int id = 0;
    pii mx = mp(-1, -1);
    for (int i = 0; i <= 55; ++i)
    {
        mp score = mp(0, 0);
        for (int x : st) score.fi += in[i][x];
        for (int j = 0; j < 100; ++j) score.se += cnt[i][E[j]];
        if (score > mx) id = i, mx = score;
    }
    id = language(id);
    for (int x : st) in[id][x] = 1;
    for (int i = 0; i < 100; ++i) cnt[id][E[i]]++;
}

/*int main()
{
    //freopen("ss.inp", "r", stdin);
    ios::sync_with_stdio(false);
    cin.tie(0);
    return 0;
}*/

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:27:12: error: expected ';' before 'score'
   27 |         mp score = mp(0, 0);
      |            ^~~~~
lang.cpp:27:28: error: statement cannot resolve address of overloaded function
   27 |         mp score = mp(0, 0);
      |                            ^
lang.cpp:28:26: error: 'score' was not declared in this scope
   28 |         for (int x : st) score.fi += in[i][x];
      |                          ^~~~~
lang.cpp:29:39: error: 'score' was not declared in this scope
   29 |         for (int j = 0; j < 100; ++j) score.se += cnt[i][E[j]];
      |                                       ^~~~~
lang.cpp:30:13: error: 'score' was not declared in this scope
   30 |         if (score > mx) id = i, mx = score;
      |             ^~~~~