제출 #37353

#제출 시각아이디문제언어결과실행 시간메모리
37353IvanCSavrsen (COCI17_savrsen)C++14
120 / 120
2223 ms50844 KiB
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e7 + 2;
bool primo[MAXN];
int vetor[MAXN];
int main(){
	int A,B;
	scanf("%d %d",&A,&B);
	for(int i = 1;i<=B;i++) vetor[i] = i;
	long long resposta = 0;
	for(int i = 1;i<=B;i++){
		if(i >= A) resposta += abs(vetor[i]);
		for(int j = 2*i;j<=B;j+=i){
			vetor[j] -= i;
		}
	}
	printf("%lld\n",resposta);
	return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

savrsen.cpp: In function 'int main()':
savrsen.cpp:8:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&A,&B);
                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...