Guest User

UVA 12869

a guest
May 3rd, 2018
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.10 KB | None | 0 0
  1. /*
  2. Problem : UVA 12869
  3. Idea : Very nice Problem. The value changes per 5 values.
  4. */
  5.  
  6. #include<bits/stdc++.h>
  7. using namespace std;
  8. #define F first
  9. #define S second
  10. #define EB emplace_back
  11. #define MP make_pair
  12. #define all(o) (o).begin(), (o).end()
  13. #define mset(m,v) memset(m,v,sizeof(m))
  14. #define fr(i,n) for(lli i=0;i<n;++i)
  15. #define rep(i,a,b) for(lli i=a;i<=b;++i)
  16. #define remin(a,b) (a=min((a),(b)))
  17. #define remax(a,b) (a=max((a),(b)))
  18. #define endl '\n'
  19. typedef unsigned long long int lli;
  20. typedef long double ld;
  21. typedef pair< lli,lli > ii;
  22. typedef vector<lli> vi;
  23. typedef vector<ii> vii;
  24. typedef vector<vi> graph;
  25. lli MOD=1000000007;long double EPS=1e-9;
  26.  
  27. lli getcnt(lli x){
  28.     return x/5;
  29. }
  30.  
  31. bool solve(){
  32.     lli lo,hi;
  33.     cin>>lo>>hi;
  34.     if(lo==0)return 0;
  35.     lli cnt1=getcnt(lo);
  36.     lli cnt2=getcnt(hi);
  37.     cout<<cnt2+1-cnt1<<endl;
  38.     return 1;
  39. }
  40.  
  41. int main(){
  42.     ios_base::sync_with_stdio(false);
  43.     cin.tie(0);
  44.     cout.tie(0);
  45.     //freopen("in.txt","r",stdin);
  46.     //freopen("out.txt","w",stdout);
  47.     //pre();
  48.     int t=1;
  49.     //cin>>t;
  50.     for(int i=1;solve();i++){
  51.         //cout<<"Case #"<<i<<": ";
  52.    
  53.     }
  54. }
Add Comment
Please, Sign In to add comment