Submission #15959432
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define contains(v, t) (find(v.begin(), v.end(), t) != v.end())
#define MOD 1000000007
using ll = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
int main() {
int n; cin >> n;
vector<int> v(n);
rep(i, n) {
cin >> v[i];
}
ll ans = 0;
for(int i = 0; i < n; i++) {
for(int j = i + 1; j < n; j++) {
for(int k = j + 1; k < n; k++) {
if (v[i] != v[j] && v[j] != v[k] && v[k] != v[i]) {
if (v[i] + v[j] > v[k] && v[j] + v[k] > v[i] && v[k] + v[i] > v[j]) ans++;
}
}
}
}
cout << ans;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Making Triangle |
| User | kebhr |
| Language | C++ (GCC 9.2.1) |
| Score | 200 |
| Code Size | 693 Byte |
| Status | AC |
| Exec Time | 6 ms |
| Memory | 3580 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | s1.txt, s2.txt, s3.txt, s4.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, s1.txt, s2.txt, s3.txt, s4.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 6 ms | 3432 KiB |
| 02.txt | AC | 3 ms | 3468 KiB |
| 03.txt | AC | 2 ms | 3432 KiB |
| 04.txt | AC | 3 ms | 3456 KiB |
| 05.txt | AC | 2 ms | 3456 KiB |
| 06.txt | AC | 4 ms | 3472 KiB |
| 07.txt | AC | 4 ms | 3368 KiB |
| 08.txt | AC | 3 ms | 3444 KiB |
| 09.txt | AC | 4 ms | 3580 KiB |
| 10.txt | AC | 4 ms | 3540 KiB |
| 11.txt | AC | 2 ms | 3528 KiB |
| 12.txt | AC | 3 ms | 3532 KiB |
| 13.txt | AC | 2 ms | 3496 KiB |
| 14.txt | AC | 4 ms | 3440 KiB |
| 15.txt | AC | 2 ms | 3440 KiB |
| 16.txt | AC | 3 ms | 3500 KiB |
| 17.txt | AC | 3 ms | 3500 KiB |
| 18.txt | AC | 4 ms | 3496 KiB |
| 19.txt | AC | 3 ms | 3444 KiB |
| s1.txt | AC | 2 ms | 3564 KiB |
| s2.txt | AC | 2 ms | 3496 KiB |
| s3.txt | AC | 3 ms | 3540 KiB |
| s4.txt | AC | 2 ms | 3440 KiB |