Task: | Conspiracies everywhere |
Sender: | Vaicode |
Submission time: | 2024-11-16 13:37:51 +0200 |
Language: | C++ (C++17) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | WRONG ANSWER | 0.00 s | details |
#6 | ACCEPTED | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | WRONG ANSWER | 0.00 s | details |
#11 | ACCEPTED | 0.00 s | details |
#12 | WRONG ANSWER | 0.00 s | details |
#13 | ACCEPTED | 0.00 s | details |
#14 | ACCEPTED | 0.00 s | details |
#15 | ACCEPTED | 0.00 s | details |
#16 | ACCEPTED | 0.00 s | details |
Compiler report
input/code.cpp: In function 'void next_layer(int)': input/code.cpp:21:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 21 | for (int j=1; j< layers[i-1].size()+1; j++) | ~^~~~~~~~~~~~~~~~~~~~~~
Code
#include<iostream> #include<vector> #include<cmath> #define ll long long int int n; ll q; using namespace std; vector<ll> layers[61]; void next_layer (int i) { ll first = layers[i-1][0]; ll a = first / 2; ll b = first - a; layers[i].push_back(max(a, b)); for (int j=1; j< layers[i-1].size()+1; j++) { ll square = layers[i-1][j-1] - layers[i][j-1]; // if (square <= 1 && i < n) layers[i].push_back(square); } }; int main() { cin >> n; cin >> q; layers[0].push_back(q); int l = 0; while (--n) next_layer(++l); for (auto k : layers[l]) { if (k == 0) {cout << "The truth is out there" << endl; return 0; } } for (auto k :layers[l]) cout << k << " "; cout << endl; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
3 8 |
correct output |
---|
5 1 1 |
user output |
---|
2 2 2 |
Test 2
Verdict: ACCEPTED
input |
---|
2 1 |
correct output |
---|
The truth is out there |
user output |
---|
The truth is out there |
Test 3
Verdict: ACCEPTED
input |
---|
1 1000000000000000000 |
correct output |
---|
1000000000000000000 |
user output |
---|
1000000000000000000 |
Test 4
Verdict: ACCEPTED
input |
---|
1 1 |
correct output |
---|
1 |
user output |
---|
1 |
Test 5
Verdict: WRONG ANSWER
input |
---|
60 1000000000000000000 |
correct output |
---|
423539247696576513 1 1 1 1 1 1... |
user output |
---|
The truth is out there |
Test 6
Verdict: ACCEPTED
input |
---|
10 512 |
correct output |
---|
1 1 1 1 1 1 1 1 1 1 |
user output |
---|
1 1 1 1 1 1 1 1 1 1 |
Test 7
Verdict: ACCEPTED
input |
---|
60 500000000000000000 |
correct output |
---|
The truth is out there |
user output |
---|
The truth is out there |
Test 8
Verdict: ACCEPTED
input |
---|
5 1000000000 |
correct output |
---|
999999985 1 1 1 1 |
user output |
---|
62500000 62500000 62500000 625... |
Test 9
Verdict: ACCEPTED
input |
---|
19 1000000000 |
correct output |
---|
999737857 1 1 1 1 1 1 1 1 1 1 ... |
user output |
---|
3815 3815 3814 3816 3813 3816 ... |
Test 10
Verdict: WRONG ANSWER
input |
---|
59 1000000000000000000 |
correct output |
---|
711769623848288257 1 1 1 1 1 1... |
user output |
---|
4 3 4 3 4 3 3 7 -7 27 -42 84 -... |
Test 11
Verdict: ACCEPTED
input |
---|
42 133713371337 |
correct output |
---|
The truth is out there |
user output |
---|
The truth is out there |
Test 12
Verdict: WRONG ANSWER
input |
---|
42 1337133713371337 |
correct output |
---|
1334934690115786 1 1 1 1 1 1 1... |
user output |
---|
609 608 608 608 608 609 605 61... |
Test 13
Verdict: ACCEPTED
input |
---|
2 2 |
correct output |
---|
1 1 |
user output |
---|
1 1 |
Test 14
Verdict: ACCEPTED
input |
---|
2 1000000000000000000 |
correct output |
---|
999999999999999999 1 |
user output |
---|
500000000000000000 50000000000... |
Test 15
Verdict: ACCEPTED
input |
---|
10 511 |
correct output |
---|
The truth is out there |
user output |
---|
The truth is out there |
Test 16
Verdict: ACCEPTED
input |
---|
10 513 |
correct output |
---|
2 1 1 1 1 1 1 1 1 1 |
user output |
---|
2 1 1 1 1 1 1 1 1 1 |