Submission #869813

#TimeUsernameProblemLanguageResultExecution timeMemory
869813rainboySubway (info1cup19_subway)C11
0 / 100
0 ms348 KiB
#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 (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...