| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1370395 | ElayV13 | Gift Boxes (EGOI25_giftboxes) | C++20 | 2095 ms | 63332 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int INF=1e18;
void solve(){
int tcnt,n;
cin>>tcnt>>n;
vector<int>a(n);
for(int i=0;i<n;i++)
{
cin>>a[i];
}
int l=-1;
map<int,int>mp;
for(int i=0;i<n;i++)
{
mp[a[i]]++;
if(mp[a[i]]==2)
{
l=i;
break;
}
}
for(int i=l;i<n;i++)
{
bool f=1;
map<int,int>cnt;
for(int j=i+1;j<n;j++)
{
cnt[a[j]]++;
if(cnt[a[j]]==2) f=0;
if(mp[a[j]]) f=0;
}
if(f)
{
cout<<l<<' '<<i<<endl;
return;
}
}
cout<<l<<' '<<l<<endl;
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int T=1;//cin>>T;
while(T--) solve();
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
