AtCoder Regular Contest 068

Submission #4035094

Source codeソースコード

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
using namespace std;
int n,m,c[100050];
int main() {
	scanf("%d%d",&n,&m);
	int i,l,r;
	while(n--) {
		scanf("%d%d",&l,&r);l--;
		int lim=l,lst=0;
		for(i=1;i<=lim;i=lst+1) {
			lst=min(l/(l/i),r/(r/i));
			if(r/i-1>=l/i)c[i]++,c[lst+1]--;
		}
		c[lst+1]++,c[r+1]--;
	}for(i=1;i<=m;i++)c[i]+=c[i-1],printf("%d\n",c[i]);
}

Submission

Task問題 E - Snuke Line
User nameユーザ名 ibuki_suika
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 AC
Score得点 700
Source lengthソースコード長 418 Byte
File nameファイル名
Exec time実行時間 1025 ms
Memory usageメモリ使用量 1280 KB

Compiler messageコンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:8:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&n,&m);
^
./Main.cpp:11:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&l,&r);l--;
^

Test case

Set

Set name Score得点 / Max score Cases
Sample - 00_example_01.txt,00_example_02.txt
All 700 / 700 00_example_01.txt,00_example_02.txt,01.txt,02.txt,03.txt,04.txt,05.txt,06.txt,07.txt,08.txt,09.txt,10.txt,11.txt,12.txt,13.txt,14.txt,15.txt,16.txt,17.txt,18.txt,19.txt,20.txt,21.txt,22.txt,23.txt,24.txt,25.txt,26.txt,27.txt,28.txt,29.txt,30.txt,31.txt,32.txt,33.txt,34.txt,35.txt,36.txt,37.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
00_example_01.txt AC 1 ms 128 KB
00_example_02.txt AC 1 ms 128 KB
01.txt AC 1 ms 128 KB
02.txt AC 1 ms 128 KB
03.txt AC 1 ms 128 KB
04.txt AC 1 ms 128 KB
05.txt AC 1 ms 128 KB
06.txt AC 1 ms 128 KB
07.txt AC 1 ms 128 KB
08.txt AC 1 ms 128 KB
09.txt AC 1 ms 128 KB
10.txt AC 1 ms 128 KB
11.txt AC 623 ms 512 KB
12.txt AC 717 ms 1152 KB
13.txt AC 289 ms 256 KB
14.txt AC 245 ms 128 KB
15.txt AC 245 ms 128 KB
16.txt AC 579 ms 512 KB
17.txt AC 715 ms 1152 KB
18.txt AC 202 ms 128 KB
19.txt AC 714 ms 1152 KB
20.txt AC 718 ms 1152 KB
21.txt AC 715 ms 1152 KB
22.txt AC 717 ms 1152 KB
23.txt AC 716 ms 1152 KB
24.txt AC 919 ms 896 KB
25.txt AC 574 ms 256 KB
26.txt AC 332 ms 128 KB
27.txt AC 1025 ms 1024 KB
28.txt AC 610 ms 256 KB
29.txt AC 950 ms 1024 KB
30.txt AC 793 ms 256 KB
31.txt AC 211 ms 1280 KB
32.txt AC 203 ms 256 KB
33.txt AC 194 ms 256 KB
34.txt AC 568 ms 1280 KB
35.txt AC 575 ms 1280 KB
36.txt AC 1 ms 128 KB
37.txt AC 9 ms 768 KB