Submission #772332


Source Code Expand

Copy
#include <stdio.h>
#include <math.h>
#define min_v(a,b) ((a)<(b))?(a):(b)
int main() {
	int n, x, half;
	scanf("%d %d", &n, &x);
	printf("%d", min_v(n - x, x) - 1);
	return 0;
}

Submission Info

Submission Time
Task A - 赤赤赤赤青
User sqrt36
Language C (GCC 5.4.1)
Score 100
Code Size 185 Byte
Status
Exec Time 2 ms
Memory 128 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:6:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &x);
  ^

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
All 100 / 100 sample_01.txt, sample_02.txt, sample_03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt
Case Name Status Exec Time Memory
sample_01.txt 2 ms 128 KB
sample_02.txt 2 ms 128 KB
sample_03.txt 2 ms 128 KB
subtask1_01.txt 2 ms 128 KB
subtask1_02.txt 2 ms 128 KB
subtask1_03.txt 2 ms 128 KB
subtask1_04.txt 2 ms 128 KB
subtask1_05.txt 2 ms 128 KB
subtask1_06.txt 2 ms 128 KB
subtask1_07.txt 2 ms 128 KB
subtask1_08.txt 2 ms 128 KB
subtask1_09.txt 2 ms 128 KB
subtask1_10.txt 2 ms 128 KB