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

洛谷 P2669 [NOIP2015 普及组] 金币 更多...

#include <luogu.h>

静态 Public 成员函数

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

详细描述

洛谷 P2669 [NOIP2015 普及组] 金币

在文件 luogu.h279 行定义.

成员函数说明

◆ main()

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

在文件 luogu.cpp746 行定义.

746 {
747 unsigned int k;
748 unsigned int coin = 0;
749 unsigned current = 1;
750 unsigned rest = 1;
751 cin >> k;
752 for(unsigned int i = 0; i < k; i++) {
753 if(rest == 0) {
754 current++;
755 rest = current;
756 }
757 coin += current;
758 rest--;
759 }
760 cout << coin;
761 return 0;
762 }

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


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