zoukankan      html  css  js  c++  java
  • POJ 1017: Packets

    #include <iostream>
    #include <string>
    #include <cstdio>
    #include <cmath>
    #include <cstring>
    #include <algorithm>
    #include <vector>
    #include <queue>
    #include <deque>
    #include <map>
    #define range(i,a,b) for(int i=a;i<=b;++i)
    #define LL long long
    #define rerange(i,a,b) for(int i=a;i>=b;--i)
    #define fill(arr,tmp) memset(arr,tmp,sizeof(arr))
    using namespace std;
    int num[]={0,5,3,1},pro[6];
    void init(){
    
    }
    void solve(){
        while(true){
            bool flag=false;
            range(i,0,5){
                cin>>pro[i];
                if(pro[i]>0)flag=true;
            }
            if(!flag)break;
            int pack=pro[5]+pro[4]+pro[3]+(pro[2]+3)/4;
            int twos=pro[3]*5+num[pro[2]%4];
            if(pro[1]>twos)pack+=(pro[1]-twos+8)/9;
            int ones=36*pack-36*pro[5]-25*pro[4]-16*pro[3]-9*pro[2]-4*pro[1];
            if(pro[0]>ones)pack+=(pro[0]-ones+35)/36;
            cout<<pack<<endl;
        }
    }
    int main() {
        init();
        solve();
        return 0;
    }
    View Code
  • 相关阅读:
    (一)版本控制管理器之发展史
    Mysql的binlog日志与mysqlbinlog命令
    centos下mysql中table大小写改为不敏感
    「Flink」RocksDB介绍以及Flink对RocksDB的支持
    redis事务
    零基础转行学习大数据技术需要经过哪些学习步骤?
    SQL Server解惑&mdash;&mdash;对象命名的唯一性小结
    泡泡后台Couchbase缓存使用经验分享
    MySQL_索引原理
    《分布式与云计算》MOOC第三单元课后测试答案
  • 原文地址:https://www.cnblogs.com/Rhythm-/p/9339066.html
Copyright © 2011-2022 走看看