SUBMISSION #1011361
# Submission timeUTC+10 Handle Problem Language Result Execution time Memory
1011361 2024-06-30 22:24:36 Double_Slash Languages (IOI10_languages) C++17
0 / 100
10000 ms 7504 KB
lang
#include "lang.h"
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
#define debug(x) [&] { auto _x = x; cerr << __LINE__ << ": " << #x << " = " << _x << endl; return _x; }()
using pint = pair<int, int>;
double magic(double x) {
return pow(abs(x), 1.2);
}
template <typename T>
struct Data : map<T, int> {
int tot = 0;
double operator&(const Data<T> &o) const {
double ret = 0;
for (auto [k, v]: *this) {
ret += magic((double) v / tot - (o.count(k) ? (double) o.at(k) / o.tot : 0));
}
for (auto [k, v]: o) {
if (not this->count(k)) ret += magic((double) v / o.tot);
}
return ret;
}
void operator+=(const Data<T> &o) {
for (auto &[k, v]: o) {
(*this)[k] += v;
}
tot += o.tot;
}};
struct Profile {
Data<int> sing;
Data<pint> doub;
Profile() {}
Profile(int *arr) {
for (int i = 0; i < 100; ++i) {
sing[arr[i]]++;
if (i) doub[{arr[i - 1], arr[i]}]++;
}
sing.tot = 100;
doub.tot = 99;
}
double operator&(const Profile &o) const {
return (sing & o.sing);
}
void operator+=(const Profile &o) {
sing += o.sing;
}
} profile[56];
void excerpt(int *E) {
Profile p(E);
pair<double, int> mn{1e18, 0};
for (int i = 0; i < 56; ++i) {
mn = min(mn, {p & profile[i], i});
}
int ans = language(mn.second);
profile[ans] += p;
}
Compilation message
lang.cpp:1:12: error: stray '#' in program
1 | SUBMISSION #1011361
| ^
lang.cpp:2:3: error: invalid preprocessing directive #Submission
2 | # Submission timeUTC+10 Handle Problem Language Result Execution time Memory
| ^~~~~~~~~~
lang.cpp:1:1: error: 'SUBMISSION' does not name a type
1 | SUBMISSION #1011361
| ^~~~~~~~~~