Submission #443395

# Submission time Handle Problem Language Result Execution time Memory
443395 2021-07-10T12:47:53 Z leinad2 Fountain Parks (IOI21_parks) C++17
5 / 100
71 ms 8964 KB
#include "parks.h"
#include<bits/stdc++.h>
using namespace std;
int construct_roads(vector<int>x, vector<int>y)
{
    vector<pair<int, int> >V;
    int n, i, j, k;n=x.size();
    for(i=0;i<n;i++)V.push_back({y[i], i});
    sort(V.begin(), V.end());
    for(i=1;i<V.size();i++)if(V[i].first!=V[i-1].first+2)return 0;
    vector<int>u, v, a, b;
    for(i=1;i<V.size();i++)
    {
        u.push_back(V[i-1].second);
        v.push_back(V[i].second);
        a.push_back(1);
        b.push_back(V[i-1].first+1);
    }
    build(u, v, a, b);
    return 1;
}

Compilation message

parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:10:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |     for(i=1;i<V.size();i++)if(V[i].first!=V[i-1].first+2)return 0;
      |             ~^~~~~~~~~
parks.cpp:12:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for(i=1;i<V.size();i++)
      |             ~^~~~~~~~~
parks.cpp:7:15: warning: unused variable 'j' [-Wunused-variable]
    7 |     int n, i, j, k;n=x.size();
      |               ^
parks.cpp:7:18: warning: unused variable 'k' [-Wunused-variable]
    7 |     int n, i, j, k;n=x.size();
      |                  ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 68 ms 8964 KB Output is correct
10 Correct 7 ms 1148 KB Output is correct
11 Correct 38 ms 4836 KB Output is correct
12 Correct 9 ms 1580 KB Output is correct
13 Correct 10 ms 1900 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 68 ms 8904 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 68 ms 8964 KB Output is correct
10 Correct 7 ms 1148 KB Output is correct
11 Correct 38 ms 4836 KB Output is correct
12 Correct 9 ms 1580 KB Output is correct
13 Correct 10 ms 1900 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 68 ms 8904 KB Output is correct
17 Incorrect 1 ms 296 KB Solution announced impossible, but it is possible.
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 68 ms 8964 KB Output is correct
10 Correct 7 ms 1148 KB Output is correct
11 Correct 38 ms 4836 KB Output is correct
12 Correct 9 ms 1580 KB Output is correct
13 Correct 10 ms 1900 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 68 ms 8904 KB Output is correct
17 Incorrect 1 ms 296 KB Solution announced impossible, but it is possible.
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 68 ms 8964 KB Output is correct
10 Correct 7 ms 1148 KB Output is correct
11 Correct 38 ms 4836 KB Output is correct
12 Correct 9 ms 1580 KB Output is correct
13 Correct 10 ms 1900 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 68 ms 8904 KB Output is correct
17 Incorrect 1 ms 204 KB Solution announced impossible, but it is possible.
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 68 ms 8964 KB Output is correct
10 Correct 7 ms 1148 KB Output is correct
11 Correct 38 ms 4836 KB Output is correct
12 Correct 9 ms 1580 KB Output is correct
13 Correct 10 ms 1900 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 68 ms 8904 KB Output is correct
17 Incorrect 71 ms 7588 KB Solution announced impossible, but it is possible.
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 288 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 68 ms 8964 KB Output is correct
10 Correct 7 ms 1148 KB Output is correct
11 Correct 38 ms 4836 KB Output is correct
12 Correct 9 ms 1580 KB Output is correct
13 Correct 10 ms 1900 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 68 ms 8904 KB Output is correct
17 Incorrect 1 ms 296 KB Solution announced impossible, but it is possible.
18 Halted 0 ms 0 KB -