Submission #490422

#TimeUsernameProblemLanguageResultExecution timeMemory
490422mathking1021Languages (IOI10_languages)C++17
Compilation error
0 ms0 KiB
//#include <stdlib.h>
//#include <stdio.h>
//#include <cmath>
//#include <unordered_map>
//
//#include "grader.h"
//#include "lang.h"
//
//#define SZ 100
//
//using namespace std;
//
//typedef long long ll;
//
//const int M = 100;
//const int N = 2;
//const int K = 15;
//int a[65555][65];
//int y[65];
//unordered_map<ll, int> ma;
//int now = 1;
////int cnt = 0;
//
//void excerpt(int *E)
//{
////    int mx2 = -1, mi2 = 0;
////    for(int i = 0; i < 56; i++) y[i] = 0;
////    for(int i = 0; i < 100; i++)
////    {
////        int mx = -1, mi = 0, mx2 = -1;
////        for(int j = 0; j < 56; j++)
////        {
////            if(x[E[i]][j] > mx) mx = x[E[i]][j], mi = j;
////            else if(x[E[i]][j] > mx2) mx2 = x[E[i]][j];
////        }
////        y[mi] += M + N * sqrt(mx - mx2) + K * sqrt(sqrt(mx - mx2));
////    }
////    mx2 = -1;
////    for(int i = 0; i < 56; i++)
////    {
////        if(y[i] > mx2) mx2 = y[i], mi2 = i;
////    }
//    int mx = -1, mi = -1;
////    for(int i = 0; i < 56; i++)
////    {
////        int cnt = 0;
////        for(int j = 0; j < 1; j++)
////        {
////            ll t = E[j] * 65536LL * 65536LL + E[j + 1] * 65536LL + E[j + 2];
////            ll t2 = E[j + 1] * 65536LL + E[j + 2];
////            cnt += 5 * x.count(t * 100 + i);
////        }
////        for(int j = 5; j < 10; j++)
////        {
////            ll t = E[j] * 65536LL * 65536LL + E[j + 1] * 65536LL + E[j + 2];
////            ll t2 = E[j + 1] * 65536LL + E[j + 2];
////            cnt += 1 * x.count(t * 100 + i);
////        }
////        for(int j = 95; j < 100; j++)
////        {
////            ll t = E[j] * 65536LL * 65536LL + E[j + 1] * 65536LL + E[j + 2];
////            ll t2 = E[j + 1] * 65536LL + E[j + 2];
////            cnt += 1 * x.count(t * 100 + i);
////        }
////        if(mx < cnt) mx = cnt, mi = i;
////    }
//    ll cnt[59];
//    for(int i = 0; i < 56; i++) cnt[i] = 0;
//    for(int i = 0; i < 100; i++)
//    {
//        int mx1 = -1, mx2 = -1, mi = -1;
//        int mx3 = 1;
//        for(int j = 0; j < 56; j++)
//        {
//            mx3 += a[E[i]][j];
//            if(mx1 < a[E[i]][j]) mx2 = mx1, mx1 = a[E[i]][j], mi = j;
//            else if(mx2 < a[E[i]][j]) mx2 = a[E[i]][j];
//        }
//        cnt[mi] += (mx1 * 50 / (mx3)) * (mx1 * 50 / (mx3));
//        if(i == 99) break;
//        for(ll j = 0; j < 56; j++) cnt[j] += 70000 * (a[E[i]][j]) / now + 700000 * (ma[E[i] * 6553600 + E[i + 1] * 100 + j]) / now;
//    }
//    int mxx = -1, mii = 0;
//    for(int i = 0; i < 56; i++)
//    {
//        if(mxx < cnt[i]) mxx = cnt[i], mii = i;
//    }
//    int k = language(mii);
//    for(int i = 0; i < 100; i++)
//    {
////        ll t = E[i] * 65536ULL * 65536ULL + E[i + 1] * 65536ULL + E[i + 2];
////        x.insert(t * 100 + k);
////        ll t2 = E[i] * 65536LL + E[i + 1];
////        xxx.insert(t2 * 100 + k);
//        a[E[i]][k]++;
//        if(i < 99) ma[E[i] * 6553600 + E[i + 1] * 100 + k] += 1, now++;
//    }
////    cnt++;
//}
#include <stdlib.h>
#include <stdio.h>
//#include <cmath>
#include <set>
//#include <unordered_map>

#include "grader.h"
#include "lang.h"

#define SZ 100

using namespace std;

typedef unsigned long long ll;

const int M = 100;
const int N = 2;
const int K = 15;
//unordered_map<ll, int> x[57];
set<ll, int> x[57];
//map<pair<ll, int>, int> xxx;
//set<pair<ll, int>> x;
//set<pair<ll, int>> xxx;
//int y[65];
//int cnt = 0;
ll a[57][65555];

