Submission #31199912
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<long long> A(N);
map<long long, long long> MA;
for (int i=0; i<N; ++i){
cin >> A.at(i);
if (MA.count(A.at(i))){
MA[A.at(i)] = MA.at(A.at(i)) + 1;
}
else{
MA[A.at(i)] = 1;
}
}
int count = 0;
int tajudo = 1;
for (int i=0; i<N; ++i){
for (int j=i; j<N; ++j){
if (MA.count(A.at(i)*A.at(j))){
if (i==j){
tajudo = 1;
}
else{
tajudo = 2;
}
count += (tajudo * MA.at( A.at(i)*A.at(j) ));
}
}
}
cout << count;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | D - Index Trio |
| User | nullpoint |
| Language | C++ (GCC 9.2.1) |
| Score | 0 |
| Code Size | 680 Byte |
| Status | TLE |
| Exec Time | 2206 ms |
| Memory | 17216 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 400 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example_00.txt, example_01.txt, example_02.txt |
| All | example_00.txt, example_01.txt, example_02.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example_00.txt | AC | 15 ms | 3532 KiB |
| example_01.txt | AC | 2 ms | 3368 KiB |
| example_02.txt | AC | 2 ms | 3316 KiB |
| test_00.txt | TLE | 2205 ms | 4960 KiB |
| test_01.txt | TLE | 2206 ms | 17216 KiB |
| test_02.txt | TLE | 2205 ms | 9904 KiB |
| test_03.txt | TLE | 2205 ms | 7520 KiB |
| test_04.txt | AC | 1944 ms | 4972 KiB |
| test_05.txt | TLE | 2205 ms | 7392 KiB |
| test_06.txt | TLE | 2206 ms | 11040 KiB |
| test_07.txt | TLE | 2205 ms | 3792 KiB |
| test_08.txt | TLE | 2205 ms | 4444 KiB |
| test_09.txt | TLE | 2205 ms | 3852 KiB |
| test_10.txt | TLE | 2205 ms | 3692 KiB |
| test_11.txt | AC | 523 ms | 3536 KiB |
| test_12.txt | TLE | 2205 ms | 4948 KiB |
| test_13.txt | TLE | 2205 ms | 4852 KiB |
| test_14.txt | TLE | 2205 ms | 4784 KiB |
| test_15.txt | TLE | 2205 ms | 4808 KiB |
| test_16.txt | TLE | 2205 ms | 4824 KiB |