Submission #124443

#TimeUsernameProblemLanguageResultExecution timeMemory
124443HassenAissaStrange Device (APIO19_strange_device)C++14
10 / 100
5016 ms524292 KiB
#include <bits/stdc++.h> using namespace std; int main() { long long unsigned n,a,b,t,l; scanf("%llu%llu%llu",&n,&a,&b); set<pair<long long unsigned,long long unsigned> > res; for(long long unsigned i=0;i<n;i++) { scanf("%llu%llu",&t,&l); for(long long unsigned j=t;j<=l;j++) { res.insert(make_pair((j+j/b)%a,j%b)); } } printf("%llu",res.size()); }

Compilation message (stderr)

strange_device.cpp: In function 'int main()':
strange_device.cpp:18:29: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type 'std::set<std::pair<long long unsigned int, long long unsigned int> >::size_type {aka long unsigned int}' [-Wformat=]
     printf("%llu",res.size());
                   ~~~~~~~~~~^
strange_device.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%llu%llu%llu",&n,&a,&b);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
strange_device.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%llu%llu",&t,&l);
         ~~~~~^~~~~~~~~~~~~~~~~~
#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...