# 2015.05.21积分赛题解

``/**         Author: SpringHack - springhack@live.cn         Last modified: 2016-05-15 17:17:57         Filename: main.cpp         Description: Created by SpringHack using vim automatically. **/ #include <iostream> #include <cstdlib> #include <cstdio> #include <cmath> #include <cstring> #include <algorithm>  using namespace std;  #define LL long long  int n, m, minn, maxx, ans; int ta[10005], tb[10005];  int main() {     int i, j;     scanf("%d%d%d%d", &n, &m, &minn, &maxx);     for(i=1;i<=n;++i)         ta[i] = (n - i)*(i - 1);     for(i=1;i<=m;++i)         tb[i] = (m - i)*(i - 1);     for(i=1;i<=n;++i)         for(j=1;j<=m;++j)             if(2*(i + j) >= minn && 2*(i + j) <= maxx)                 ans = (ans + (LL)ta[i]*tb[j]*6%1000000007)%1000000007;     printf("%d", ans);     return 0; } ``

``/**         Author: SpringHack - springhack@live.cn         Last modified: 2016-05-15 18:37:46         Filename: main.cpp         Description: Created by SpringHack using vim automatically. **/ #include <iostream>  using namespace std;  #define MAX(A,B) ((A)>(B)?(A):(B))  int a[1010], dp[1010]; int n, k;  int main() {     while (cin >> n >> k)     {         for (int i=0;i<n;++i)         {             cin >> a[i];             dp[i] = 1;             for (int j=0;j<i;++j)                 if (a[i] > a[j])                     dp[i] = MAX(dp[i],dp[j] + 1);         }         int maxn = 0;         for (int i=0;i<n;++i)             maxn = MAX(maxn,dp[i]);         maxn -= k - 1;         if (maxn > 0)             cout << maxn << endl;         else             cout << "WTF" << endl;     }     return 0; } ``

``/**         Author: SpringHack - springhack@live.cn         Last modified: 2016-05-15 20:27:48         Filename: main.cpp         Description: Created by SpringHack using vim automatically. **/ #include <iostream>  #define N 1005 #define M 10007  using namespace std;  int f[N][N];  int main() {     int a, b, k, n, m, i, j, ans;     cin >> a >> b >> k >> n >> m;     a = a%M;     b = b%M;     for(i=1;i<=k;++i)     {         f[i][i] = f[i][0] = 1;         f[i][1] = i;     }     for(i=3;i<=k;++i)         for(j=2;j<i;++j)             f[i][j] = (f[i - 1][j] + f[i - 1][j - 1])%M;     ans = f[k][m]%M;     for(i=1;i<=n;++i)         ans = (ans*a)%M;     for(i=1;i<=m;++i)         ans = (ans*b)%M;     cout << ans << endl;     return 0; } ``

``/**         Author: SpringHack - springhack@live.cn         Last modified: 2016-05-15 20:45:15         Filename: main.cpp         Description: Created by SpringHack using vim automatically. **/ #include <iostream> #include <cstdio>  using namespace std;  int main() {     int i, sum;     char str[105];     while(scanf("%s", str) && str[0] != '0')     {         sum = 0;         for(i=0;str[i]!='/0';++i)         {             sum = sum*10 + str[i] - '0';             sum = sum%17;         }         printf("%s/n", sum?"0":"1");     }     return 0; } ``