Submission #884370

# Submission time Handle Problem Language Result Execution time Memory
884370 2023-12-07T08:55:34 Z ezzzay Strange Device (APIO19_strange_device) C++14
0 / 100
2079 ms 524288 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
   int n,a,b;
   cin>>n>>a>>b;
   set<pair<int,int>>st;
   for(int i=1;i<=n;i++){
       int l,r;
       cin>>l>>r;
       for(int x=l;x<=r;x++){
           if(st.size()==max(a,b))break;
            st.insert(make_pair((x+x/b)%a, x%b));
       }
       if(st.size()==max(a,b))break;
   }
   cout<<st.size();
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:12:24: warning: comparison of integer expressions of different signedness: 'std::set<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} and 'const long long int' [-Wsign-compare]
   12 |            if(st.size()==max(a,b))break;
      |               ~~~~~~~~~^~~~~~~~~~
strange_device.cpp:15:20: warning: comparison of integer expressions of different signedness: 'std::set<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} and 'const long long int' [-Wsign-compare]
   15 |        if(st.size()==max(a,b))break;
      |           ~~~~~~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 1 ms 604 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 2079 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 2 ms 1116 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1018 ms 63008 KB Output is correct
3 Runtime error 1257 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1018 ms 63008 KB Output is correct
3 Runtime error 1257 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1018 ms 63008 KB Output is correct
3 Runtime error 1257 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 17 ms 8028 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 1 ms 604 KB Output isn't correct
3 Halted 0 ms 0 KB -