Download uva_cpp_clean/10050/10050-5.cpp from slayone/uva_spoj_raw: direct link, hf CLI and curl.
- Browser
- Download file 5.16 kB
-
https://huggingface.co/datasets/slayone/uva_spoj_raw/resolve/main/uva_cpp_clean/10050/10050-5.cpp
- Command line
-
hf download hf://datasets/slayone/uva_spoj_raw/uva_cpp_clean/10050/10050-5.cpp
-
curl -L -o 10050-5.cpp https://huggingface.co/datasets/slayone/uva_spoj_raw/resolve/main/uva_cpp_clean/10050/10050-5.cpp
5.16 kB
| /****************************************************************** | |
| *** Problem : *** | |
| *** Author : Shipu Ahamed (Psycho Timekiller) *** | |
| *** E-mail : shipuahamed01@gmail.com *** | |
| *** University : BUBT,Dept. of CSE *** | |
| *** Team : BUBT_Psycho *** | |
| *** My Blog : http://shipuahamed.blogspot.com *** | |
| *** Facebook : http://www.facebook.com/DeesheharaShipu *** | |
| ******************************************************************/ | |
| using namespace std; | |
| //input | |
| //Output | |
| typedef long long ll; | |
| typedef unsigned long long ull; | |
| typedef vector<int> vi; | |
| typedef vector<ll> vll; | |
| typedef vector<string> vs; | |
| typedef set<int> si; | |
| typedef set<string> ss; | |
| typedef map<int,int> mii; | |
| typedef map<ll,ll> mll; | |
| typedef map<string,int> msi; | |
| typedef map<char,int> mci; | |
| template <typename T>string toString( T Number ){stringstream st;st << Number;return st.str();} | |
| template <typename T> T SOD(T n) {__typeof(n) sum=0;for(__typeof(n) i=1;i*i<=n;i++)sum+=(n%i)?0:((i*i==n)?i:i+n/i);return sum;} | |
| //For Define | |
| //File input/output | |
| //upper bound and lower bound | |
| //Test Case & New line | |
| int stringconvert(string s){int p; istringstream st(s); st>>p ; return p;} | |
| ll pow(ll a,ll b, ll m) { ll res = 1; while(b) { if(b & 1) { res = ( (res % m) * (a % m) ) %m ; } a= ((a%m) * (a%m)) %m; b >>= 1; } return res; } | |
| ll modInverse(ll a, ll m){return pow(a,m-2,m);} | |
| ////============ CONSTANT ===============//// | |
| ////=====================================//// | |
| int visit[3700]; | |
| int main() | |
| { | |
| int t; | |
| si(t); | |
| while(t--) | |
| { | |
| int n,p; | |
| sii(n,p); | |
| int cnt=0; | |
| while(p--) | |
| { | |
| int x; | |
| si(x); | |
| for(int i=x;i<=n;i+=x) | |
| { | |
| if(i%7!=6 && i%7!=0 && visit[i]!=1) | |
| { | |
| visit[i]=1; | |
| cnt++; | |
| } | |
| } | |
| } | |
| P(cnt); | |
| cover(visit,0); | |
| } | |
| return 0; | |
| } | |