CSES - HIIT Open 2024 - Results
Submission details
Task:Conspiracies everywhere
Sender:CPLX
Submission time:2024-11-16 12:48:35 +0200
Language:C++ (C++17)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.00 sdetails
#2ACCEPTED0.00 sdetails
#3--details
#4ACCEPTED0.00 sdetails
#5--details
#6ACCEPTED0.00 sdetails
#7ACCEPTED0.00 sdetails
#8--details
#9--details
#10--details
#11ACCEPTED0.00 sdetails
#12--details
#13ACCEPTED0.00 sdetails
#14--details
#15ACCEPTED0.00 sdetails
#16ACCEPTED0.00 sdetails

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:27:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |         for(int l=0; l<sol[i].size(); l++) sol[i][l] = 2* sol[i+1][0];
      |                      ~^~~~~~~~~~~~~~
input/code.cpp:39:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |     for(int i=0; i<sol[sol.size()-1].size(); i++){
      |                  ~^~~~~~~~~~~~~~~~~~~~~~~~~
input/code.cpp:41:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |         if(i!=sol[sol.size()-1].size()-1) cout <<" ";
      |            ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Code

#include <bits/stdc++.h>
#include <limits>
using namespace std;

typedef long long ll;


int main() {

    vector<ll> vec(61);
    for(int i=0; i<61; i++){

        if(i==0)vec[i]=0;
        else{
            vec[i] = vec[i-1] + i +1;
        }
    }

    ll a,b;
    cin >> a >> b;
    vector<vector<ll>> sol;
    for(int i=1; i<=a; i++){
        vector<ll> temp(i,1);
        sol.push_back(temp);
    }
    for(int i=sol.size()-2; i>=0; i--){
        for(int l=0; l<sol[i].size(); l++) sol[i][l] = 2* sol[i+1][0];
    }
    if(sol[0][0]>b){
        cout <<"The truth is out there"<<endl;
        return 0;
    }
    while(sol[0][0]!=b){
        for(int i=sol.size()-1; i>=0; i--){
            sol[i][0] += 1;
            }
    }

    for(int i=0; i<sol[sol.size()-1].size(); i++){
        cout << sol[sol.size()-1][i];
        if(i!=sol[sol.size()-1].size()-1) cout <<" ";
    }
    cout << endl;

    


}

Test details

Test 1

Verdict: ACCEPTED

input
3 8

correct output
5 1 1

user output
5 1 1

Test 2

Verdict: ACCEPTED

input
2 1

correct output
The truth is out there

user output
The truth is out there

Test 3

Verdict:

input
1 1000000000000000000

correct output
1000000000000000000

user output
(empty)

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: 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:

input
5 1000000000

correct output
999999985 1 1 1 1

user output
(empty)

Test 9

Verdict:

input
19 1000000000

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

user output
(empty)

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
(empty)

Test 13

Verdict: ACCEPTED

input
2 2

correct output
1 1

user output
1 1

Test 14

Verdict:

input
2 1000000000000000000

correct output
999999999999999999 1

user output
(empty)

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