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

洛谷 P1428 小鱼比可爱 更多...

#include <luogu.h>

静态 Public 成员函数

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

详细描述

洛谷 P1428 小鱼比可爱

在文件 luogu.h371 行定义.

成员函数说明

◆ main()

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

在文件 luogu.cpp1089 行定义.

1089 {
1090 int n;
1091 cin >> n;
1092 auto *fish = new int[n];
1093 for(int i = 0; i < n; i++) {
1094 cin >> fish[i];
1095 }
1096 for(int i = 0; i < n; i++) {
1097 int count = 0;
1098 for(int j = 0; j < i; j++) {
1099 if(fish[j] < fish[i]) {
1100 count++;
1101 }
1102 }
1103 cout << count << " ";
1104 }
1105 delete[] fish;
1106 return 0;
1107 }

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


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