Submission #3236426
Source Code Expand
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<LD, LD> PLDLD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<char> VB;
#define FOR(i,a,b) for(int i=(a);i<(int)(b);++i)
#define REP(i,n) FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
#define ALL(a) a.begin(),a.end()
#define endl "\n"
const LD EPS=1e-10;
const long long INFLL=(LL)(1e9)*(LL)(1e9);
const int INF=1e9+7;
template<class T>
void chmin(T& a, const T b)
{
if(a>b)
a=b;
}
template<class T>
void chmax(T& a, const T b)
{
if(a<b)
a=b;
}
const LL powLL(const LL p, const LL q)
{
LL t=1;
for(int i=0;i<q;i++)
t*=p;
return t;
}
template <typename T>
struct has_iter
{
private:
template <typename U>
static constexpr true_type check(typename U::iterator*);
template <typename U>
static constexpr false_type check(...);
public:
static constexpr bool value = decltype(check<T>(nullptr))::value;
};
template<typename T, typename U = typename T::iterator>
void print(const T& container)
{
auto&& first=begin(container), last=end(container);
auto&& back=prev(last);
for(auto e=first; e!=last; e=next(e))
cout<<*e<<" \n"[e==back];
}
extern void* enabler;
template<typename Head, typename enable_if<!has_iter<Head>::value>::type*& = enabler>
void print(const Head& head)
{
cout<<head<<endl;
}
template<> void print<string>(const string& container)
{
cout<<container<<endl;
}
template<typename Head, typename... Tail>
void print(const Head& head, const Tail&... tail)
{
cout<<head<<" ";
print(tail...);
}
void io_speedup()
{
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
}
template<typename T>
istream& operator >> (istream& is, vector<T>& vec)
{
for(T& x: vec) is >> x;
return is;
}
template<typename T, typename U>
ostream& operator << (ostream& os, const pair<T, U>& p)
{
os<<'('<<p.first<<", "<<p.second<<')';
return os;
}
template<typename T>
vector<T> read(int n)
{
vector<T> t(n);
cin>>t;
return t;
}
template<typename T>
T read()
{
T t;
cin>>t;
return t;
}
template<typename Head, typename... Tail>
struct vector_demensions
{
using type=vector<typename vector_demensions<Tail...>::type>;
};
template<typename Head>
struct vector_demensions<Head> { using type=Head; };
template<typename T>
vector<T> make_vectors(int size, T val)
{
return vector<T>(size, val);
}
template<typename T=int, typename... Args>
auto make_vectors(int size, Args... tail)
-> typename vector_demensions<Args..., T>::type
{
auto val=make_vectors<T>(forward<Args>(tail)...);
return vector<decltype(val)>(size, val);
}
int main()
{
int n,m;
cin>>n>>m;
vector<PII> p(n);
REP(i,n)
{
int x,y;
cin>>x>>y;
p[i]=PII(y,x);
}
multiset<int> s;
REP(i,m)
{
int a;
cin>>a;
s.insert(a);
}
sort(ALL(p));
int ans=0;
REP(i,n)
{
auto q=s.lower_bound(p[i].second);
if(*q<=p[i].first)
{
s.erase(q);
ans++;
}
}
print(ans);
}
Submission Info
Submission Time |
|
Task |
B - 枕決め |
User |
suginamiku |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
3198 Byte |
Status |
RE |
Exec Time |
2103 ms |
Memory |
5760 KB |
Judge Result
Set Name |
All |
Score / Max Score |
0 / 100 |
Status |
|
Set Name |
Test Cases |
All |
00-sample-00, 00-sample-01, 00-sample-02, 10-random-00, 10-random-01, 10-random-02, 10-random-03, 10-random-04, 10-random-05, 10-random-06, 10-random-07, 10-random-08, 10-random-09, 20-random_max-00, 20-random_max-01, 20-random_max-02, 20-random_max-03, 20-random_max-04, 30-corner-00, 30-corner-01 |
Case Name |
Status |
Exec Time |
Memory |
00-sample-00 |
AC |
1 ms |
256 KB |
00-sample-01 |
AC |
1 ms |
256 KB |
00-sample-02 |
AC |
1 ms |
256 KB |
10-random-00 |
RE |
168 ms |
2304 KB |
10-random-01 |
TLE |
2103 ms |
2048 KB |
10-random-02 |
AC |
88 ms |
3840 KB |
10-random-03 |
AC |
67 ms |
3456 KB |
10-random-04 |
RE |
209 ms |
4480 KB |
10-random-05 |
AC |
85 ms |
4480 KB |
10-random-06 |
AC |
75 ms |
4864 KB |
10-random-07 |
AC |
90 ms |
4480 KB |
10-random-08 |
AC |
28 ms |
1664 KB |
10-random-09 |
AC |
72 ms |
4224 KB |
20-random_max-00 |
AC |
136 ms |
5760 KB |
20-random_max-01 |
AC |
136 ms |
5760 KB |
20-random_max-02 |
AC |
137 ms |
5760 KB |
20-random_max-03 |
AC |
136 ms |
5760 KB |
20-random_max-04 |
AC |
137 ms |
5760 KB |
30-corner-00 |
AC |
53 ms |
2944 KB |
30-corner-01 |
AC |
53 ms |
2944 KB |