Submission #83644

# Submission time Handle Problem Language Result Execution time Memory
83644 2018-11-09T14:29:42 Z nikolapesic2802 Temperature (POI11_tem) C++14
24 / 100
965 ms 33792 KB
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back

const int N=1e6+5;
vector<int> lo(N),hi(N);


int main()
{
    int n;
    scanf("%i",&n);
    for(int i=0;i<n;i++)
        scanf("%i %i",&lo[i],&hi[i]);
    multiset<int,greater<int> > mins;
    int res=1;
    int s=0;
    mins.insert(lo[0]);
    for(int i=1;i<n;i++)
    {
        while(mins.size()&&*mins.begin()>hi[i])
        {
            mins.erase(mins.find(lo[s]));
            s++;
        }
        mins.insert(lo[i]);
        res=max(res,i-s+1);
    }
    printf("%i\n",res);
 
    return 0;
}

Compilation message

tem.cpp: In function 'int main()':
tem.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%i",&n);
     ~~~~~^~~~~~~~~
tem.cpp:17:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%i %i",&lo[i],&hi[i]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 9 ms 8184 KB Output is correct
2 Correct 9 ms 8256 KB Output is correct
3 Correct 9 ms 8256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 8256 KB Output is correct
2 Correct 8 ms 8284 KB Output is correct
3 Correct 8 ms 8332 KB Output is correct
4 Correct 9 ms 8340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 8468 KB Output is correct
2 Correct 13 ms 9164 KB Output is correct
3 Correct 14 ms 9164 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 285 ms 27812 KB Output is correct
2 Runtime error 332 ms 33792 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.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 829 ms 33792 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.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 964 ms 33792 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.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 697 ms 33792 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 965 ms 33792 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.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 485 ms 33792 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.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 380 ms 33792 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 939 ms 33792 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.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 893 ms 33792 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.
2 Halted 0 ms 0 KB -