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

Ended

Participants:955

Verdict:Accepted
Score:100 / 100
Submitted:2016-03-06 15:53:43

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 <iostream>
#include <vector>
#include <algorithm>
#include <limits.h>
using namespace std;
int main() {
    int Q;
    cin >> Q;
    while(Q--) {
        int result = 0;
        int N, M, K, T;
        cin >> N >> M >> K >> T;
        vector<int> A(M);
        vector<int> B(M);
        for (int i = 0; i < M; ++i) {
            cin >> A[i];
        }
        for (int i = 0; i < M; ++i) {
            cin >> B[i];
        }
        int flag = true;
        for (int step = 1; step <= N; ++step) {
            bool Ball0 = true;
            for (int i = 0; i < M; ++i) {
                if (B[i] != 0) {
                    Ball0 = false;
                    break;
                }
            }
            if (Ball0) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX