Submission #320887

# Submission time Handle Problem Language Result Execution time Memory
320887 2020-11-10T07:02:25 Z egas Pilot (NOI19_pilot) C++14
40 / 100
1000 ms 10860 KB
#include <bits/stdc++.h>

using namespace std;

int32_t main() {

    ios_base::sync_with_stdio(false);

    cin.tie(0);

    long long n;

    cin >> n;

    long long m;

    cin >> m;

    vector<long long> a(n);

    for(long long i = 0 ; i < n ; i++) {

        cin >> a[i];

    }

    vector<long long> b(m);

    for(long long i = 0 ; i < m ; i++) {

        cin >> b[i];

    }

    vector<long long> diff(1000005,0);

    for(long long i = 0 ; i < a.size() ; i++) {

        long long maxi=0;

        for(long long j=i; j<a.size(); j++) {

            maxi=max(maxi,a[j]);

            diff[maxi]++;

        }

    }

    for(long long i=1; i<diff.size(); i++) {

        diff[i]+=diff[i-1];

    }

    for(long long i = 0 ; i < b.size() ; i++) {

        cout << diff[b[i]] << '\n';

    }

    return 0;

}

Compilation message

pilot.cpp: In function 'int32_t main()':
pilot.cpp:37:29: 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]
   37 |     for(long long i = 0 ; i < a.size() ; i++) {
      |                           ~~^~~~~~~~~~
pilot.cpp:41:29: 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]
   41 |         for(long long j=i; j<a.size(); j++) {
      |                            ~^~~~~~~~~
pilot.cpp:51:25: 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]
   51 |     for(long long i=1; i<diff.size(); i++) {
      |                        ~^~~~~~~~~~~~
pilot.cpp:57:29: 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]
   57 |     for(long long i = 0 ; i < b.size() ; i++) {
      |                           ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 8 ms 8172 KB Output is correct
2 Correct 8 ms 8192 KB Output is correct
3 Correct 8 ms 8172 KB Output is correct
4 Correct 8 ms 8172 KB Output is correct
5 Correct 8 ms 8172 KB Output is correct
6 Correct 8 ms 8172 KB Output is correct
7 Correct 9 ms 8172 KB Output is correct
8 Correct 8 ms 8172 KB Output is correct
9 Correct 8 ms 8172 KB Output is correct
10 Correct 8 ms 8172 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 8172 KB Output is correct
2 Correct 8 ms 8192 KB Output is correct
3 Correct 8 ms 8172 KB Output is correct
4 Correct 8 ms 8172 KB Output is correct
5 Correct 8 ms 8172 KB Output is correct
6 Correct 8 ms 8172 KB Output is correct
7 Correct 9 ms 8172 KB Output is correct
8 Correct 8 ms 8172 KB Output is correct
9 Correct 8 ms 8172 KB Output is correct
10 Correct 8 ms 8172 KB Output is correct
11 Correct 8 ms 8172 KB Output is correct
12 Correct 8 ms 8172 KB Output is correct
13 Correct 8 ms 8172 KB Output is correct
14 Correct 8 ms 8172 KB Output is correct
15 Correct 8 ms 8172 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 8172 KB Output is correct
2 Correct 8 ms 8192 KB Output is correct
3 Correct 8 ms 8172 KB Output is correct
4 Correct 8 ms 8172 KB Output is correct
5 Correct 8 ms 8172 KB Output is correct
6 Correct 8 ms 8172 KB Output is correct
7 Correct 9 ms 8172 KB Output is correct
8 Correct 8 ms 8172 KB Output is correct
9 Correct 8 ms 8172 KB Output is correct
10 Correct 8 ms 8172 KB Output is correct
11 Correct 8 ms 8172 KB Output is correct
12 Correct 8 ms 8172 KB Output is correct
13 Correct 8 ms 8172 KB Output is correct
14 Correct 8 ms 8172 KB Output is correct
15 Correct 8 ms 8172 KB Output is correct
16 Correct 8 ms 8172 KB Output is correct
17 Correct 8 ms 8172 KB Output is correct
18 Correct 9 ms 8172 KB Output is correct
19 Correct 9 ms 8172 KB Output is correct
20 Correct 8 ms 8172 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 8172 KB Output is correct
2 Correct 8 ms 8192 KB Output is correct
3 Correct 8 ms 8172 KB Output is correct
4 Correct 8 ms 8172 KB Output is correct
5 Correct 8 ms 8172 KB Output is correct
6 Correct 8 ms 8172 KB Output is correct
7 Correct 9 ms 8172 KB Output is correct
8 Correct 8 ms 8172 KB Output is correct
9 Correct 8 ms 8172 KB Output is correct
10 Correct 8 ms 8172 KB Output is correct
11 Correct 8 ms 8172 KB Output is correct
12 Correct 8 ms 8172 KB Output is correct
13 Correct 8 ms 8172 KB Output is correct
14 Correct 8 ms 8172 KB Output is correct
15 Correct 8 ms 8172 KB Output is correct
16 Correct 8 ms 8172 KB Output is correct
17 Correct 8 ms 8172 KB Output is correct
18 Correct 9 ms 8172 KB Output is correct
19 Correct 9 ms 8172 KB Output is correct
20 Correct 8 ms 8172 KB Output is correct
21 Correct 10 ms 8172 KB Output is correct
22 Correct 10 ms 8172 KB Output is correct
23 Correct 10 ms 8172 KB Output is correct
24 Correct 10 ms 8172 KB Output is correct
25 Correct 10 ms 8172 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1094 ms 9580 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1054 ms 10732 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1046 ms 10860 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 8172 KB Output is correct
2 Correct 8 ms 8192 KB Output is correct
3 Correct 8 ms 8172 KB Output is correct
4 Correct 8 ms 8172 KB Output is correct
5 Correct 8 ms 8172 KB Output is correct
6 Correct 8 ms 8172 KB Output is correct
7 Correct 9 ms 8172 KB Output is correct
8 Correct 8 ms 8172 KB Output is correct
9 Correct 8 ms 8172 KB Output is correct
10 Correct 8 ms 8172 KB Output is correct
11 Execution timed out 1094 ms 9580 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 8172 KB Output is correct
2 Correct 8 ms 8192 KB Output is correct
3 Correct 8 ms 8172 KB Output is correct
4 Correct 8 ms 8172 KB Output is correct
5 Correct 8 ms 8172 KB Output is correct
6 Correct 8 ms 8172 KB Output is correct
7 Correct 9 ms 8172 KB Output is correct
8 Correct 8 ms 8172 KB Output is correct
9 Correct 8 ms 8172 KB Output is correct
10 Correct 8 ms 8172 KB Output is correct
11 Correct 8 ms 8172 KB Output is correct
12 Correct 8 ms 8172 KB Output is correct
13 Correct 8 ms 8172 KB Output is correct
14 Correct 8 ms 8172 KB Output is correct
15 Correct 8 ms 8172 KB Output is correct
16 Correct 8 ms 8172 KB Output is correct
17 Correct 8 ms 8172 KB Output is correct
18 Correct 9 ms 8172 KB Output is correct
19 Correct 9 ms 8172 KB Output is correct
20 Correct 8 ms 8172 KB Output is correct
21 Correct 10 ms 8172 KB Output is correct
22 Correct 10 ms 8172 KB Output is correct
23 Correct 10 ms 8172 KB Output is correct
24 Correct 10 ms 8172 KB Output is correct
25 Correct 10 ms 8172 KB Output is correct
26 Execution timed out 1094 ms 9580 KB Time limit exceeded
27 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 8172 KB Output is correct
2 Correct 8 ms 8192 KB Output is correct
3 Correct 8 ms 8172 KB Output is correct
4 Correct 8 ms 8172 KB Output is correct
5 Correct 8 ms 8172 KB Output is correct
6 Correct 8 ms 8172 KB Output is correct
7 Correct 9 ms 8172 KB Output is correct
8 Correct 8 ms 8172 KB Output is correct
9 Correct 8 ms 8172 KB Output is correct
10 Correct 8 ms 8172 KB Output is correct
11 Correct 8 ms 8172 KB Output is correct
12 Correct 8 ms 8172 KB Output is correct
13 Correct 8 ms 8172 KB Output is correct
14 Correct 8 ms 8172 KB Output is correct
15 Correct 8 ms 8172 KB Output is correct
16 Correct 8 ms 8172 KB Output is correct
17 Correct 8 ms 8172 KB Output is correct
18 Correct 9 ms 8172 KB Output is correct
19 Correct 9 ms 8172 KB Output is correct
20 Correct 8 ms 8172 KB Output is correct
21 Correct 10 ms 8172 KB Output is correct
22 Correct 10 ms 8172 KB Output is correct
23 Correct 10 ms 8172 KB Output is correct
24 Correct 10 ms 8172 KB Output is correct
25 Correct 10 ms 8172 KB Output is correct
26 Execution timed out 1094 ms 9580 KB Time limit exceeded
27 Halted 0 ms 0 KB -