果然NOIP的题目是出的越来越有水平了呢
我果然是生不逢时啊。。若干年前题目水还可以保送
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
// <matches.cpp> - 02/29/16 22:12:20 // This file is created by XuYike's black technology automatically. // Copyright (C) 2015 ChangJun High School, Inc. // I don't know what this program is. #include <iostream> #include <vector> #include <algorithm> #include <cstring> #include <cstdio> #include <cmath> using namespace std; typedef long long lol; int getint(){ int res=0,fh=1;char ch=getchar(); while((ch>'9'||ch<'0')&&ch!='-')ch=getchar(); if(ch=='-')fh=-1,ch=getchar(); while(ch>='0'&&ch<='9')res=res*10+ch-'0',ch=getchar(); return fh*res; } int c[10]={6,2,5,5,4,5,6,3,7,6}; int g(int x){ int tot=0; if(x/100)tot+=c[x/100];x%=100; if(tot||x/10)tot+=c[x/10];x%=10; tot+=c[x]; return tot; } int main(){ freopen("matches.in","r",stdin); freopen("matches.out","w",stdout); int n=getint(),ans=0; for(int i=0;i<=999;i++) for(int j=0;j<=999-i;j++) if(g(i)+g(j)+g(i+j)==n-4)ans++; printf("%d",ans); return 0; } |