Algorithm Analysis
The number of runners who finished equals a – b.
Since a, b ≤ , it is necessary to use the long long type.
Algorithm Implementation
Read the input data. Calculate and output the answer a – b.
scanf("%lld %lld", &a, &b); res = a - b; printf("%lld\n", res);
Java Implementation
import java.util.*; public class Main { public static void main(String[] args) { Scanner con = new Scanner(System.in); long a = con.nextLong(); long b = con.nextLong(); long res = a - b; System.out.println(res); con.close(); } }
Python Implementation
a, b = map(int, input().split()) res = a - b print(res)