diff --git a/GESP/GESP2024年3月4级.pdf b/GESP/GESP2024年3月4级.pdf index 0513f18..bb72986 100644 Binary files a/GESP/GESP2024年3月4级.pdf and b/GESP/GESP2024年3月4级.pdf differ diff --git a/GESP/GESP九月四级C++真题.pdf b/GESP/GESP九月四级C++真题.pdf index c9e841f..651e942 100644 Binary files a/GESP/GESP九月四级C++真题.pdf and b/GESP/GESP九月四级C++真题.pdf differ diff --git a/GESP/做题.cpp b/GESP/做题.cpp new file mode 100644 index 0000000..1c9e758 --- /dev/null +++ b/GESP/做题.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; +const int N = 1e6 + 10;//ⵥ +int a[N];//ÿⵥ + +int main() { + int n; + cin >> n; + for (int i = 1; i <= n; i++) + cin >> a[i]; + sort(a + 1, a + 1 + n); + + int h = 1;//󣬴Ƚϵⵥ + for (int i = 1;;) { //öÿһ죬breakֹͣ + if (a[h] >= i) //ߵһ + i++; + if (++h > n) { + cout << i - 1 << endl; + break; + } + } + return 0; +}