void excerpt(int *E)
{
//    int mx2 = -1, mi2 = 0;
//    for(int i = 0; i < 56; i++) y[i] = 0;
//    for(int i = 0; i < 100; i++)
//    {
//        int mx = -1, mi = 0, mx2 = -1;
//        for(int j = 0; j < 56; j++)
//        {
//            if(x[E[i]][j] > mx) mx = x[E[i]][j], mi = j;
//            else if(x[E[i]][j] > mx2) mx2 = x[E[i]][j];
//        }
//        y[mi] += M + N * sqrt(mx - mx2) + K * sqrt(sqrt(mx - mx2));
//    }
//    mx2 = -1;
//    for(int i = 0; i < 56; i++)
//    {
//        if(y[i] > mx2) mx2 = y[i], mi2 = i;
//    }
    int mx = -1, mi = -1;
    for(int i = 0; i < 56; i++)
    {
        int cnt = 0;
        for(int j = 0; j < 97; j++)
        {
            ll t = E[j] * 65536ULL * 65536ULL * 65536ULL + E[j + 1] * 65536ULL * 65536ULL + E[j + 2] * 65536ULL + E[j + 3];
           // ll t2 = E[j] * 65536ULL * 65536ULL + E[j + 1] * 65536ULL + E[j + 2];
            ll t2 = x[i].count(t);
//            ll t2 = x.count({t, i});
            cnt += (t2 > 0);// + xxx.count({t2, i});
            cnt += a[i][E[j]];
        }
        if(mx < cnt) mx = cnt, mi = i;

    }
    int k = language(mi);
    for(int i = 0; i < 97; i++)
    {
        ll t = E[i] * 65536ULL * 65536ULL * 65536ULL + E[i + 1] * 65536ULL * 65536ULL + E[i + 2] * 65536ULL + E[i + 3];
//        x[k][t] += 1;
        x[k].insert(t);
        //ll t2 = E[i] * 65536ULL * 65536ULL + E[i + 1] * 65536ULL + E[i + 2];
        //xxx.insert({t2, k});
        a[k][E[i]]++;
    }
//    cnt++;
}

Compilation message (stderr)

In file included from /usr/include/c++/10/set:60,
                 from lang.cpp:103:
/usr/include/c++/10/bits/stl_tree.h: In instantiation of 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::find(const _Key&) const [with _Key = long long unsigned int; _Val = long long unsigned int; _KeyOfValue = std::_Identity<long long unsigned int>; _Compare = int; _Alloc = std::allocator<long long unsigned int>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree<long long unsigned int, long long unsigned int, std::_Identity<long long unsigned int>, int, std::allocator<long long unsigned int> >::const_iterator]':
/usr/include/c++/10/bits/stl_set.h:749:25:   required from 'std::set<_Key, _Compare, _Alloc>::size_type std::set<_Key, _Compare, _Alloc>::count(const key_type&) const [with _Key = long long unsigned int; _Compare = int; _Alloc = std::allocator<long long unsigned int>; std::set<_Key, _Compare, _Alloc>::size_type = long unsigned int; std::set<_Key, _Compare, _Alloc>::key_type = long long unsigned int]'
lang.cpp:154:33:   required from here
/usr/include/c++/10/bits/stl_tree.h:2568:33: error: expression cannot be used as a function
 2568 |        || _M_impl._M_key_compare(__k,
      |           ~~~~~~~~~~~~~~~~~~~~~~^~~~~
 2569 |      _S_key(__j._M_node))) ? end() : __j;
      |      ~~~~~~~~~~~~~~~~~~~~        
/usr/include/c++/10/bits/stl_tree.h: In instantiation of 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_lower_bound(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Base_ptr, const _Key&) const [with _Key = long long unsigned int; _Val = long long unsigned int; _KeyOfValue = std::_Identity<long long unsigned int>; _Compare = int; _Alloc = std::allocator<long long unsigned int>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree<long long unsigned int, long long unsigned int, std::_Identity<long long unsigned int>, int, std::allocator<long long unsigned int> >::const_iterator; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type = const std::_Rb_tree_node<long long unsigned int>*; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Base_ptr = const std::_Rb_tree_node_base*]':
/usr/include/c++/10/bits/stl_tree.h:2566:42:   required from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::find(const _Key&) const [with _Key = long long unsigned int; _Val = long long unsigned int; _KeyOfValue = std::_Identity<long long unsigned int>; _Compare = int; _Alloc = std::allocator<long long unsigned int>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree<long long unsigned int, long long unsigned int, std::_Identity<long long unsigned int>, int, std::allocator<long long unsigned int> >::const_iterator]'
/usr/include/c++/10/bits/stl_set.h:749:25:   required from 'std::set<_Key, _Compare, _Alloc>::size_type std::set<_Key, _Compare, _Alloc>::count(const key_type&) const [with _Key = long long unsigned int; _Compare = int; _Alloc = std::allocator<long long unsigned int>; std::set<_Key, _Compare, _Alloc>::size_type = long unsigned int; std::set<_Key, _Compare, _Alloc>::key_type = long long unsigned int]'
lang.cpp:154:33:   required from here
/usr/include/c++/10/bits/stl_tree.h:1951:29: error: expression cannot be used as a function
 1951 |  if (!_M_impl._M_key_compare(_S_key(__x), __k))
      |       ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h: In instantiation of 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos(const key_type&) [with _Key = long long unsigned int; _Val = long long unsigned int; _KeyOfValue = std::_Identity<long long unsigned int>; _Compare = int; _Alloc = std::allocator<long long unsigned int>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::key_type = long long unsigned int]':
