답안 #148902

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
148902 2019-09-01T05:20:42 Z お前はもう死んでいる(#3784, kuroni, nvmdava, tfg) 함수컵 박물관 (FXCUP4_museum) C++17
100 / 100
97 ms 9600 KB
#include "museum.h"

int cnt[105][105][105];
long long res = 0;
long long get(long long s){
	return s * (s - 1) / 2;
}
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {

	int n = B.size();
	for(int i = 0; i < n; i++){
		int a = B[i];
		int b = T[i];
		int c = G[i];
		cnt[a][0][0]++;
		cnt[0][b][0]++;
		cnt[0][0][c]++;
		cnt[a][b][0]++;
		cnt[0][b][c]++;
		cnt[a][0][c]++;
		cnt[a][b][c]++;
	}

	for(int i = 0; i <= 100; i++){
		for(int j = 0; j <= 100; j++){
			for(int l = 0; l <= 100; l++){
				int t = 3;
				if(i == 0) t--;
				if(j == 0) t--;
				if(l == 0) t--;
				res += (t % 2 == 1 ? 1 : -1) * get(cnt[i][j][l]);
			}
		}
	}

	return res;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 384 KB Output is correct
2 Correct 8 ms 384 KB Output is correct
3 Correct 8 ms 384 KB Output is correct
4 Correct 10 ms 640 KB Output is correct
5 Correct 9 ms 2048 KB Output is correct
6 Correct 8 ms 2432 KB Output is correct
7 Correct 10 ms 3328 KB Output is correct
8 Correct 9 ms 512 KB Output is correct
9 Correct 10 ms 4352 KB Output is correct
10 Correct 11 ms 4224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 384 KB Output is correct
2 Correct 8 ms 384 KB Output is correct
3 Correct 8 ms 384 KB Output is correct
4 Correct 10 ms 640 KB Output is correct
5 Correct 9 ms 2048 KB Output is correct
6 Correct 8 ms 2432 KB Output is correct
7 Correct 10 ms 3328 KB Output is correct
8 Correct 9 ms 512 KB Output is correct
9 Correct 10 ms 4352 KB Output is correct
10 Correct 11 ms 4224 KB Output is correct
11 Correct 12 ms 4864 KB Output is correct
12 Correct 20 ms 1152 KB Output is correct
13 Correct 47 ms 5620 KB Output is correct
14 Correct 42 ms 6900 KB Output is correct
15 Correct 59 ms 7788 KB Output is correct
16 Correct 88 ms 5228 KB Output is correct
17 Correct 83 ms 5356 KB Output is correct
18 Correct 88 ms 6504 KB Output is correct
19 Correct 96 ms 9580 KB Output is correct
20 Correct 97 ms 9600 KB Output is correct