Submission #295728

#TimeUsernameProblemLanguageResultExecution timeMemory
295728CaroLindaStrange Device (APIO19_strange_device)C++14
10 / 100
5027 ms524292 KiB
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization ("unroll-loops") #pragma GCC optimization ("O2") #define lp(i,a,b) for(int i = a; i < b; i++) #define pb push_back #define sz(x) (int)(x.size()) #define all(x) x.begin(),x.end() #define debug printf #define tiii tuple<int,int,int> #define mkt make_tuple #define pii pair<int,int> #define mk make_pair #define ll long long #define ff first #define ss second using namespace std ; int N ; set< pair<ll,ll> > s ; ll A , B ; int main() { scanf("%d%lld%lld", &N , &A, &B ) ; for(int i = 1 ; i <= N ; i++ ) { ll L , R ; scanf("%lld %lld", &L, &R ) ; for(ll j = L ; j <= R ; j++ ) { ll x = (j + j/B)%A ; ll y = j%B ; s.insert(mk(x,y)) ; } } printf("%d\n" , sz(s)) ; }

Compilation message (stderr)

strange_device.cpp:5: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
    5 | #pragma GCC optimization ("unroll-loops")
      | 
strange_device.cpp:6: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
    6 | #pragma GCC optimization ("O2")
      | 
strange_device.cpp: In function 'int main()':
strange_device.cpp:29:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   29 |     scanf("%d%lld%lld", &N , &A, &B ) ;
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
strange_device.cpp:33:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   33 |         scanf("%lld %lld", &L, &R ) ;
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~
#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...