답안 #56267

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
56267 2018-07-10T20:16:07 Z hamzqq9 Sažetak (COCI17_sazetak) C++14
64 / 160
500 ms 66560 KB
#include<bits/stdc++.h>
#define lf double
#define ll long long
#define ull unsigned ll
#define ii pair<int,int>
#define li pair<ll,int>
#define iii pair<ii,int>
#define iiii pair<ii,ii>
#define iiii2 pair<int,iii>
#define lii pair<ll,ii>
#define lolo pair<ll,ll>
#define heap priority_queue
#define mp make_pair
#define st first
#define nd second
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define all(x) x.begin(),x.end()
#define len(x) strlen(x)
#define sz(x) (int) x.size()
#define orta ((bas+son)/2)
#define min3(x,y,z) min(min(x,y),z)
#define max3(x,y,z) max(max(x,y),z)
#define umin(x,y) x=min(x,y)
#define umax(x,y) x=max(x,y)
#define dbgs(x) cerr<<(#x)<<" --> "<<(x)<<" "
#define dbg(x) cerr<<(#x)<<" --> "<<(x)<<endl;getchar()
#define MOD 1000000007
#define inf 1000000001
#define N 50000005
#define LOG 20
#define magic 100
#define MAX 1000005
#define KOK 350
#define EPS 0.000000000001
#define pw(x) (1<<(x))
#define PI 3.1415926535
using namespace std;

int n,m,x,ans;
bool able[N];

int main() {

	#if 0	
	freopen("input.txt","r",stdin);

	#endif

	scanf("%d %d",&n,&m);

	for(int i=1;i<=m;i++) {

		scanf("%d",&x);

		for(int j=x;j<=n;j+=x) able[j]=1;

	}

	able[0]=able[n]=1;

	for(int i=1;i<=n;i++) {

		ans+=able[i]&able[i-1];

	}

	printf("%d",ans);

}

Compilation message

sazetak.cpp: In function 'int main()':
sazetak.cpp:52:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&n,&m);
  ~~~~~^~~~~~~~~~~~~~~
sazetak.cpp:56:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&x);
   ~~~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 248 KB Output is correct
2 Correct 3 ms 360 KB Output is correct
3 Correct 10 ms 4568 KB Output is correct
4 Correct 13 ms 5192 KB Output is correct
5 Runtime error 481 ms 66560 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 465 ms 66560 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 439 ms 66560 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 526 ms 66560 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 479 ms 66560 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 440 ms 66560 KB Execution killed with signal 11 (could be triggered by violating memory limits)