Submission #84334

# Submission time Handle Problem Language Result Execution time Memory
84334 2018-11-14T11:56:27 Z zoooma13 Baloni (COCI15_baloni) C++14
0 / 100
1935 ms 132096 KB
#include <bits/stdc++.h>
using namespace std;

#define MAX_N 1000006

int GIR; char GIC;
inline int GI() {
	GIR = 0 ,GIC = getchar();
	while(GIC < '0' || '9' < GIC)
		GIC = getchar();
	while('0' <= GIC && GIC <= '9') {
		GIR = (GIR * 10) + (GIC - '0');
		GIC = getchar();
	}
	return GIR;
}

int N ,A;
set <int> ss[MAX_N];
multiset <int> ms;

int main()
{
    N = GI(); assert(N < MAX_N);
    for(int i=0; i<N; i++)
    {
        A = GI();
        ss[A].insert(i);
        ms.insert(A);
    }

    int Ans = 0;

    set<int>::iterator it;
    while(!ms.empty())
    {
        int i = *prev(ms.end());
        int j = -1;

        while(true)
        {
            it = ss[i].upper_bound(j);
            if(it == ss[i].end())
                break;

            j = *it;
            ms.erase(i);
            ss[i].erase(it);
            i--;
        }

        Ans++;
    }

    cout << Ans << endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 47 ms 47352 KB Output isn't correct
2 Incorrect 48 ms 47612 KB Output isn't correct
3 Incorrect 47 ms 47848 KB Output isn't correct
4 Incorrect 87 ms 47976 KB Output isn't correct
5 Incorrect 1887 ms 125492 KB Output isn't correct
6 Runtime error 1935 ms 132096 KB Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience.
7 Runtime error 1468 ms 132096 KB Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience.
8 Runtime error 1473 ms 132096 KB Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience.
9 Runtime error 1684 ms 132096 KB Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience.
10 Runtime error 1671 ms 132096 KB Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience.