Problem 1: 2263C1 - Floor of MEX (Easy Version)
$$$O(n^2)$$$ solution: 390532511
Code
Problem 2: 2269C - K Is Important
$$$O(n^2)$$$ solution: 392233470
Code
The reason? Because of $$$n \le 10^5$$$, not $$$2 \cdot 10^5$$$
| # | User | Rating |
|---|---|---|
| 1 | jiangly | 3810 |
| 2 | Benq | 3676 |
| 3 | Kevin114514 | 3655 |
| 4 | maroonrk | 3463 |
| 5 | strapple | 3390 |
| 6 | Um_nik | 3387 |
| 7 | tourist | 3384 |
| 8 | heuristica | 3322 |
| 9 | turmax | 3319 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 156 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | Um_nik | 144 |
| 5 | Errichto | 139 |
| 6 | AmShZ | 138 |
| 7 | adamant | 137 |
| 8 | maroonrk | 133 |
| 9 | BledDest | 132 |
| 10 | qwexd | 129 |
The n <= 1e5 situtation is CRAZY!
Problem 1: 2263C1 - Floor of MEX (Easy Version)
$$$O(n^2)$$$ solution: 390532511
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, n) for (ll i = 1; i <= n; i++)
ll inf = 1e18 + 67;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;
cin >> t;
while (t--)
{
/*
OBSERVATIONS:
always equal to their sum
*/
ll n;cin>>n;vector<ll>a(n+1);f(i,n)cin>>a[i];
vector<ll>marked(n+1);
f(i,n){
ll l=a[i]*i;
ll r=min(n-1,a[i]*i + i-1);
for(int j=l;j<=r;j++){
marked[j]=true;
}
}
vector<ll>b;
for(int i=0;i<n;i++){
if(!marked[i])b.push_back(i);
}
// cout<<124<<endl;
cout<<b.size()<<endl;
for(auto x:b)cout<<x<<" ";
cout<<endl;
}
}
Problem 2: 2269C - K Is Important
$$$O(n^2)$$$ solution: 392233470
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, k;
cin >> n >> k;
vector<long long> a(n);
for (auto &x : a) cin >> x;
long long ans = 0;
while (a.size() >= k) {
int m = a.size();
if (a[k - 1] >= a[m - k]) {
ans += a[k - 1];
a.erase(a.begin() + k - 1);
} else {
ans += a[m - k];
a.erase(a.begin() + m - k);
}
}
cout << ans <<endl;
}
}
The reason? Because of $$$n \le 10^5$$$, not $$$2 \cdot 10^5$$$
| Rev. | Lang. | By | When | Δ | Comment | |
|---|---|---|---|---|---|---|
| en3 |
|
potatoArmy | 2026-09-27 06:38:58 | 30 | Tiny change: '\n\n[user:CutS' -> '\n\n[user:kondasujay2] [user:CutS' | |
| en2 |
|
potatoArmy | 2026-09-27 06:37:48 | 279 | (published) | |
| en1 |
|
potatoArmy | 2026-09-27 06:34:52 | 1900 | Initial revision (saved to drafts) |
| Name |
|---|


