답안 #149709

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
149709 2019-09-01T07:00:29 Z GucciBelt(#3697, PeppaPig, win11905, DodgeBallMan) 함수컵 박물관 (FXCUP4_museum) C++17
100 / 100
452 ms 15080 KB
#include <bits/stdc++.h>
#include "museum.h"
#define long long long 
using namespace std;

map<int, int> Mp[7];
long ans;
int op[] = {1, 1, 1, -1, -1, -1, 1};

long CountSimilarPairs(vector<int> B, vector<int> T, vector<int> G) {
	int n = B.size();
	for(int i = 0; i < n; ++i) {
		vector<int> v(7);
		v[0] = B[i]-1, v[1] = T[i]-1, v[2] = G[i]-1;
		v[3] = v[0] * 100 + v[1]; 
		v[4] = v[0] * 100 + v[2]; 
		v[5] = v[1] * 100 + v[2]; 
		v[6] = v[0] * 10000 + v[1] * 100 + v[2];
		for(int j = 0; j < 7; ++j) {
			ans += op[j] * Mp[j][v[j]]++;
		}
	}
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 384 KB Output is correct
5 Correct 6 ms 512 KB Output is correct
6 Correct 7 ms 512 KB Output is correct
7 Correct 7 ms 640 KB Output is correct
8 Correct 7 ms 512 KB Output is correct
9 Correct 9 ms 896 KB Output is correct
10 Correct 8 ms 768 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 384 KB Output is correct
5 Correct 6 ms 512 KB Output is correct
6 Correct 7 ms 512 KB Output is correct
7 Correct 7 ms 640 KB Output is correct
8 Correct 7 ms 512 KB Output is correct
9 Correct 9 ms 896 KB Output is correct
10 Correct 8 ms 768 KB Output is correct
11 Correct 17 ms 1408 KB Output is correct
12 Correct 22 ms 1152 KB Output is correct
13 Correct 119 ms 5368 KB Output is correct
14 Correct 205 ms 7408 KB Output is correct
15 Correct 330 ms 10224 KB Output is correct
16 Correct 93 ms 5252 KB Output is correct
17 Correct 153 ms 5228 KB Output is correct
18 Correct 299 ms 10096 KB Output is correct
19 Correct 401 ms 15080 KB Output is correct
20 Correct 452 ms 15080 KB Output is correct