# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
621340 | Bench0310 | 분수 공원 (IOI21_parks) | C++17 | 1939 ms | 92860 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "parks.h"
using namespace std;
typedef long long ll;
int construct_roads(vector<int> x,vector<int> y)
{
int n=x.size();
map<array<int,2>,int> id;
for(int i=0;i<n;i++) id[{x[i],y[i]}]=i;
map<array<int,2>,int> bench_id;
int m=0;
auto fountain_pos=[&](int a,int b)->int{return (id.find({a,b})!=id.end()?id[{a,b}]:-1);};
auto tp=[&](int a,int b)->int{return (((a+b)/2)&1);}; //color of chessboard at this bench
for(int i=0;i<n;i++)
{
int a=x[i],b=y[i];
if(fountain_pos(a+2,b)!=-1&&fountain_pos(a,b+2)!=-1&&fountain_pos(a+2,b+2)!=-1)
{
bench_id[{a+1,b+1}]=(++m);
}
}
auto bench_pos=[&](int a,int b)->int{return (bench_id.find({a,b})!=bench_id.end()?bench_id[{a,b}]:0);};
vector<array<int,3>> g[m+1]; //to,bad_a,bad_b
for(auto [p,bench]:bench_id)
{
auto [a,b]=p;
if(tp(a,b)==0)
{
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |