| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1364531 | activedeltorre | Triple Peaks (IOI25_triples) | C++20 | 2095 ms | 1960 KiB |
#include "triples.h"
#include <cassert>
#include <cstdio>
#include <vector>
#include <random>
#include <iostream>
using namespace std;
long long count_triples(std::vector<int> H)
{
int n=H.size(),hmax=0,z;
for(int i=1; i<=n; i++)
{
hmax=max(hmax,H[i-1]);
}
int cnt=0;
for(int i=1; i<=n; i++)
{
for(int j=i+1; j<=min(n,i+hmax); j++)
{
int j1=H[i-1];
int j2=H[j-1];
if(j1==j2)
{
z=j+j2;
if(z<=n)
{
if(j-i==j1 && H[z-1]==j1+j2)
{
cnt++;
}
}
}
else
{
if(j1<j2)
{
swap(j1,j2);
}
if(j2==j-i)
{
z=j+j1;
if(z<=n)
{
if(H[z-1]==j1+j2)
{
cnt++;
}
}
z=i+j1;
if(z<=n)
{
if(H[z-1]==z-j)
{
cnt++;
}
}
}
else if(j1==j-i)
{
z=j+j2;
if(z<=n)
{
if(H[z-1]==j1+j2)
{
cnt++;
}
}
}
else if(j1==j2+j-i)
{
z=i+j1;
if(z<=n)
{
if(H[z-1]==j-i)
{
cnt++;
}
}
}
}
}
}
return cnt;
}
int gas=0;
int arr[16]={1,1,3,2,3,4,1,2,1,3};
std::vector<int> construct_range(int M, int K)
{
vector<int>best;
for(int i=0; i<M; i++)
{
best.push_back(arr[i%10]);
}
//cout<<maxval<<'\n';
//bkt(0,M,K,maxval);
//cout<<count_triples(best)<<'\n';
return best;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
