Submission #62050751
Source Code Expand
Copy
#include <bits/stdc++.h>#define ll long longusing namespace std;int main () {int n; cin >> n;double a[n];for (int i = 0; i < n; i++) {cin >> a[i];}double d = a[1] / a[0];for (int i = 0; i < n - 1; i++) {if (a[i] * d != a[i + 1]) {cout << "No\n"; return 0;}}
#include <bits/stdc++.h> #define ll long long using namespace std; int main () { int n; cin >> n; double a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } double d = a[1] / a[0]; for (int i = 0; i < n - 1; i++) { if (a[i] * d != a[i + 1]) { cout << "No\n"; return 0; } } cout << "Yes\n"; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Geometric Sequence |
User | NotPineapple26 |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 360 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3796 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
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, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
example_00.txt | AC | 1 ms | 3612 KB |
example_01.txt | AC | 1 ms | 3612 KB |
example_02.txt | AC | 1 ms | 3604 KB |
hand_00.txt | AC | 1 ms | 3596 KB |
hand_01.txt | AC | 1 ms | 3664 KB |
hand_02.txt | AC | 1 ms | 3612 KB |
hand_03.txt | AC | 1 ms | 3796 KB |
hand_04.txt | AC | 1 ms | 3604 KB |
hand_05.txt | AC | 1 ms | 3796 KB |
hand_06.txt | AC | 1 ms | 3640 KB |
hand_07.txt | AC | 1 ms | 3604 KB |
hand_08.txt | AC | 1 ms | 3576 KB |
hand_09.txt | AC | 1 ms | 3544 KB |
hand_10.txt | AC | 1 ms | 3672 KB |
hand_11.txt | AC | 1 ms | 3668 KB |
random_00.txt | AC | 1 ms | 3792 KB |
random_01.txt | AC | 1 ms | 3664 KB |
random_02.txt | AC | 1 ms | 3608 KB |
random_03.txt | AC | 1 ms | 3640 KB |
random_04.txt | AC | 1 ms | 3612 KB |
random_05.txt | AC | 1 ms | 3616 KB |
random_06.txt | AC | 1 ms | 3612 KB |
random_07.txt | AC | 1 ms | 3616 KB |
random_08.txt | AC | 1 ms | 3612 KB |
random_09.txt | AC | 1 ms | 3664 KB |
random_10.txt | AC | 1 ms | 3600 KB |
random_11.txt | AC | 1 ms | 3664 KB |
random_12.txt | AC | 1 ms | 3676 KB |
random_13.txt | AC | 1 ms | 3596 KB |
random_14.txt | AC | 1 ms | 3476 KB |