제출 #869815

#제출 시각아이디문제언어결과실행 시간메모리
869815rainboySubway (info1cup19_subway)C11
100 / 100
5 ms860 KiB
#include <stdio.h>

int main() {
	int n, m, i;

	scanf("%d", &m);
	n = 1;
	while (n * (n - 1) / 2 < m)
		n++;
	printf("%d\n", n);
	for (i = 0; i < n - 1; i++)
		printf("%d %d\n", i, i - 1);
	printf("%d %d\n", n - 1, m - 1 - (n - 1) * (n - 2) / 2);
	return 0;
}

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

subway.c: In function 'main':
subway.c:6:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  scanf("%d", &m);
      |  ^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...