Submission #1008534

# Submission time Handle Problem Language Result Execution time Memory
1008534 2024-06-26T14:07:51 Z ihne Exhibition (JOI19_ho_t2) C++17
0 / 100
2 ms 4700 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pii pair<int,int>
#define pb push_back
const int mn=1e5+5;
struct pt{
  int s,v;
  bool operator < (const pt &o) const{
    if (v!=o.v)return v<o.v;
    return s<o.s;
  }
  friend istream& operator >> (istream& in,pt& p){
    in>>p.s>>p.v;
  }
};
pt p[mn];
int f[mn];
signed main(){
  //freopen("","r",stdin);
  //freopen("","w",stdout);
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n,m;
  cin>>n>>m;
  for (int i=1;i<=n;i++){
    cin>>p[i];
  }
  for (int i=1;i<=m;i++){
    cin>>f[i];
  }
  sort(p+1,p+n+1);
  sort(f+1,f+m+1);
  int it=n;
  int ans=0;
  for (int i=m;i>=1;i--){
    while (it&&p[it].s>f[i]) it--;
    if (!it) break;
    if (p[it].s<=f[i]) ans++;
    it--;
  }
  cout<<ans;
}

Compilation message

joi2019_ho_t2.cpp: In function 'std::istream& operator>>(std::istream&, pt&)':
joi2019_ho_t2.cpp:17:3: warning: no return statement in function returning non-void [-Wreturn-type]
   17 |   }
      |   ^
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 4700 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 4700 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 4700 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -