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

洛谷 P2415 集合求和 更多...

#include <luogu.h>

静态 Public 成员函数

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

详细描述

洛谷 P2415 集合求和

在文件 luogu.h678 行定义.

成员函数说明

◆ main()

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

在文件 luogu.cpp2478 行定义.

2478 {
2479 vector<int> vec;
2480 int num;
2481 while(cin >> num) {
2482 vec.push_back(num);
2483 }
2484 const int n = vec.size();
2485 const unsigned long long base = static_cast<unsigned long long>(1) << n - 1;
2486 unsigned long long sum = 0;
2487 for(const auto num: vec) {
2488 sum += num * base;
2489 }
2490 cout << sum;
2491 return 0;
2492 }
int vec[100010]
Definition: pat.cpp:5095

引用了 pat::a::a7_2::vec.

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


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