제출 #1078334

#제출 시각아이디문제언어결과실행 시간메모리
1078334Marco_Escandon마술쇼 (APIO24_show)C++17
0 / 100
6 ms2100 KiB
#include "Alice.h" #include <bits/stdc++.h> using namespace std; typedef int ll; std::vector<std::pair<int,int>> Alice(){ long long x = setN(5000); ll n=5000; map<pair<ll,ll>,ll> mapa; vector<pair<ll,ll>> temp; ll a=x/5000+1; ll b=x%5000+1; mapa[{a,b}]=1; mapa[{b,a}]=1; temp.push_back({a,b}); for(int i=1; i<=n; i++) { if(i!=a&&i<=n/2&&mapa[{i,a}]==0) temp.push_back({i,a}); if(i!=b&&i>n/2&&mapa[{i,b}]==0) temp.push_back({i,b}); mapa[{i,b}]=1; mapa[{i,a}]=1; mapa[{a,i}]=1; mapa[{b,i}]=1; } return temp; }
#include "Bob.h" #include <bits/stdc++.h> using namespace std; typedef int ll; long long Bob(std::vector<std::pair<int,int>> V){ vector<ll> v(5001,0); pair<ll,ll> a={0,0}; for(auto i:V) { v[i.first]++; v[i.second]++; a=max(max(make_pair(i.first,i.second),make_pair(i.second,i.first)),a); } pair<ll,ll> bs={0,0}; for(int i=0; i<5001; i++) { bs=max(make_pair(v[i],i),bs); } v[bs.second]=0; pair<ll,ll> bs2={0,0}; for(int i=0; i<5001; i++) { bs2=max(make_pair(v[i],i),bs2); } if(bs2.first==0) bs2=bs; if(a.second==bs.second||a.first==bs.second) swap(bs,bs2); return (bs.second-1)*5000+bs2.second-1; // change this into your code }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...