답안 #204896

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
204896 2020-02-27T12:27:52 Z MetB Languages (IOI10_languages) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "grader.h"
#include "lang.h"

using namespace std;

int a[5][56][200000], b[5][200000];
int cnt[5][200000];
const int MOD = 199999;

void excerpt (int* E) {
    int n = 100;
    memset (cnt, 0, sizeof (cnt));
    std::set <int> s[5];
    
    for (int i = 0; i < 100; i++) {
        for (int j = 0; j < min (4, n - i); j++) {
            int val = 1;
            for (int k = 0; k <= j; k++)
                val = val * E[i+k] % MOD;
            cnt[j][val]++;
            s[j].insert (val);
        }
    }
    
    double mx = 0;
    int x = 0;
    
    for (int i = 0; i < 56; i++) {
        double points = 0;
        double mult = 1;
        for (int k = 0; k < 4; k++) {
            for (int j : s[k]) {
                if (b[k][j]) points += cnt[k][j] * ((double) a[k][i][j] / b[k][j]) * mult;
            }
            mult *= 3;
        }
        
        if (mx < points) {
            mx = points;
            x = i;
        }
    }
    
    x = language (x);
    
    for (int i = 0; i < 100; i++) {
        for (int j = 0; j < min (4, n - i); j++) {
            int val = 1;
            for (int k = 0; k <= j; k++)
                val = val * E[i+k] % MOD;
            a[j][x][val]++;
            b[j][val]++;
        }
    }
}#include <bits/stdc++.h>
#include "grader.h"
#include "lang.h"

using namespace std;

int a[5][56][200000], b[5][200000];
int cnt[5][200000];
const int MOD = 199999;

void excerpt (int* E) {
    int n = 100;
    memset (cnt, 0, sizeof (cnt));
    std::set <int> s[5];
    
    for (int i = 0; i < 100; i++) {
        for (int j = 0; j < min (4, n - i); j++) {
            int val = 1;
            for (int k = 0; k <= j; k++)
                val = val * E[i+k] % MOD;
            cnt[j][val]++;
            s[j].insert (val);
        }
    }
    
    double mx = 0;
    int x = 0;
    
    for (int i = 0; i < 56; i++) {
        double points = 0;
        double mult = 1;
        for (int k = 0; k < 4; k++) {
            for (int j : s[k]) {
                if (b[k][j]) points += cnt[k][j] * ((double) a[k][i][j] / b[k][j]) * mult;
            }
            mult *= 3;
        }
        
        if (mx < points) {
            mx = points;
            x = i;
        }
    }
    
    x = language (x);
    
    for (int i = 0; i < 100; i++) {
        for (int j = 0; j < min (4, n - i); j++) {
            int val = 1;
            for (int k = 0; k <= j; k++)
                val = val * E[i+k] % MOD;
            a[j][x][val]++;
            b[j][val]++;
        }
    }
}

Compilation message

lang.cpp:56:2: error: stray '#' in program
 }#include <bits/stdc++.h>
  ^
lang.cpp:56:3: error: 'include' does not name a type
 }#include <bits/stdc++.h>
   ^~~~~~~
lang.cpp:62:20: error: redefinition of 'int a [5][56][200000]'
 int a[5][56][200000], b[5][200000];
                    ^
lang.cpp:7:5: note: 'int a [5][56][200000]' previously declared here
 int a[5][56][200000], b[5][200000];
     ^
lang.cpp:62:34: error: redefinition of 'int b [5][200000]'
 int a[5][56][200000], b[5][200000];
                                  ^
lang.cpp:7:23: note: 'int b [5][200000]' previously declared here
 int a[5][56][200000], b[5][200000];
                       ^
lang.cpp:63:18: error: redefinition of 'int cnt [5][200000]'
 int cnt[5][200000];
                  ^
lang.cpp:8:5: note: 'int cnt [5][200000]' previously declared here
 int cnt[5][200000];
     ^~~
lang.cpp:64:11: error: redefinition of 'const int MOD'
 const int MOD = 199999;
           ^~~
lang.cpp:9:11: note: 'const int MOD' previously defined here
 const int MOD = 199999;
           ^~~
lang.cpp: In function 'void excerpt(int*)':
lang.cpp:66:6: error: redefinition of 'void excerpt(int*)'
 void excerpt (int* E) {
      ^~~~~~~
lang.cpp:11:6: note: 'void excerpt(int*)' previously defined here
 void excerpt (int* E) {
      ^~~~~~~