Submission #42367

# Submission time Handle Problem Language Result Execution time Memory
42367 2018-02-26T14:04:45 Z milmillin Savrsen (COCI17_savrsen) C++14
30 / 120
1640 ms 39876 KB
#include <cstdio>

using namespace std;

int tbl[10000100];

int main () {
	for (int i=1;i<10000100;i++) {
		tbl[i]=i;
	}
	for (int i=1;i<10000100;i++) {
		for (int j=i+i;j<10000100;j+=i) {
			tbl[j]-=i;
		}
	}
	for (int i=1;i<10000100;i++) {
		if (tbl[i]<0) tbl[i]=-tbl[i];
		tbl[i]+=tbl[i-1];
	}
	int a,b;
	scanf("%d%d",&a,&b);
	printf("%d\n",tbl[b]-tbl[a-1]);
	return 0;
}

Compilation message

savrsen.cpp: In function 'int main()':
savrsen.cpp:21:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&a,&b);
                     ^
# Verdict Execution time Memory Grader output
1 Correct 1638 ms 39544 KB Output is correct
2 Correct 1640 ms 39672 KB Output is correct
3 Incorrect 1565 ms 39776 KB Output isn't correct
4 Incorrect 1562 ms 39776 KB Output isn't correct
5 Incorrect 1581 ms 39776 KB Output isn't correct
6 Incorrect 1596 ms 39776 KB Output isn't correct
7 Incorrect 1594 ms 39776 KB Output isn't correct
8 Incorrect 1564 ms 39876 KB Output isn't correct