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

Ended

Participants:154

Verdict:Accepted
Score:100 / 100
Submitted:2018-04-08 12:45:48

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 <algorithm>
#include <deque>
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
int remainde[1000000 + 5], result[1000000 + 5];
void printRes(int M, int N) {
    int i, j;
    int temp, flag = 0;
    //  
    for (i = 0; i<1000000; i++) {
        remainde[i] = 0;
        result[i] = 0;
    }
    for (i = 0; i<1000000; i++) {
        result[i] = M / N;
        temp = M % N;
        remainde[i] = temp;
        for (j = 0; j<i; j++) {
            if ((temp == remainde[j]) || (temp == 0)) {
                //  
                flag = 1;
                break;
            }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX