Submission #285105

#TimeUsernameProblemLanguageResultExecution timeMemory
285105achibasadzishviliArcade (NOI20_arcade)C++14
0 / 100
1 ms384 KiB
#include<bits/stdc++.h> #define ll long long #define f first #define s second #define mp make_pair #define pb push_back using namespace std; vector<pair<ll,ll> >v; ll n,m,t[500005],a[500005]; int main(){ ios::sync_with_stdio(false); cin >> n >> m; for(int i=1; i<=m; i++){ cin >> t[i]; } for(int i=1; i<=m; i++){ cin >> a[i]; v.pb(mp(t[i] + a[i] , t[i] - a[i])); } sort(v.begin() , v.end()); multiset < int > s; multiset < int > :: iterator it; for(int i=0; i<v.size(); i++){ ll k = v[i].s; s.insert(k); it = s.upper_bound(k); if(it != s.end()) s.erase(it); } cout << s.size(); return 0; }

Compilation message (stderr)

Arcade.cpp: In function 'int main()':
Arcade.cpp:23:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |     for(int i=0; i<v.size(); i++){
      |                  ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...