Submission #1034214

#TimeUsernameProblemLanguageResultExecution timeMemory
1034214vjudge1Diversity (CEOI21_diversity)C++17
0 / 100
0 ms604 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { int n, q; cin >> n >> q; vector<int> a(n); for (int i = 0; i < n; i++){ cin >> a[i]; } sort(a.begin(), a.end()); int ans = 0; while(q--){ int l, r; cin >> l >> r; l--; r--; for (int i = 0; i < n; i++){ set<int> val; for (int j = i; j < n; j++){ val.insert(a[j]); ans += val.size(); } } } cout << ans << endl; }
#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...