#include "bits/stdc++.h"
using namespace std;
// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
/*
find my code templates at https://github.com/galencolin/cp-templates
also maybe subscribe please thanks
*/
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL);}
#define f first
#define s second
#define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
using ll = long long;
// using ll = int;
// #pragma warning("int")
//
using vl = vector<ll>;
using pl = pair<ll, ll>;
typedef long double ld;
typedef unsigned long long ull;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename num_t>
using ordered_set = tree<num_t, null_type, less<num_t>, rb_tree_tag, tree_order_statistics_node_update>;
// benq - print any container + pair
template<typename T, typename = void> struct is_iterable : false_type {};
template<typename T> struct is_iterable<T, void_t<decltype(begin(declval<T>())),decltype(end(declval<T>()))>> : true_type {};
template<typename T> typename enable_if<is_iterable<T>::value&&!is_same<T, string>::value,ostream&>::type operator<<(ostream &cout, T const &v);
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
template<typename T> typename enable_if<is_iterable<T>::value&&!is_same<T, string>::value,ostream&>::type operator<<(ostream &cout, T const &v) {
cout << "[";
for (auto it = v.begin(); it != v.end();) {
cout << *it;
if (++it != v.end()) cout << ", ";
}
return cout << "]";
}
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p) {
cin >> p.first;
return cin >> p.second;
}
template<typename T> void debug(string s, T x) {cerr << "\033[1;34m" << s << "\033[0;32m = \033[35m" << x << "\033[0m\n";}
template<typename T, typename... Args> void debug(string s, T x, Args... args) {for (int i=0, b=0; i<(int)s.size(); i++) if (s[i] == '(' || s[i] == '{') b++; else
if (s[i] == ')' || s[i] == '}') b--; else if (s[i] == ',' && b == 0) {cerr << "\033[1;34m" << s.substr(0, i) << "\033[0;32m = \033[35m" << x << "\033[31m | "; debug(s.substr(s.find_first_not_of(' ', i + 1)), args...); break;}}
template<typename T> void debug_nameless(T x) {cerr << "\033[35m" << x << "\033[0m\n";}
template<typename T, typename... Args> void debug_nameless(T x, Args... args) {cerr << "\033[35m" << x << "\033[31m | "; debug_nameless(args...);}
#ifdef galen_colin_local
#define pr(...) debug(#__VA_ARGS__, __VA_ARGS__)
#define prs(...) debug_nameless(__VA_ARGS__)
const bool local_ = true;
#else
#define pr(...) 135
#define prs(...) 135
const bool local_ = false;
#endif
mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
// mt19937_64 rng(61378913);
/* usage - just do rng() */
void usaco(string filename) {
// #pragma message("be careful, freopen may be wrong")
freopen((filename + ".in").c_str(), "r", stdin);
freopen((filename + ".out").c_str(), "w", stdout);
}
// #include <atcoder/all>
// using namespace atcoder;
const ld pi = 3.14159265358979323846;
// const ll mod = 1000000007;
// const ll mod = 998244353;
// ll mod;
ll n, m, q, k, l, r, x, y, z;
const ll template_array_size = 1e6 + 206171;
ll a[template_array_size];
ll b[template_array_size];
ll c[template_array_size];
string s, t;
ll res(vl c) {
vl a, b;
ll sa = 0, sb = 0;
ll t = 0;
for (ll x: c) {
t += x;
if (sa >= sb) {
b.push_back(x);
sb += x;
} else {
a.push_back(x);
sa += x;
}
}
reverse(b.begin(), b.end());
for (ll x: b) a.push_back(x);
pr(a, t);
ll s = t * (t + 1) / 2, r = 0;
for (ll x: a) r += x, s += r * (t - r);
return s;
}
const bool run = local_ ? 0 : 1;
void solve(int tc = 0) {
cin >> n >> q;
vl a(n);
for (ll &x: a) cin >> x, --x;
for (ll i = 0; i < q; i++) {
cin >> l >> r;
--l; --r;
vl c(n);
for (ll j = l; j <= r; j++) ++c[a[j]];
sort(c.rbegin(), c.rend());
while (c.back() == 0) c.pop_back();
reverse(c.begin(), c.end());
cout << res(c) << '\n';
}
}
int main() {
#ifdef galen_colin_local
auto begin = std::chrono::high_resolution_clock::now();
#endif
send help
#ifndef galen_colin_local
// usaco("evacuation");
#endif
// usaco("cowland");
// freopen("tc.cpp", "r", stdin);
// freopen("tc.cpp", "w", stdout);
// freopen("tc2.cpp", "w", stdout);
// freopen("in.txt", "r", stdin);
// freopen("out.txt", "w", stdout);
cout << setprecision(15) << fixed;
cerr << setprecision(4) << fixed;
int tc = 1;
// if (local_)
// if (!run)
// cin >> tc;
for (int t = 0; t < tc; t++) {
pr(t); prs(string(50, '-'));
solve(t);
prs(string(50, '-') + "\n");
}
#ifdef galen_colin_local
auto end = std::chrono::high_resolution_clock::now();
cerr << setprecision(4) << fixed;
cerr << "Execution time: " << std::chrono::duration_cast<std::chrono::duration<double>>(end - begin).count() << " seconds" << endl;
#endif
}
Compilation message
diversity.cpp: In function 'll res(vl)':
diversity.cpp:66:17: warning: statement has no effect [-Wunused-value]
66 | #define pr(...) 135
| ^~~
diversity.cpp:115:5: note: in expansion of macro 'pr'
115 | pr(a, t);
| ^~
diversity.cpp: In function 'int main()':
diversity.cpp:66:17: warning: statement has no effect [-Wunused-value]
66 | #define pr(...) 135
| ^~~
diversity.cpp:169:9: note: in expansion of macro 'pr'
169 | pr(t); prs(string(50, '-'));
| ^~
diversity.cpp:67:18: warning: statement has no effect [-Wunused-value]
67 | #define prs(...) 135
| ^~~
diversity.cpp:169:16: note: in expansion of macro 'prs'
169 | pr(t); prs(string(50, '-'));
| ^~~
diversity.cpp:67:18: warning: statement has no effect [-Wunused-value]
67 | #define prs(...) 135
| ^~~
diversity.cpp:171:9: note: in expansion of macro 'prs'
171 | prs(string(50, '-') + "\n");
| ^~~
diversity.cpp: In function 'void usaco(std::string)':
diversity.cpp:77:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
77 | freopen((filename + ".in").c_str(), "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diversity.cpp:78:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
78 | freopen((filename + ".out").c_str(), "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
6 ms |
2228 KB |
Output is correct |
5 |
Correct |
11 ms |
3948 KB |
Output is correct |
6 |
Correct |
17 ms |
5732 KB |
Output is correct |
7 |
Correct |
19 ms |
5780 KB |
Output is correct |
8 |
Correct |
18 ms |
5876 KB |
Output is correct |
9 |
Correct |
18 ms |
5724 KB |
Output is correct |
10 |
Correct |
17 ms |
5724 KB |
Output is correct |
11 |
Correct |
16 ms |
5724 KB |
Output is correct |
12 |
Correct |
19 ms |
5724 KB |
Output is correct |
13 |
Correct |
16 ms |
5720 KB |
Output is correct |
14 |
Correct |
19 ms |
5980 KB |
Output is correct |
15 |
Correct |
17 ms |
5724 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
6 ms |
2228 KB |
Output is correct |
5 |
Correct |
11 ms |
3948 KB |
Output is correct |
6 |
Correct |
17 ms |
5732 KB |
Output is correct |
7 |
Correct |
19 ms |
5780 KB |
Output is correct |
8 |
Correct |
18 ms |
5876 KB |
Output is correct |
9 |
Correct |
18 ms |
5724 KB |
Output is correct |
10 |
Correct |
17 ms |
5724 KB |
Output is correct |
11 |
Correct |
16 ms |
5724 KB |
Output is correct |
12 |
Correct |
19 ms |
5724 KB |
Output is correct |
13 |
Correct |
16 ms |
5720 KB |
Output is correct |
14 |
Correct |
19 ms |
5980 KB |
Output is correct |
15 |
Correct |
17 ms |
5724 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
1 ms |
600 KB |
Output is correct |
19 |
Correct |
6 ms |
2320 KB |
Output is correct |
20 |
Correct |
12 ms |
3924 KB |
Output is correct |
21 |
Correct |
17 ms |
5980 KB |
Output is correct |
22 |
Correct |
18 ms |
5916 KB |
Output is correct |
23 |
Correct |
17 ms |
5724 KB |
Output is correct |
24 |
Correct |
17 ms |
5720 KB |
Output is correct |
25 |
Correct |
17 ms |
5724 KB |
Output is correct |
26 |
Correct |
18 ms |
5724 KB |
Output is correct |
27 |
Correct |
18 ms |
5724 KB |
Output is correct |
28 |
Correct |
17 ms |
5720 KB |
Output is correct |
29 |
Correct |
18 ms |
5968 KB |
Output is correct |
30 |
Correct |
17 ms |
5724 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
6 ms |
2228 KB |
Output is correct |
5 |
Correct |
11 ms |
3948 KB |
Output is correct |
6 |
Correct |
17 ms |
5732 KB |
Output is correct |
7 |
Correct |
19 ms |
5780 KB |
Output is correct |
8 |
Correct |
18 ms |
5876 KB |
Output is correct |
9 |
Correct |
18 ms |
5724 KB |
Output is correct |
10 |
Correct |
17 ms |
5724 KB |
Output is correct |
11 |
Correct |
16 ms |
5724 KB |
Output is correct |
12 |
Correct |
19 ms |
5724 KB |
Output is correct |
13 |
Correct |
16 ms |
5720 KB |
Output is correct |
14 |
Correct |
19 ms |
5980 KB |
Output is correct |
15 |
Correct |
17 ms |
5724 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
1 ms |
600 KB |
Output is correct |
19 |
Correct |
6 ms |
2320 KB |
Output is correct |
20 |
Correct |
12 ms |
3924 KB |
Output is correct |
21 |
Correct |
17 ms |
5980 KB |
Output is correct |
22 |
Correct |
18 ms |
5916 KB |
Output is correct |
23 |
Correct |
17 ms |
5724 KB |
Output is correct |
24 |
Correct |
17 ms |
5720 KB |
Output is correct |
25 |
Correct |
17 ms |
5724 KB |
Output is correct |
26 |
Correct |
18 ms |
5724 KB |
Output is correct |
27 |
Correct |
18 ms |
5724 KB |
Output is correct |
28 |
Correct |
17 ms |
5720 KB |
Output is correct |
29 |
Correct |
18 ms |
5968 KB |
Output is correct |
30 |
Correct |
17 ms |
5724 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
604 KB |
Output is correct |
35 |
Correct |
1 ms |
604 KB |
Output is correct |
36 |
Correct |
1 ms |
480 KB |
Output is correct |
37 |
Correct |
3 ms |
1312 KB |
Output is correct |
38 |
Correct |
4 ms |
1372 KB |
Output is correct |
39 |
Correct |
6 ms |
2392 KB |
Output is correct |
40 |
Correct |
12 ms |
4184 KB |
Output is correct |
41 |
Correct |
19 ms |
6488 KB |
Output is correct |
42 |
Correct |
18 ms |
6228 KB |
Output is correct |
43 |
Correct |
18 ms |
6236 KB |
Output is correct |
44 |
Correct |
19 ms |
6140 KB |
Output is correct |
45 |
Correct |
19 ms |
6312 KB |
Output is correct |
46 |
Correct |
19 ms |
6236 KB |
Output is correct |
47 |
Correct |
19 ms |
6484 KB |
Output is correct |
48 |
Correct |
19 ms |
6248 KB |
Output is correct |
49 |
Correct |
24 ms |
6248 KB |
Output is correct |
50 |
Correct |
19 ms |
6236 KB |
Output is correct |
51 |
Correct |
24 ms |
6236 KB |
Output is correct |
52 |
Correct |
18 ms |
6296 KB |
Output is correct |
53 |
Correct |
18 ms |
6236 KB |
Output is correct |
54 |
Correct |
21 ms |
6260 KB |
Output is correct |
55 |
Correct |
19 ms |
6224 KB |
Output is correct |
56 |
Correct |
19 ms |
6232 KB |
Output is correct |
57 |
Correct |
20 ms |
6224 KB |
Output is correct |
58 |
Correct |
19 ms |
6236 KB |
Output is correct |
59 |
Correct |
20 ms |
6236 KB |
Output is correct |
60 |
Correct |
23 ms |
6236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
14 |
Correct |
6 ms |
2228 KB |
Output is correct |
15 |
Correct |
11 ms |
3948 KB |
Output is correct |
16 |
Correct |
17 ms |
5732 KB |
Output is correct |
17 |
Correct |
19 ms |
5780 KB |
Output is correct |
18 |
Correct |
18 ms |
5876 KB |
Output is correct |
19 |
Correct |
18 ms |
5724 KB |
Output is correct |
20 |
Correct |
17 ms |
5724 KB |
Output is correct |
21 |
Correct |
16 ms |
5724 KB |
Output is correct |
22 |
Correct |
19 ms |
5724 KB |
Output is correct |
23 |
Correct |
16 ms |
5720 KB |
Output is correct |
24 |
Correct |
19 ms |
5980 KB |
Output is correct |
25 |
Correct |
17 ms |
5724 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
344 KB |
Output is correct |
28 |
Correct |
1 ms |
600 KB |
Output is correct |
29 |
Correct |
6 ms |
2320 KB |
Output is correct |
30 |
Correct |
12 ms |
3924 KB |
Output is correct |
31 |
Correct |
17 ms |
5980 KB |
Output is correct |
32 |
Correct |
18 ms |
5916 KB |
Output is correct |
33 |
Correct |
17 ms |
5724 KB |
Output is correct |
34 |
Correct |
17 ms |
5720 KB |
Output is correct |
35 |
Correct |
17 ms |
5724 KB |
Output is correct |
36 |
Correct |
18 ms |
5724 KB |
Output is correct |
37 |
Correct |
18 ms |
5724 KB |
Output is correct |
38 |
Correct |
17 ms |
5720 KB |
Output is correct |
39 |
Correct |
18 ms |
5968 KB |
Output is correct |
40 |
Correct |
17 ms |
5724 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
604 KB |
Output is correct |
45 |
Correct |
1 ms |
604 KB |
Output is correct |
46 |
Correct |
1 ms |
480 KB |
Output is correct |
47 |
Correct |
3 ms |
1312 KB |
Output is correct |
48 |
Correct |
4 ms |
1372 KB |
Output is correct |
49 |
Correct |
6 ms |
2392 KB |
Output is correct |
50 |
Correct |
12 ms |
4184 KB |
Output is correct |
51 |
Correct |
19 ms |
6488 KB |
Output is correct |
52 |
Correct |
18 ms |
6228 KB |
Output is correct |
53 |
Correct |
18 ms |
6236 KB |
Output is correct |
54 |
Correct |
19 ms |
6140 KB |
Output is correct |
55 |
Correct |
19 ms |
6312 KB |
Output is correct |
56 |
Correct |
19 ms |
6236 KB |
Output is correct |
57 |
Correct |
19 ms |
6484 KB |
Output is correct |
58 |
Correct |
19 ms |
6248 KB |
Output is correct |
59 |
Correct |
24 ms |
6248 KB |
Output is correct |
60 |
Correct |
19 ms |
6236 KB |
Output is correct |
61 |
Correct |
24 ms |
6236 KB |
Output is correct |
62 |
Correct |
18 ms |
6296 KB |
Output is correct |
63 |
Correct |
18 ms |
6236 KB |
Output is correct |
64 |
Correct |
21 ms |
6260 KB |
Output is correct |
65 |
Correct |
19 ms |
6224 KB |
Output is correct |
66 |
Correct |
19 ms |
6232 KB |
Output is correct |
67 |
Correct |
20 ms |
6224 KB |
Output is correct |
68 |
Correct |
19 ms |
6236 KB |
Output is correct |
69 |
Correct |
20 ms |
6236 KB |
Output is correct |
70 |
Correct |
23 ms |
6236 KB |
Output is correct |
71 |
Correct |
4 ms |
1368 KB |
Output is correct |
72 |
Correct |
4 ms |
1372 KB |
Output is correct |
73 |
Correct |
4 ms |
1372 KB |
Output is correct |
74 |
Correct |
4 ms |
1496 KB |
Output is correct |
75 |
Correct |
4 ms |
1368 KB |
Output is correct |
76 |
Correct |
7 ms |
2648 KB |
Output is correct |
77 |
Correct |
7 ms |
2652 KB |
Output is correct |
78 |
Correct |
7 ms |
2660 KB |
Output is correct |
79 |
Correct |
8 ms |
2652 KB |
Output is correct |
80 |
Correct |
7 ms |
2652 KB |
Output is correct |
81 |
Correct |
15 ms |
4700 KB |
Output is correct |
82 |
Correct |
17 ms |
4688 KB |
Output is correct |
83 |
Correct |
14 ms |
4700 KB |
Output is correct |
84 |
Correct |
14 ms |
4716 KB |
Output is correct |
85 |
Correct |
14 ms |
4700 KB |
Output is correct |
86 |
Correct |
18 ms |
5352 KB |
Output is correct |
87 |
Correct |
16 ms |
5208 KB |
Output is correct |
88 |
Correct |
16 ms |
5212 KB |
Output is correct |
89 |
Correct |
16 ms |
5228 KB |
Output is correct |
90 |
Correct |
19 ms |
5212 KB |
Output is correct |
91 |
Correct |
24 ms |
9068 KB |
Output is correct |
92 |
Correct |
24 ms |
9324 KB |
Output is correct |
93 |
Correct |
25 ms |
9164 KB |
Output is correct |
94 |
Correct |
24 ms |
9160 KB |
Output is correct |
95 |
Correct |
29 ms |
9448 KB |
Output is correct |
96 |
Correct |
28 ms |
11452 KB |
Output is correct |
97 |
Correct |
31 ms |
11568 KB |
Output is correct |
98 |
Correct |
28 ms |
11452 KB |
Output is correct |
99 |
Correct |
28 ms |
11456 KB |
Output is correct |
100 |
Correct |
28 ms |
11488 KB |
Output is correct |
101 |
Correct |
27 ms |
11616 KB |
Output is correct |
102 |
Correct |
28 ms |
11456 KB |
Output is correct |
103 |
Correct |
27 ms |
11460 KB |
Output is correct |
104 |
Correct |
28 ms |
11456 KB |
Output is correct |
105 |
Correct |
28 ms |
11456 KB |
Output is correct |
106 |
Correct |
28 ms |
12220 KB |
Output is correct |
107 |
Correct |
28 ms |
12280 KB |
Output is correct |
108 |
Correct |
27 ms |
12228 KB |
Output is correct |
109 |
Correct |
29 ms |
12220 KB |
Output is correct |
110 |
Correct |
28 ms |
12232 KB |
Output is correct |
111 |
Correct |
27 ms |
12220 KB |
Output is correct |
112 |
Correct |
28 ms |
12224 KB |
Output is correct |
113 |
Correct |
28 ms |
12224 KB |
Output is correct |
114 |
Correct |
29 ms |
12224 KB |
Output is correct |
115 |
Correct |
28 ms |
12220 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
14 |
Correct |
6 ms |
2228 KB |
Output is correct |
15 |
Correct |
11 ms |
3948 KB |
Output is correct |
16 |
Correct |
17 ms |
5732 KB |
Output is correct |
17 |
Correct |
19 ms |
5780 KB |
Output is correct |
18 |
Correct |
18 ms |
5876 KB |
Output is correct |
19 |
Correct |
18 ms |
5724 KB |
Output is correct |
20 |
Correct |
17 ms |
5724 KB |
Output is correct |
21 |
Correct |
16 ms |
5724 KB |
Output is correct |
22 |
Correct |
19 ms |
5724 KB |
Output is correct |
23 |
Correct |
16 ms |
5720 KB |
Output is correct |
24 |
Correct |
19 ms |
5980 KB |
Output is correct |
25 |
Correct |
17 ms |
5724 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
344 KB |
Output is correct |
28 |
Correct |
1 ms |
600 KB |
Output is correct |
29 |
Correct |
6 ms |
2320 KB |
Output is correct |
30 |
Correct |
12 ms |
3924 KB |
Output is correct |
31 |
Correct |
17 ms |
5980 KB |
Output is correct |
32 |
Correct |
18 ms |
5916 KB |
Output is correct |
33 |
Correct |
17 ms |
5724 KB |
Output is correct |
34 |
Correct |
17 ms |
5720 KB |
Output is correct |
35 |
Correct |
17 ms |
5724 KB |
Output is correct |
36 |
Correct |
18 ms |
5724 KB |
Output is correct |
37 |
Correct |
18 ms |
5724 KB |
Output is correct |
38 |
Correct |
17 ms |
5720 KB |
Output is correct |
39 |
Correct |
18 ms |
5968 KB |
Output is correct |
40 |
Correct |
17 ms |
5724 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
604 KB |
Output is correct |
45 |
Correct |
1 ms |
604 KB |
Output is correct |
46 |
Correct |
1 ms |
480 KB |
Output is correct |
47 |
Correct |
3 ms |
1312 KB |
Output is correct |
48 |
Correct |
4 ms |
1372 KB |
Output is correct |
49 |
Correct |
6 ms |
2392 KB |
Output is correct |
50 |
Correct |
12 ms |
4184 KB |
Output is correct |
51 |
Correct |
19 ms |
6488 KB |
Output is correct |
52 |
Correct |
18 ms |
6228 KB |
Output is correct |
53 |
Correct |
18 ms |
6236 KB |
Output is correct |
54 |
Correct |
19 ms |
6140 KB |
Output is correct |
55 |
Correct |
19 ms |
6312 KB |
Output is correct |
56 |
Correct |
19 ms |
6236 KB |
Output is correct |
57 |
Correct |
19 ms |
6484 KB |
Output is correct |
58 |
Correct |
19 ms |
6248 KB |
Output is correct |
59 |
Correct |
24 ms |
6248 KB |
Output is correct |
60 |
Correct |
19 ms |
6236 KB |
Output is correct |
61 |
Correct |
24 ms |
6236 KB |
Output is correct |
62 |
Correct |
18 ms |
6296 KB |
Output is correct |
63 |
Correct |
18 ms |
6236 KB |
Output is correct |
64 |
Correct |
21 ms |
6260 KB |
Output is correct |
65 |
Correct |
19 ms |
6224 KB |
Output is correct |
66 |
Correct |
19 ms |
6232 KB |
Output is correct |
67 |
Correct |
20 ms |
6224 KB |
Output is correct |
68 |
Correct |
19 ms |
6236 KB |
Output is correct |
69 |
Correct |
20 ms |
6236 KB |
Output is correct |
70 |
Correct |
23 ms |
6236 KB |
Output is correct |
71 |
Correct |
4 ms |
1368 KB |
Output is correct |
72 |
Correct |
4 ms |
1372 KB |
Output is correct |
73 |
Correct |
4 ms |
1372 KB |
Output is correct |
74 |
Correct |
4 ms |
1496 KB |
Output is correct |
75 |
Correct |
4 ms |
1368 KB |
Output is correct |
76 |
Correct |
7 ms |
2648 KB |
Output is correct |
77 |
Correct |
7 ms |
2652 KB |
Output is correct |
78 |
Correct |
7 ms |
2660 KB |
Output is correct |
79 |
Correct |
8 ms |
2652 KB |
Output is correct |
80 |
Correct |
7 ms |
2652 KB |
Output is correct |
81 |
Correct |
15 ms |
4700 KB |
Output is correct |
82 |
Correct |
17 ms |
4688 KB |
Output is correct |
83 |
Correct |
14 ms |
4700 KB |
Output is correct |
84 |
Correct |
14 ms |
4716 KB |
Output is correct |
85 |
Correct |
14 ms |
4700 KB |
Output is correct |
86 |
Correct |
18 ms |
5352 KB |
Output is correct |
87 |
Correct |
16 ms |
5208 KB |
Output is correct |
88 |
Correct |
16 ms |
5212 KB |
Output is correct |
89 |
Correct |
16 ms |
5228 KB |
Output is correct |
90 |
Correct |
19 ms |
5212 KB |
Output is correct |
91 |
Correct |
24 ms |
9068 KB |
Output is correct |
92 |
Correct |
24 ms |
9324 KB |
Output is correct |
93 |
Correct |
25 ms |
9164 KB |
Output is correct |
94 |
Correct |
24 ms |
9160 KB |
Output is correct |
95 |
Correct |
29 ms |
9448 KB |
Output is correct |
96 |
Correct |
28 ms |
11452 KB |
Output is correct |
97 |
Correct |
31 ms |
11568 KB |
Output is correct |
98 |
Correct |
28 ms |
11452 KB |
Output is correct |
99 |
Correct |
28 ms |
11456 KB |
Output is correct |
100 |
Correct |
28 ms |
11488 KB |
Output is correct |
101 |
Correct |
27 ms |
11616 KB |
Output is correct |
102 |
Correct |
28 ms |
11456 KB |
Output is correct |
103 |
Correct |
27 ms |
11460 KB |
Output is correct |
104 |
Correct |
28 ms |
11456 KB |
Output is correct |
105 |
Correct |
28 ms |
11456 KB |
Output is correct |
106 |
Correct |
28 ms |
12220 KB |
Output is correct |
107 |
Correct |
28 ms |
12280 KB |
Output is correct |
108 |
Correct |
27 ms |
12228 KB |
Output is correct |
109 |
Correct |
29 ms |
12220 KB |
Output is correct |
110 |
Correct |
28 ms |
12232 KB |
Output is correct |
111 |
Correct |
27 ms |
12220 KB |
Output is correct |
112 |
Correct |
28 ms |
12224 KB |
Output is correct |
113 |
Correct |
28 ms |
12224 KB |
Output is correct |
114 |
Correct |
29 ms |
12224 KB |
Output is correct |
115 |
Correct |
28 ms |
12220 KB |
Output is correct |
116 |
Correct |
3822 ms |
1884 KB |
Output is correct |
117 |
Correct |
3877 ms |
1376 KB |
Output is correct |
118 |
Execution timed out |
7061 ms |
1940 KB |
Time limit exceeded |
119 |
Halted |
0 ms |
0 KB |
- |