problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
luogu::P5729类 参考

洛谷 P5729 【深基5.例7】工艺品制作 更多...

#include <luogu.h>

静态 Public 成员函数

static int main (istream &cin, ostream &cout)
 

详细描述

洛谷 P5729 【深基5.例7】工艺品制作

在文件 luogu.h401 行定义.

成员函数说明

◆ main()

int luogu::P5729::main ( istream &  cin,
ostream &  cout 
)
static

在文件 luogu.cpp1206 行定义.

1206 {
1207 int w;
1208 int x;
1209 int h;
1210 cin >> w >> x >> h;
1211 bool block[21][21][21] = {};
1212 memset(block, 1, sizeof block);
1213 int q;
1214 cin >> q;
1215 while(q-- != 0) {
1216 int x1;
1217 int y1;
1218 int z1;
1219 int x2;
1220 int y2;
1221 int z2;
1222 cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2;
1223 for(int i = x1; i <= x2; i++) {
1224 for(int j = y1; j <= y2; j++) {
1225 for(int k = z1; k <= z2; k++) {
1226 block[i][j][k] = false;
1227 }
1228 }
1229 }
1230 }
1231 int ans = 0;
1232 for(int i = 1; i <= w; i++) {
1233 for(int j = 1; j <= x; j++) {
1234 for(int k = 1; k <= h; k++) {
1235 if(block[i][j][k]) {
1236 ans++;
1237 }
1238 }
1239 }
1240 }
1241 cout << ans;
1242 return 0;
1243 }

被这些函数引用 luogu::TEST().


该类的文档由以下文件生成: