【CodeForces】[638A]Home Numbers

原创 2016年06月01日 01:53:59

这里写图片描述

找规律之后一句话秒杀

#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;
}

题目地址:【CodeForces】[638A]Home Numbers

版权声明:BoilTask的原创文章,转载前请联系一下吧~

相关文章推荐

Codeforces 638A:Home Numbers(规律)

A. Home Numbers time limit per test 1 second memory limit per test 256 megabytes input s...
  • zugofn
  • zugofn
  • 2016年06月05日 23:27
  • 184

【动态规划】【数位DP】[Codeforces 55 D]Beautiful numbers

题目描述Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer ...

codeforces-55D-Beautiful numbers(数位DP)

 A - Beautiful numbers Time Limit:4000MS     Memory Limit:262144KB     64bit IO Format:%...

【Codeforces 817 C. Really Big Numbers】+ 构造

C. Really Big Numbers time limit per test1 second memory limit per test256 megabytes inputstandar...

Codeforces Round #235 (Div. 2) D. Roman and Numbers(状压dp)

Roman and Numbers time limit per test 4 seconds memory limit per test 512 megabytes ...

Codeforces Round #136 (Div. 2) / 221B Little Elephant and Numbers (数论)

a

Codeforces Round #226 (Div. 2)--C. Bear and Prime Numbers

C. Bear and Prime Numbers time limit per test 2 seconds memory limit per test 512 megaby...

【打CF,学算法——二星级】CodeForces 96B Lucky Numbers (构造/dfs)

题目链接:CF 96B 题面: B. Lucky Numbers (easy) time limit per test 2 seconds memory limit per t...

Codeforces Round #FF (Div. 2) E. DZY Loves Fibonacci Numbers(斐波那契的定理+线段树)

/*   充分利用了菲波那切数列的两条定理:    ①定义F[1] = a, F[2] = b, F[n] = F[n - 1] + F[n - 2](n≥3)。         有F[n] =...

codeforces 414A Mashmokh and Numbers 模拟题

Description It’s holiday. Mashmokh and his boss, Bimokh, are playing a game invented by Mashmokh.In...
  • wilver
  • wilver
  • 2015年12月01日 20:58
  • 155
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:【CodeForces】[638A]Home Numbers
举报原因:
原因补充:

(最多只允许输入30个字)