洛谷 P2911 [USACO08OCT]Bovine Bones G
更多...
#include <luogu.h>
|
static int | main (istream &cin, ostream &cout) |
|
洛谷 P2911 [USACO08OCT]Bovine Bones G
在文件 luogu.h 第 443 行定义.
◆ main()
int luogu::P2911::main |
( |
istream & | cin, |
|
|
ostream & | cout ) |
|
static |
在文件 luogu.cpp 第 1454 行定义.
1454 {
1455 int s1;
1456 int s2;
1457 int s3;
1458 cin >> s1 >> s2 >> s3;
1459 const int n = s1 + s2 + s3 + 1;
1460 auto *sum =
new int[
n];
1461 memset(sum, 0, n * sizeof(int));
1462 for(int i = 1; i <= s1; i++) {
1463 for(int j = 1; j <= s2; j++) {
1464 for(int k = 1; k <= s3; k++) {
1465 sum[i + j + k]++;
1466 }
1467 }
1468 }
1469 int maximum = 0;
1471 for(
int i = 3; i <
n; i++) {
1472 if(maximum < sum[i]) {
1473 maximum = sum[i];
1475 }
1476 }
1478 delete[] sum;
1479 return 0;
1480 }
vector< vector< int > > ans
被这些函数引用 luogu::TEST().
该类的文档由以下文件生成: