CSES - HIIT Open 2024 - Results
Submission details
Task:Conspiracies everywhere
Sender:Orangutans
Submission time:2024-11-16 16:40:32 +0200
Language:C++ (C++17)
Status:READY
Result:
Test results
testverdicttime
#10.00 sdetails
#2ACCEPTED0.00 sdetails
#3ACCEPTED0.00 sdetails
#4ACCEPTED0.00 sdetails
#5--details
#60.00 sdetails
#7--details
#80.00 sdetails
#90.00 sdetails
#10--details
#11ACCEPTED0.01 sdetails
#120.49 sdetails
#130.00 sdetails
#140.00 sdetails
#15ACCEPTED0.00 sdetails
#160.00 sdetails

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:43:32: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |         for (long long i = 0; i< piramide[n-1].size(); ++i)
      |                               ~^~~~~~~~~~~~~~~~~~~~~~

Code

#include <vector>
#include <string>
#include <iostream>
#include <cmath>
 
using namespace std;


int main(){

    long long n, m; 
    cin >> n >> m;
    vector<vector<long long> > piramide = vector<vector<long long> > (n, vector<long long>(n, -1));

    piramide[0][0] = m;

    for (long long i =1; i < n; ++i){
        if (piramide[i][0] == -1)
            piramide[i][0] = piramide[i-1][0]/2;
        if (piramide[i][0] < 1)
        {
            cout << "The truth is out there"<< endl;
            exit(0);
        }

        for (long long j = 1; j <= i; ++j){
            piramide[i][j] = piramide[i-1][j-1] - piramide[i][j-1];
            if (piramide[i][j] < 1)
            {
                if (i == 0){
                    cout << "The truth is out there"<< endl;
                    exit(0);
                }
                else{
                    piramide[i-1][0]--;
                    i -= 2;
                    break;
                }
            }
        }
    }
    for (long long k = 0; k < n; ++k){
        for (long long i = 0; i< piramide[n-1].size(); ++i)
        {
            cout << piramide[k][i];
            if (i != n-1)
                cout << " ";
        }
        cout << endl;
    }
}   

Test details

Test 1

Verdict:

input
3 8

correct output
5 1 1

user output
8 -1 -1
4 4 -1
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:

input
60 1000000000000000000

correct output
423539247696576513 1 1 1 1 1 1...

user output
(empty)

Test 6

Verdict:

input
10 512

correct output
1 1 1 1 1 1 1 1 1 1

user output
512 -1 -1 -1 -1 -1 -1 -1 -1 -1
256 256 -1 -1 -1 -1 -1 -1 -1 -...

Test 7

Verdict:

input
60 500000000000000000

correct output
The truth is out there

user output
(empty)

Test 8

Verdict:

input
5 1000000000

correct output
999999985 1 1 1 1

user output
1000000000 -1 -1 -1 -1
500000000 500000000 -1 -1 -1
250000000 250000000 250000000 ...

Test 9

Verdict:

input
19 1000000000

correct output
999737857 1 1 1 1 1 1 1 1 1 1 ...

user output
The truth is out there

Test 10

Verdict:

input
59 1000000000000000000

correct output
711769623848288257 1 1 1 1 1 1...

user output
(empty)

Test 11

Verdict: ACCEPTED

input
42 133713371337

correct output
The truth is out there

user output
The truth is out there

Test 12

Verdict:

input
42 1337133713371337

correct output
1334934690115786 1 1 1 1 1 1 1...

user output
The truth is out there

Test 13

Verdict:

input
2 2

correct output
1 1

user output
2 -1
1 1

Test 14

Verdict:

input
2 1000000000000000000

correct output
999999999999999999 1

user output
1000000000000000000 -1
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:

input
10 513

correct output
2 1 1 1 1 1 1 1 1 1

user output
513 -1 -1 -1 -1 -1 -1 -1 -1 -1
256 257 -1 -1 -1 -1 -1 -1 -1 -...