Submission #124424

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

Compilation message (stderr)

strange_device.cpp: In function 'int main()':
strange_device.cpp:12:27: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
         scanf("%d%d",&t,&l);
                      ~~   ^
strange_device.cpp:12:27: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
strange_device.cpp:18:29: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'std::set<std::pair<long long int, long long int> >::size_type {aka long unsigned int}' [-Wformat=]
     printf("%lld",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("%lld%lld%lld",&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("%d%d",&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...