| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 300377 | daniel920712 | 식물 비교 (IOI20_plants) | C++14 | 0 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "plants.h"
#include <stdio.h>
#include <vector>
#include <utility>
using namespace std;
pair < int , int > con[100005];
vector < int > all;
int n;
void init(int k,vector<int> r)
{
int a=0,b=0,i,j,ok=0;
all=r;
for(i=0;ok==0;i++)
{
b=0;
if(r[(i+k-1)%k]!=r[i])
{
b=0;
a++;
for(j=i;r[j]==r[i];j=(j+1)%k)
{
if(j==k-1) ok=1;
con[j]=make_pair(a,b);
b++;
}
i=(j+k-1)%k;
}
}
n=k;
return;
}
int compare_plants(int x, int y)
{
if(con[x].first==con[(y+n-1)%n].first)
{
if(all[x]==0) return -1;
return 1;
}
if(con[y].first==con[(x+n-1)%n].first)
{
if(all[y]==0) return 1;
return -1;
}
return 0;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
