[Offer收割]编程练习赛1 register

Ended

Participants:955

Verdict:Accepted
Score:100 / 100
Submitted:2016-03-06 16:05:52

Lang:G++

Edit
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
#include <stdio.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
long long n, m, K, t;
long long a[105], b[12][105];
long long dp[12][10005];
bool check()
{
    for(int i = 2; i <= n; i++)
    for(int j = 0; j < m; j++)
        b[i][j] = b[i-1][j] / t;
    /*printf("\n*********\n");
    for(int i = 1; i <= n; i++)
    {
        for(int j = 0; j < m; j++)
            printf("%d ", b[i][j]);
        printf("\n");
    }
    printf("*********\n");*/
    for(int j = 0; j < m; j++)
        if(b[n][j] != 0) return true;
    return false;
}
long long solve()
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX