Submission #1253228

#TimeUsernameProblemLanguageResultExecution timeMemory
1253228hectormedranoTriple Peaks (IOI25_triples)C++20
18 / 100
2096 ms1864 KiB
#include "triples.h"
#include <bits/stdc++.h>
using namespace std;

long long count_triples(vector<int> H) {
	long long d = 0;
	int N = H.size();
	for (int i = 0;i < N;i++) {
		for (int j = i + 1;j < N;j++) {
			for (int k = j + 1;k < N;k++) {
				int a = j - i;
					int b = k - i;
					int c = k - j;
				if (H[i] == a and H[j] == b and H[k] == c) { d++; continue;}
				if (H[i] == a and H[j] == c and H[k] == b) { d++; continue;}
				if (H[i] == b and H[j] == a and H[k] == c) { d++; continue;}
				if (H[i] == b and H[j] == c and H[k] == a) { d++; continue;}
				if (H[i] == c and H[j] == a and H[k] == b) { d++; continue;}
				if (H[i] == c and H[j] == b and H[k] == a) { d++; continue;}
			}
		}
	}
  return d;
}

std::vector<int> construct_range(int M, int K) {
  return {1, 1, 1};
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...