| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 49324 | ami | Sažetak (COCI17_sazetak) | C++14 | 1089 ms | 620 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define sz(c) int(c.size())
#define rep(i,a,b) for (int i=a; i<(b); ++i)
#define per(i,a,b) for (int i=(b)-1; i>=(a); --i)
using namespace std;
using i64 = long long;
int n,m;
int a[11];
int main() {
cin.tie(0);
ios_base::sync_with_stdio(0);
cout<<fixed<<setprecision(10);
cin>>n>>m;
rep(i,0,m) cin>>a[i];
a[m++]=n;
int res=0;
rep(i,1,n+1) {
bool z=false;
bool o=false;
rep(j,0,m) {
if (i%a[j]==0) z=true;
if (i%a[j]==1) o=true;
}
if (z && o) ++res;
}
cout<<res<<"\n";
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
