# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
485086 | kshitij_sodani | Sažetak (COCI17_sazetak) | C++14 | 1098 ms | 204 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
#define endl '\n'
llo n;
llo it[11];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>n;
llo k;
cin>>k;
for(llo i=0;i<k;i++){
cin>>it[i];
}
llo ans=0;
for(llo i=1;i<=n;i++){
llo st=0;
llo st2=0;
if(i==n){
st=1;
}
for(llo j=0;j<k;j++){
llo x=i%it[j];
if(x==0){
st=1;
}
else if(x==1){
st2=1;
}
}
if(st==1 and st2==1){
ans++;
}
}
cout<<ans<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |