Submission #788214

#TimeUsernameProblemLanguageResultExecution timeMemory
788214makanhuliaExhibition (JOI19_ho_t2)C++17
0 / 100
1 ms212 KiB
#include<bits/stdc++.h> using namespace std; #define ioss ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define int long long #define pii pair<int, int> #define fi first #define se second #define pb push_back int n, m; vector<pii> gambar; bool comp(pii a, pii b) { return (a.se < b.se || (a.se == b.se && a.fi < b.fi)); } signed main() { ioss; cin >> n >> m; for(int i = 0; i < n; i++) { int s, v; cin >> s >> v; gambar.pb({s, v}); } sort(gambar.begin(), gambar.end(), comp); vector<int> bingkai; for(int i = 0; i < m; i++) { int x; cin >> x; bingkai.pb(x); } int tmp = 0; vector<int> ans; for(int i = 0; i < m; i++) { auto [s, v] = gambar[tmp]; auto size = bingkai[i]; if(s <= size) ans.pb(tmp), tmp++; if(tmp == gambar.size()) break; // cout << " :: " << s << " " << size << " " << ans << endl; } cout << ans.size() << endl; }

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:35:16: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |         if(tmp == gambar.size()) break;
      |            ~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...