Task: | Tekijät |
Sender: | AtskaFin |
Submission time: | 2020-11-06 19:43:50 +0200 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 12 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 12 |
#2 | TIME LIMIT EXCEEDED | 0 |
#3 | TIME LIMIT EXCEEDED | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#2 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#3 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
#4 | TIME LIMIT EXCEEDED | -- | 3 | details |
#5 | TIME LIMIT EXCEEDED | -- | 3 | details |
#6 | TIME LIMIT EXCEEDED | -- | 3 | details |
#7 | TIME LIMIT EXCEEDED | -- | 3 | details |
Code
#include <iostream> #include <vector> using namespace std; int n; vector<int> v; int syt(int a, int b) { if (b == 0) return a; else return syt(b, a%b); } int main() { cin >> n; v.resize(n); for (auto& i : v) cin >> i; int c = 0; for (int i = 0; i < n; i++) { for (int j = i+1; j < n; j++) { if (syt(v[i], v[j]) == 1) c++; } } cout << c << "\n"; }
Test details
Test 1
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
100 1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
correct output |
---|
3043 |
user output |
---|
3043 |
Test 2
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
100 71 19 26 18 57 78 80 89 31 26 ... |
correct output |
---|
3086 |
user output |
---|
3086 |
Test 3
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 66 87 90 67 93 89 57 29 34 4 8... |
correct output |
---|
3044751906 |
user output |
---|
(empty) |
Test 4
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
correct output |
---|
3039650753 |
user output |
---|
(empty) |
Test 5
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 238907 151373 522599 885657 37... |
correct output |
---|
3031155756 |
user output |
---|
(empty) |
Test 6
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 510510 510510 510510 510510 51... |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 7
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 999983 999983 999983 999983 99... |
correct output |
---|
0 |
user output |
---|
(empty) |