# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
575000 | Valters07 | Finding Routers (IOI20_routers) | C++14 | 4 ms | 660 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "routers.h"
#pragma GCC optimize("O2,unroll-loops")
#define fio ios_base::sync_with_stdio(0);cin.tie(0);
#define ll long long
#define en cin.close();return 0;
#define pb push_back
#define fi first//printf("%lli\n",cur);
#define se second//scanf("%lli",&n);
#define r0 return 0;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<int> find_routers(int len, int n, int q)
{
vector<int> ans(n);
int idx = 0, lst = 0, sq = sqrt(n);
map<int,int> mp;
for(int i = 1;i<n;i++)
{
int l = lst+1, r = len;
if(n!=2){
while(l+sq<r)
{
int pos = l+sq, ind = (mp.count(pos)?mp[pos]:use_detector(pos));
mp[pos]=ind;
if(ind==idx)
l=pos;
else
{
r=pos;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |