Submission #884370

#TimeUsernameProblemLanguageResultExecution timeMemory
884370ezzzayStrange Device (APIO19_strange_device)C++14
0 / 100
2079 ms524288 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...