zoukankan      html  css  js  c++  java
  • bzoj2287 [POJ Challenge]消失之物

    题目链接

    少打个else 调半天QAQ

    重点在47行,比较妙

     1 #include<algorithm>
     2 #include<iostream>
     3 #include<cstdlib>
     4 #include<cstring>
     5 #include<cstdio>
     6 #include<string>
     7 #include<cmath>
     8 #include<ctime>
     9 #include<queue>
    10 #include<stack>
    11 #include<map>
    12 #include<set>
    13 #define rre(i,r,l) for(int i=(r);i>=(l);i--)
    14 #define re(i,l,r) for(int i=(l);i<=(r);i++)
    15 #define Clear(a,b) memset(a,b,sizeof(a))
    16 #define inout(x) printf("%d",(x))
    17 #define douin(x) scanf("%lf",&x)
    18 #define strin(x) scanf("%s",(x))
    19 #define LLin(x) scanf("%lld",&x)
    20 #define op operator
    21 #define CSC main
    22 typedef unsigned long long ULL;
    23 typedef const int cint;
    24 typedef long long LL;
    25 using namespace std;
    26 void inin(int &ret)
    27 {
    28     ret=0;int f=0;char ch=getchar();
    29     while(ch<'0'||ch>'9'){if(ch=='-')f=1;ch=getchar();}
    30     while(ch>='0'&&ch<='9')ret*=10,ret+=ch-'0',ch=getchar();
    31     ret=f?-ret:ret;
    32 }
    33 int hh[2020],ans[2020][2020];
    34 int n,c,w[2020]; 
    35 int main()
    36 {
    37     inin(n),inin(c);
    38     re(i,1,n)inin(w[i]);
    39     hh[0]=1;
    40     re(i,1,n)
    41         rre(j,c,w[i])
    42         (hh[j]+=hh[j-w[i]])%=10;
    43     re(i,1,n){re(j,1,c)
    44     {
    45         ans[i][0]=1;
    46         if(j<w[i])ans[i][j]=hh[j];
    47         else ans[i][j]=(hh[j]-ans[i][j-w[i]]+100)%10;
    48         printf("%d",ans[i][j]);
    49     }cout<<"
    ";}
    50      return 0;
    51 }
  • 相关阅读:
    jquery的y一些实用方法
    关于windows cmd 控制台输出中文
    大数据平台数据治理与建设方案
    django+easyui
    pyecharts 学习使用网址
    林业信息化整理 什么是林业信息化及如何进行林业信息化
    django 批量提交
    基于leaflet地图可视化(一)
    FastAPI 学习手册
    Python学习手册
  • 原文地址:https://www.cnblogs.com/HugeGun/p/5273369.html
Copyright © 2011-2022 走看看