【CodeForces】[638A]Home Numbers
找规律之后一句话秒杀
#include<stdio.h>
int main() {
int n,a;
while(scanf("%d %d",&n,&a)!=EOF)
printf("%d\n",a&1?(a-1)/2+1:(n-a)/2+1);
return 0;
}
找规律之后一句话秒杀
#include<stdio.h>
int main() {
int n,a;
while(scanf("%d %d",&n,&a)!=EOF)
printf("%d\n",a&1?(a-1)/2+1:(n-a)/2+1);
return 0;
}