| /*** | |
| Md. Nazmul Hasan | |
| Shahjalal University of Science & Technology,Sylhet. | |
| hasan08sust@gmail.com | |
| ***/ | |
| #include<iostream> | |
| #include<cstdio> | |
| #include<stack> | |
| #include<queue> | |
| #include<map> | |
| #include<vector> | |
| #include<algorithm> | |
| #include<cstring> | |
| #include<sstream> | |
| #include<cmath> | |
| #include <iomanip> | |
| using namespace std ; | |
| typedef long long ll ; | |
| typedef int in ; | |
| typedef unsigned long long ull ; | |
| const double pi = 2*acos(0) ; | |
| #define maxi 40000 | |
| #define pf printf | |
| #define sc scanf | |
| #define pb push_back | |
| #define MEM(x,y) (memset((x),(y),sizeof(x))) | |
| #define MIN(x,y) ((x) < (y) ? (x) : (y)) | |
| #define MAX(x,y) ((x) > (y) ? (x) : (y)) | |
| #define load(array,size) for(int i=0 ; i<size ; i++) cin>>array[i] ; | |
| #define new_line pf("\n") | |
| #define clear_data(array) memset(array,0,sizeof(array)) | |
| #define highest_int 2147483647 | |
| int main() | |
| { | |
| int n,t,a,d,p,l; | |
| sc("%d %d",&n,&t); | |
| int x = 86400; | |
| int cnt=0; | |
| l=0; | |
| for(int i=1 ; i<=n ; i++){ | |
| sc("%d",&a); | |
| d = (x-a); | |
| p = t-d; | |
| if(l) | |
| continue; | |
| if(p==0){ | |
| cnt++; | |
| l=1; | |
| } | |
| if(p>0){ | |
| cnt++; | |
| t = p; | |
| } | |
| if(p<0){ | |
| cnt++; | |
| l=1; | |
| } | |
| } | |
| pf("%d\n",cnt); | |
| return 0; | |
| } |
31 October 2017
Codeforces 884 A Book Reading
25 October 2017
UVA 12527 Different Digits
| /*** | |
| Md. Namzul Hasan | |
| Shahjalal University of Science & Technology,Sylhet. | |
| hasan08sust@gmail.com | |
| ***/ | |
| #include<iostream> | |
| #include<cstdio> | |
| #include<stack> | |
| #include<queue> | |
| #include<map> | |
| #include<vector> | |
| #include<algorithm> | |
| #include<cstring> | |
| #include<sstream> | |
| #include<cmath> | |
| #include <iomanip> | |
| using namespace std ; | |
| typedef long long ll ; | |
| typedef int in ; | |
| typedef unsigned long long ull ; | |
| const double pi = 2*acos(0) ; | |
| #define maxi 40000 | |
| #define pf printf | |
| #define sc scanf | |
| #define pb push_back | |
| #define MEM(x,y) (memset((x),(y),sizeof(x))) | |
| #define MIN(x,y) ((x) < (y) ? (x) : (y)) | |
| #define MAX(x,y) ((x) > (y) ? (x) : (y)) | |
| #define load(array,size) for(int i=0 ; i<size ; i++) cin>>array[i] ; | |
| #define new_line pf("\n") | |
| #define clear_data(array) memset(array,0,sizeof(array)) | |
| #define highest_int 2147483647 | |
| int data[5002]; | |
| bool isRepeated(int p){ | |
| bool check[20]; | |
| memset(check,false,sizeof(check)); | |
| int mod; | |
| while(p){ | |
| mod = p%10; | |
| if(check[mod]) | |
| return false; | |
| check[mod] = true; | |
| p = p/10; | |
| } | |
| return true; | |
| } | |
| void fixData(){ | |
| memset(data,0,sizeof(data)); | |
| for(int i=1 ; i<=5000 ; i++){ | |
| if(isRepeated(i)){ | |
| data[i] = data[i-1] +1; | |
| }else{ | |
| data[i] = data[i-1]; | |
| } | |
| } | |
| } | |
| int main() | |
| { | |
| int n,m,q; | |
| fixData(); | |
| while(sc("%d %d",&n,&m)==2){ | |
| q = data[m] - data[n-1]; | |
| pf("%d\n",q); | |
| } | |
| return 0; | |
| } |
Subscribe to:
Comments (Atom)
-
/*** Md. Namzul Hasan Shahjalal University of Science & Technology,Sylhet. hasan08sust@gmail.com ***/ #include<bits/stdc++.h...
-
/*** Md. Nazmul Hasan Shahjalal University of Science & Technology,Sylhet. hasan08sust@gmail.com ***/ #include<iostream> #i...
-
/*** Md. Namzul Hasan Shahjalal University of Science & Technology,Sylhet. hasan08sust@gmail.com ***/ #include<bits/stdc++.h...