Submission #524931

#TimeUsernameProblemLanguageResultExecution timeMemory
524931ZielDiversity (CEOI21_diversity)C++17
0 / 100
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; #define sz(x) (int)x.size() signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n, q; cin >> n >> q; vector<int> a(n + 1); for (int i = 1; i <= n; i++) { cin >> a[i]; } int _, __; cin >> _ >> __; sort(a.begin() + 1, a.end()); ll cur = 0; for (int l = 1; l <= n; l++) { set<int> s; for (int r = l; r <= n; r++) { s.insert(a[r]); cur += sz(s); } } cout << cur; return 0; }
#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...