Submission #971714

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9717142024-04-29 08:07:34SzilDiversity (CEOI21_diversity)C++14
100 / 100
6750 ms14944 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXN = 300'001;
const int BLOCK = 650;
struct Query {
int l, r, idx;
bool operator<(Query x) const {
if (l / BLOCK == x.l / BLOCK) return (l / BLOCK) & 1 ? r > x.r : r < x.r;
return l < x.l;
}
};
int a[MAXN], b[MAXN], c[BLOCK];
map<int, int> act;
ll ans[MAXN], negyzet[MAXN];
void inc(int v) {
if (b[v] < BLOCK) {
c[b[v]]++;
} else {
act[b[v]]++;
}
}
void dec(int v) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

diversity.cpp: In function 'int main()':
diversity.cpp:68:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   68 |     for (auto [nl, nr, idx] : qrys) {
      |               ^
diversity.cpp:85:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   85 |             auto [len, cnt] = *it;
      |                  ^
diversity.cpp:107:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  107 |             auto [len, cnt] = *it;
      |                  ^
diversity.cpp:121:19: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  121 |         for (auto [len, cnt] : dq) {
      |                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...