Contest Duration: ~ (local time) (90 minutes) Back to Home

Submission #315223

Source Code Expand

Copy
```#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define Fi first
#define Se second
#define INF (1<<29)
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

double toRad(double deg){ return deg*M_PI/180.0; }

int A,B,C,D,N;

int main(){
double h,w;
//  cin >> h >> w;
//  double a = 60;
//  h = 1; w = 2;

cin >> A >> B >> N;

rep(i,N){
cin >> C >> D;
double lb = 0, ub = 90;
for(int m=0;m<2;m++){
swap(C,D);
if(A<=C&&B<=D){
cout << "YES\n";
break;
}
for(int l=0;l<100;l++){
double mid = (lb+ub)/2.0;
if(h <= C && w <= D){
cout << "YES\n";
goto e;
}else if(h <= A){
ub = mid;
}else{
lb = mid;
}
}
if(m==1) cout << "NO\n";
}
e:;
}

return 0;
}
```

#### Submission Info

Submission Time 2015-01-06 15:20:45+0900 B - 高橋君と禁断の書 raven38 C++ (G++ 4.6.4) 0 1701 Byte WA 273 ms 936 KB

#### Test Cases

Set Name Score / Max Score Test Cases
Case Name Status Exec Time Memory