Submission #291799

# Submission time Handle Problem Language Result Execution time Memory
291799 2020-09-05T19:22:19 Z crossing0ver Arcade (NOI20_arcade) C++17
0 / 100
0 ms 256 KB
#include<bits/stdc++.h>
#define pii pair<int,int>
using namespace std;
int n,m;
main() {
    cin >> n >> m;
    vector<pair<int,int> > v(m);
    for (int i = 0; i < m; i++) {
        int a,b;
        cin >> v[i].first;
       // v.push_back({-a-b,-b+a});
    }
    for (int i = 0;i < m ;i ++) {
        cin >> v[i].second;
        v[i] = {-v[i].first - v[i].second,-v[i].second + v[i].first};
    }
    sort(v.begin(),v.end(),[&](pii a,pii b){
         return a.second < b.second;
         });
    vector<int> sub;
    for (auto i : v) {
        int x = i.first;
        auto it = lower_bound(sub.begin(),sub.end(),x);
        if (it == sub.end()) sub.push_back(x);
        else *it = x;
    }
    cout << sub.size();

}

Compilation message

Arcade.cpp:5:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main() {
      |      ^
Arcade.cpp: In function 'int main()':
Arcade.cpp:9:13: warning: unused variable 'a' [-Wunused-variable]
    9 |         int a,b;
      |             ^
Arcade.cpp:9:15: warning: unused variable 'b' [-Wunused-variable]
    9 |         int a,b;
      |               ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -