Submission #1010744

# Submission time Handle Problem Language Result Execution time Memory
1010744 2024-06-29T10:15:04 Z gaurezzz Comparing Plants (IOI20_plants) C++17
0 / 100
4000 ms 4944 KB
#include <bits/stdc++.h>

#define F first 
#define S second
#define ll long long
#define nd '\n'

using namespace std;

vector <int> plants;
ll n=0;

void init (int k, vector <int> r){

    plants = r;
    n = r.size();
}

int compare_plants(int x, int y){

    bool menor=1, mayor=1;

    for (ll i=x; i<y; i++){

        if (plants[i] != 1) mayor=0;
        else menor=0; 
    }

    if (mayor) return -1;
    else if (menor) return 1;

    mayor=1;
    menor=1;

    for (ll i=y; (i%n)!=x; i++){

        if (i == n) i=0;

        if (plants[i] != 1) mayor=0;
        else menor=0; 
    }

    if (mayor) return 1;
    else if (menor) return -1;
    else return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 35 ms 4032 KB Output is correct
7 Execution timed out 4080 ms 4944 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 35 ms 4032 KB Output is correct
7 Execution timed out 4080 ms 4944 KB Time limit exceeded
8 Halted 0 ms 0 KB -