Submission #83631

# Submission time Handle Problem Language Result Execution time Memory
83631 2018-11-09T13:55:49 Z nikolapesic2802 Temperature (POI11_tem) C++14
0 / 100
1000 ms 33792 KB
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back

int main()
{
    int n;
    scanf("%i",&n);
    int lo,hi;
    scanf("%i %i",&lo,&hi);
    int last;
    multiset<int,greater<int> > mins;
    queue<pair<int,int> > dodati;
    int res=1;
    int s=0;
    mins.insert(lo);
    dodati.push({lo,0});
    for(int i=1;i<n;i++)
    {
        scanf("%i %i",&lo,&hi);
        while(mins.size()&&*mins.begin()>hi)
        {
            mins.erase((dodati.front()).first);
            s=(dodati.front()).second+1;
            dodati.pop();
        }
        mins.insert(lo);
        dodati.push({lo,i});
        res=max(res,i-s+1);
    }
    printf("%i\n",res);
    return 0;
}

Compilation message

tem.cpp: In function 'int main()':
tem.cpp:14:9: warning: unused variable 'last' [-Wunused-variable]
     int last;
         ^~~~
tem.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%i",&n);
     ~~~~~^~~~~~~~~
tem.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%i %i",&lo,&hi);
     ~~~~~^~~~~~~~~~~~~~~~~
tem.cpp:23:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%i %i",&lo,&hi);
         ~~~~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 504 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 504 KB Output is correct
3 Correct 2 ms 524 KB Output is correct
4 Incorrect 2 ms 524 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 656 KB Output is correct
2 Correct 7 ms 1364 KB Output is correct
3 Incorrect 8 ms 1364 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 307 ms 22792 KB Output is correct
2 Runtime error 356 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 934 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 Execution timed out 1014 ms 33792 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 701 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 Execution timed out 1033 ms 33792 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 559 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 539 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 Execution timed out 1020 ms 33792 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 925 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 -