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

洛谷 P2181 对角线 更多...

#include <luogu.h>

静态 Public 成员函数

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

详细描述

洛谷 P2181 对角线

在文件 luogu.h106 行定义.

成员函数说明

◆ main()

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

在文件 luogu.cpp303 行定义.

303 {
304 unsigned long long n;
305 unsigned long long count = 0;
306 cin >> n;
307 for(long long i = 1; i <= n - 2; i++) {
308 count += i * (n - 2 - i);
309 }
310 count *= n;
311 count /= 4;
312 cout << count;
313 return 0;
314 }

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


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