zoukankan      html  css  js  c++  java
  • AtCoder Crackers——水题

    题目描述

    Takahashi has decided to distribute N AtCoder Crackers to K users of as evenly as possible. When all the crackers are distributed, find the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.

    Constraints
    ·1≤N,K≤100
    ·All values in input are integers.

    输入

    Input is given from Standard Input in the following format:
    N K

    输出

    Print the minimum possible (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user.

    样例输入

    7 3

    样例输出

    1

    提示

    When the users receive two, two and three crackers, respectively, the (absolute) difference between the largest number of crackers received by a user and the smallest number received by a user, is 1.

    虽然是水题,但还是先解释一波
    能够整除的情况下,就是0,不能整除的情况下就是1
    代码:

    #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
    #pragma GCC optimize("Ofast")
    #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
    #pragma comment(linker, "/stack:200000000")
    #pragma GCC optimize (2)
    #pragma G++ optimize (2)
    #include <bits/stdc++.h>
    #include <algorithm>
    #include <map>
    #include <queue>
    #include <set>
    #include <stack>
    #include <string>
    #include <vector>
    using namespace std;
    #define wuyt main
    typedef long long ll;
    #define HEAP(...) priority_queue<__VA_ARGS__ >
    #define heap(...) priority_queue<__VA_ARGS__,vector<__VA_ARGS__ >,greater<__VA_ARGS__ > >
    template<class T> inline T min(T &x,const T &y){return x>y?y:x;}
    template<class T> inline T max(T &x,const T &y){return x<y?y:x;}
    //#define getchar()(p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)
    //char buf[(1 << 21) + 1], *p1 = buf, *p2 = buf;
    ll read(){ll c = getchar(),Nig = 1,x = 0;while(!isdigit(c) && c!='-')c = getchar();
    if(c == '-')Nig = -1,c = getchar();
    while(isdigit(c))x = ((x<<1) + (x<<3)) + (c^'0'),c = getchar();
    return Nig*x;}
    #define read read()
    const ll inf = 1e15;
    const int maxn = 2e5 + 7;
    const int mod = 1e9 + 7;
    #define start int wuyt()
    #define end return 0
    start{
        int n=read,k=read;
        if(n%k==0) printf("0
    ");
        else printf("1
    ");
        end;
    }
    
  • 相关阅读:
    设置VS&IE8控件调试
    VR模型优化技巧
    MFC的资源切换AFX_MANAGE_STATE (转载)
    3D图形学资源收集
    关于C++运算符重载
    Valve(维尔福软件公司) Half Life(半条命) CS(反恐精英)
    MySQL导入SQL文件及常用命令
    折磨了我3天的IIS服务器不能运行asp页面故障
    3721奇遇
    SMS2.0软件测量及出现的故障
  • 原文地址:https://www.cnblogs.com/PushyTao/p/13144204.html
Copyright © 2011-2022 走看看