CSES - Datatähti 2023 alku - Results
Submission details
Task:Ruudukko
Sender:finnish_guy
Submission time:2022-11-10 09:31:07 +0200
Language:C++11
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.01 s1, 2, 3details
#20.00 s1, 2, 3details
#30.00 s1, 2, 3details
#40.01 s2, 3details
#50.00 s2, 3details
#60.01 s2, 3details
#70.00 s3details
#80.01 s3details
#90.01 s3details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:29:19: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   29 |     else if(vec[7]=1 && vec[2]==1 && vec[0]==1){

Code

#include <iostream>
#include <cmath>
#include <math.h>
#include <vector>
using namespace std;

int main(){
    long long x, y=0;
    double z=0;
    vector<long long>vec(10);
    for(int i =0; i<=9; i++){
        cin >> x;
        vec[i] = x;
        y += x;
    }
    
    if(vec[2]==1 && vec[0]==0 && vec[4]==0){
        cout << 2 << "\n";
    }
    else if(vec[6]==1 && vec[0]==0){
        cout << 3 << "\n";
    }
    else if(vec[2]==1 && vec[4]==1 && vec[0]==0){
        cout << 4 << "\n";
    }
    else if(vec[1]== 1&&vec[2] == 1 && vec[0]==1){
        cout << 5 << "\n";
    }
    else if(vec[7]=1 && vec[2]==1 && vec[0]==1){
        cout << 6 << "\n";
    }
    else {
        for(long long i=1; i<=10*10*10*10*10; i++){
        //z = 1+floor(0.5*log10(2.0*M_PI*(double)i)+(double)i*log10((double)i/M_E)+(1.0/(12.0*(double)i))*log10(M_E)+(1/(12*i)-1/(360*i*i*i))*log10(M_E));
        z += log10((double)i);
        if(floor(z)+1 == y){
            cout << i << "\n";
            break;
        }
        if(floor(z) == y && i>10000){
            cout << i << "\n";
        }
        }
    }

}

Test details

Test 1

Group: 1, 2, 3

Verdict:

input
3
1 1 1
1 1 1
1 1 1

correct output
9

user output
(empty)

Test 2

Group: 1, 2, 3

Verdict:

input
3
1 2 3
6 5 4
7 8 9

correct output
135

user output
40

Test 3

Group: 1, 2, 3

Verdict:

input
3
7 8 1
4 5 4
3 9 6

correct output
57

user output
41

Test 4

Group: 2, 3

Verdict:

input
100
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

correct output
10000

user output
(empty)

Test 5

Group: 2, 3

Verdict:

input
100
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
187458477

user output
93

Test 6

Group: 2, 3

Verdict:

input
100
2995 8734 1018 2513 7971 5063 ...

correct output
964692694

user output
12587

Test 7

Group: 3

Verdict:

input
1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

correct output
1000000

user output
453

Test 8

Group: 3

Verdict:

input
1000
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
229147081

user output
(empty)

Test 9

Group: 3

Verdict:

input
1000
520283 805991 492643 75254 527...

correct output
951147313

user output
(empty)