Submission #869813

# Submission time Handle Problem Language Result Execution time Memory
869813 2023-11-05T18:08:17 Z rainboy Subway (info1cup19_subway) C
0 / 100
0 ms 348 KB
#include <stdio.h>

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

	scanf("%d", &m);
	n = 0;
	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;
}

Compilation message

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 time Memory Grader output
1 Incorrect 0 ms 348 KB Integer parameter [name=N] equals to 0, violates the range [1, 1000000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer parameter [name=N] equals to 0, violates the range [1, 1000000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer parameter [name=N] equals to 0, violates the range [1, 1000000]
2 Halted 0 ms 0 KB -