mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-07 18:06:58 +08:00
Add FZOI Codes
This commit is contained in:
26
FZOI/「NOIP2011」铺地毯.cpp
Normal file
26
FZOI/「NOIP2011」铺地毯.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
int n;
|
||||
cin >> n;
|
||||
int a[101000], b[101000], c[101000], d[101000];
|
||||
for (int i = 1; i <= n; i++)
|
||||
{
|
||||
scanf("%d%d%d%d", &a[i], &b[i], &c[i], &d[i]);
|
||||
}
|
||||
int num = -1;
|
||||
int x, y;
|
||||
cin >> x >> y;
|
||||
for(int i = n; i >= 1; i--) {
|
||||
if(a[i] <= x && b[i] <= y && c[i] + a[i] >= x && d[i] + b[i] >= y)
|
||||
{
|
||||
num = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
cout << num;
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user