Untitled
unknown
plain_text
21 days ago
2.5 kB
10
Indexable
Never
#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif #include <stdio.h> extern void init(int N, int K, int mRoadAs[], int mRoadBs[], int mLens[]); extern void addRoad(int mRoadA, int mRoadB, int mLen); extern int findPath(int mStart, int mEnd, int M, int mStops[]); #define MAX_K 1000 #define MAX_M 5 #define CMD_INIT 1 #define CMD_ADD 2 #define CMD_FIND 3 static bool run() { int query_num; scanf("%d", &query_num); int ans; bool ok = false; for (int q = 0; q < query_num; q++) { int query; scanf("%d", &query); if (query == CMD_INIT) { int N, K; int mRoadAs[MAX_K]; int mRoadBs[MAX_K]; int mLens[MAX_K]; scanf("%d %d", &N, &K); for (int i = 0; i < K; i++) scanf("%d", &mRoadAs[i]); for (int i = 0; i < K; i++) scanf("%d", &mRoadBs[i]); for (int i = 0; i < K; i++) scanf("%d", &mLens[i]); init(N, K, mRoadAs, mRoadBs, mLens); ok = true; } else if (query == CMD_ADD) { int mRoadA, mRoadB, mLen; scanf("%d %d %d", &mRoadA, &mRoadB, &mLen); addRoad(mRoadA, mRoadB, mLen); } else if (query == CMD_FIND) { int mStart, mEnd, M; int mStops[MAX_M]; scanf("%d %d %d", &mStart, &mEnd, &M); for (int i = 0; i < M; i++) scanf("%d", &mStops[i]); int ret = findPath(mStart, mEnd, M, mStops); scanf("%d", &ans); if (ans != ret) { ok = false; } } } return ok; } int main() { setbuf(stdout, NULL); // freopen("sample_input.txt", "r", stdin); int T, MARK; scanf("%d %d", &T, &MARK); for (int tc = 1; tc <= T; tc++) { int score = run() ? MARK : 0; printf("#%d %d\n", tc, score); } return 0; } //--------------- void init(int N, int K, int mRoadAs[], int mRoadBs[], int mLens[]) { } void addRoad(int mRoadA, int mRoadB, int mLen) { } int findPath(int mStart, int mEnd, int M, int mStops[]) { return 0; } //----------------- 12 1 7 10 1 1 1 2 2 3 3 4 4 5 2 4 5 3 4 4 6 5 6 6 1 1 3 1 4 1 3 3 1 5 3 1 7 1 2 -1 2 4 7 4 3 1 7 1 2 7 3 2 1 2 5 7 16 3 1 5 3 6 4 2 8 3 1 4 3 2 5 6 13 3 4 1 3 2 5 6 13 3 1 4 3 2 3 7 -1 3 5 2 1 4 5 2 3 7 8 3 1 4 3 2 3 7 14
Leave a Comment