Tue, 29 Jan 2019 23:40:06 +0800

master
大蒟蒻 7 years ago
parent 2ec7f660da
commit 4866595022

@ -19,3 +19,7 @@
### E - Pearls in a Row
拿set随便一搞就过了注意Codeforces默认是32位编译的。实在拿不定怎么输出就cout吧
### F - Kiki & Little Kiki 1
multiset.upper_bound()

@ -7,3 +7,5 @@ add_executable("B" "B.cpp")
add_executable("C" "C.cpp")
add_executable("D" "D.cpp")
add_executable("E" "E.cpp")
add_executable("F" "F.cpp")
add_executable("Z" "Z.cpp")

@ -0,0 +1,22 @@
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
int main()
{
multiset<int> s;
int n, x;
char buf[20];
for (; ~scanf("%d", &n); putchar('\n'), s.clear())
for (int i = 0; i < n; i++)
if (scanf("%s%d", buf, &x), buf[1] == 'u')
s.insert(x);
else
{
auto ite = s.upper_bound(x);
if (ite != s.begin())
printf("%d\n", *--ite), s.erase(ite);
else
puts("No Element!");
}
return 0;
}

@ -0,0 +1,7 @@
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
int main()
{
return 0;
}
Loading…
Cancel
Save