| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1364431 | activedeltorre | Triple Peaks (IOI25_triples) | C++20 | 9 ms | 1860 KiB |
#include "triples.h"
#include <cassert>
#include <cstdio>
#include <vector>
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++)
{
int j=i-H[i-1];
if(j>=1)
{
int z=j+H[j-1];
if(z+H[z-1]==i)
{
cnt++;
}
}
}
return cnt;
}
std::vector<int> construct_range(int M, int K)
{
vector<int>rasp;
for(int i=0; i<M; i++)
{
if(i%3==1)
rasp.push_back(2);
else
rasp.push_back(1);
}
return rasp;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
