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

Submission #315220

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 = 0;
h = 1; w = 6;

cin >> A >> B >> N;

rep(i,N){
cin >> C >> D;
double lb = 0, ub = 90;
for(int l=0;l<100;l++){
double mid = (lb+ub)/2.0;
//      printf("%.5f %.5f %.5f\n", mid, h, w);
//      cout << h << " " <<A << " " <<w << " " << B << endl;
if(h <= C && w <= D){
cout << "YES\n";
break;
}else if(h <= A){
ub = mid;
}else{
lb = mid;
}

if(l==99) cout << "NO\n";
}
}

return 0;
}
```

#### Submission Info

Submission Time 2015-01-06 15:13:04+0900 B - 高橋君と禁断の書 raven38 C++ (G++ 4.6.4) 0 1720 Byte WA 153 ms 1156 KB

#### Test Cases

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