zoukankan      html  css  js  c++  java
  • Codeforces 1023 B.Pair of Toys (Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Fi)

    B. Pair of Toys

    智障题目(嘤嘤嘤~)

    代码:

     1 //B
     2 #include<iostream>
     3 #include<cstdio>
     4 #include<cstring>
     5 #include<algorithm>
     6 #include<bitset>
     7 #include<cassert>
     8 #include<cctype>
     9 #include<cmath>
    10 #include<cstdlib>
    11 #include<ctime>
    12 #include<deque>
    13 #include<iomanip>
    14 #include<list>
    15 #include<map>
    16 #include<queue>
    17 #include<set>
    18 #include<stack>
    19 #include<vector>
    20 using namespace std;
    21 typedef long long ll;
    22 
    23 const double PI=acos(-1.0);
    24 const double eps=1e-6;
    25 const ll mod=1e9+7;
    26 const int inf=0x3f3f3f3f;
    27 const int maxn=1e5+10;
    28 const int maxm=100+10;
    29 #define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    30 
    31 int main()
    32 {
    33     ll n,m;
    34     scanf("%lld%lld",&n,&m);
    35     if(2*n-1<m)
    36         cout<<"0"<<endl;
    37     else{
    38         ll ans;
    39         if(n>=m){
    40             if(m%2==0)
    41                 ans=m/2-1;
    42             else
    43                 ans=m/2;
    44         }
    45         else{
    46             ans=n-m/2;
    47         }
    48         cout<<ans<<endl;
    49     }
    50 }
  • 相关阅读:
    mysql常用函数
    主程Ry访谈录
    mongodb spring anno 查询
    mongodb 查询少少优化
    jquery table thead drop
    ubuntu 配置java,eclipse ,flex,zend,php,TomCat环境
    mongodb shell
    TCP/IP Sockets in Java 源码
    java 断点下载
    直线生成 DDA
  • 原文地址:https://www.cnblogs.com/ZERO-/p/9703706.html
Copyright © 2011-2022 走看看