// NOTE: it is recommended to use this even if you don't understand the following code. #include #include #include #include #define MAXM 200000 #define MAXQ 50000 int M, N, Q, i; int A[MAXM], B[MAXM], C[MAXM]; // event i: T[i] = 1 -> X[i], K[i], V[i]; T[i] = 2 -> L[i], R[i] int T[MAXQ], X[MAXQ], K[MAXQ], V[MAXQ], L[MAXQ], R[MAXQ]; long long Answer[MAXQ]; // the answer of each type 2 event int main() { // uncomment the two following lines if you want to read/write from files // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); assert(3 == scanf("%d%d%d", &N, &M, &Q)); for (i = 0; i < M; ++i) assert(3 == scanf("%d%d%d", &A[i], &B[i], &C[i])); for (i = 0; i < Q; ++i) { assert(1 == scanf("%d", &T[i])); if (T[i] == 1) assert(3 == scanf("%d%d%d", &X[i], &K[i], &V[i])); else assert(2 == scanf("%d%d", &L[i], &R[i])); Answer[i] = 0; } // INSERT YOUR CODE HERE for (i = 0; i < Q; ++i) if (T[i] == 2) printf("%lld\n", Answer[i]); return 0; }