/usr/include/c++/10/bits/stl_tree.h:2154:4:   required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = const long long unsigned int&; _Key = long long unsigned int; _Val = long long unsigned int; _KeyOfValue = std::_Identity<long long unsigned int>; _Compare = int; _Alloc = std::allocator<long long unsigned int>]'
/usr/include/c++/10/bits/stl_set.h:512:25:   required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = long long unsigned int; _Compare = int; _Alloc = std::allocator<long long unsigned int>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<long long unsigned int, long long unsigned int, std::_Identity<long long unsigned int>, int, std::allocator<long long unsigned int> >::const_iterator; std::set<_Key, _Compare, _Alloc>::value_type = long long unsigned int]'
lang.cpp:167:22:   required from here
/usr/include/c++/10/bits/stl_tree.h:2101:35: error: expression cannot be used as a function
 2101 |    __comp = _M_impl._M_key_compare(__k, _S_key(__x));
      |             ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:2112:33: error: expression cannot be used as a function
 2112 |       if (_M_impl._M_key_compare(_S_key(__j._M_node), __k))
      |           ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h: In instantiation of 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr, _Arg&&, _NodeGen&) [with _Arg = const long long unsigned int&; _NodeGen = std::_Rb_tree<long long unsigned int, long long unsigned int, std::_Identity<long long unsigned int>, int, std::allocator<long long unsigned int> >::_Alloc_node; _Key = long long unsigned int; _Val = long long unsigned int; _KeyOfValue = std::_Identity<long long unsigned int>; _Compare = int; _Alloc = std::allocator<long long unsigned int>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree<long long unsigned int, long long unsigned int, std::_Identity<long long unsigned int>, int, std::allocator<long long unsigned int> >::iterator; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Base_ptr = std::_Rb_tree_node_base*]':
/usr/include/c++/10/bits/stl_tree.h:2159:26:   required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = const long long unsigned int&; _Key = long long unsigned int; _Val = long long unsigned int; _KeyOfValue = std::_Identity<long long unsigned int>; _Compare = int; _Alloc = std::allocator<long long unsigned int>]'
/usr/include/c++/10/bits/stl_set.h:512:25:   required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = long long unsigned int; _Compare = int; _Alloc = std::allocator<long long unsigned int>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<long long unsigned int, long long unsigned int, std::_Identity<long long unsigned int>, int, std::allocator<long long unsigned int> >::const_iterator; std::set<_Key, _Compare, _Alloc>::value_type = long long unsigned int]'
lang.cpp:167:22:   required from here
/usr/include/c++/10/bits/stl_tree.h:1813:35: error: expression cannot be used as a function
 1813 |          || _M_impl._M_key_compare(_KeyOfValue()(__v),
      |             ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
 1814 |        _S_key(__p)));
      |        ~~~~~~~~~~~~                
/usr/include/c++/10/bits/stl_tree.h: In instantiation of 'static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type) [with _Key = long long unsigned int; _Val = long long unsigned int; _KeyOfValue = std::_Identity<long long unsigned int>; _Compare = int; _Alloc = std::allocator<long long unsigned int>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type = const std::_Rb_tree_node<long long unsigned int>*]':
/usr/include/c++/10/bits/stl_tree.h:1951:36:   required from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_lower_bound(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Base_ptr, const _Key&) const [with _Key = long long unsigned int; _Val = long long unsigned int; _KeyOfValue = std::_Identity<long long unsigned int>; _Compare = int; _Alloc = std::allocator<long long unsigned int>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree<long long unsigned int, long long unsigned int, std::_Identity<long long unsigned int>, int, std::allocator<long long unsigned int> >::const_iterator; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type = const std::_Rb_tree_node<long long unsigned int>*; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Base_ptr = const std::_Rb_tree_node_base*]'
/usr/include/c++/10/bits/stl_tree.h:2566:42:   required from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::find(const _Key&) const [with _Key = long long unsigned int; _Val = long long unsigned int; _KeyOfValue = std::_Identity<long long unsigned int>; _Compare = int; _Alloc = std::allocator<long long unsigned int>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree<long long unsigned int, long long unsigned int, std::_Identity<long long unsigned int>, int, std::allocator<long long unsigned int> >::const_iterator]'
/usr/include/c++/10/bits/stl_set.h:749:25:   required from 'std::set<_Key, _Compare, _Alloc>::size_type std::set<_Key, _Compare, _Alloc>::count(const key_type&) const [with _Key = long long unsigned int; _Compare = int; _Alloc = std::allocator<long long unsigned int>; std::set<_Key, _Compare, _Alloc>::size_type = long unsigned int; std::set<_Key, _Compare, _Alloc>::key_type = long long unsigned int]'
lang.cpp:154:33:   required from here
/usr/include/c++/10/bits/stl_tree.h:772:16: error: static assertion failed: comparison object must be invocable with two arguments of key type
  772 |  static_assert(__is_invocable<_Compare&, const _Key&, const _Key&>{},
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~