洛谷 P1003 [NOIP2011 提高组] 铺地毯
更多...
#include <luogu.h>
|
static int | main (istream &cin, ostream &cout) |
|
洛谷 P1003 [NOIP2011 提高组] 铺地毯
在文件 luogu.h 第 38 行定义.
◆ main()
int luogu::P1003::main |
( |
istream & | cin, |
|
|
ostream & | cout ) |
|
static |
在文件 luogu.cpp 第 142 行定义.
142 {
143 auto as = vector<unsigned int>();
144 auto bs = vector<unsigned int>();
145 auto gs = vector<unsigned int>();
146 auto ks = vector<unsigned int>();
149 for(
int i = 0; i <
n; i++) {
150 unsigned int a;
151 unsigned int b;
152 unsigned int g;
153 unsigned int k;
154 cin >> a >> b >> g >> k;
155 as.push_back(a);
156 bs.push_back(b);
157 gs.push_back(g);
158 ks.push_back(k);
159 }
160 unsigned int x;
161 unsigned int y;
162 cin >> x >> y;
163 for(int i = n - 1; i >= 0; i--) {
164 if(as[i] <= x && x <= as[i] + gs[i] && bs[i] <= y && y <= bs[i] + ks[i]) {
165 cout << i + 1;
166 return 0;
167 }
168 }
169 cout << -1;
170 return 0;
171 }
被这些函数引用 luogu::TEST() , 以及 luogu::TEST().
该类的文档由以下文件生成: