MSBOP 2015 Round2B register

Ended

Participants:6187

Verdict:AC | RE
Submitted:2015-04-26 14:35:59

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 <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long ll;
#define N 1005
int sex[N],G[N][N];
int main(){
    int T,ca = 1;
    scanf("%d",&T);
    int n,m,u,v,q,z;
    while(T--){
        scanf("%d %d %d",&n,&m,&q);
        memset(G,0,sizeof(G));
        for(int i = 0;i < n;i++) scanf("%d",&sex[i+1]);
        for(int i = 0;i < m;i++){
            scanf("%d %d %d",&u,&v,&z);
            G[u][v] = G[v][u] = z;
        }
        printf("Case #%d:\n", ca++);
        int op;
        while(q--){
            scanf("%d",&op);
            if(op == 1){
                scanf("%d",&u);
                sex[u] = sex[u] ^ 1;
            }
            else if(op == 2){
                scanf("%d %d %d",&u,&v,&z);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX