# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|
148934 | | Seishun Buta Yarou wa Yumemiru Shoujo no Yume wo Minai (#200) | 함수컵 박물관 (FXCUP4_museum) | C++17 | | 93 ms | 10092 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "museum.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef unsigned long long ull;
typedef long double ld;
typedef tree<ii, null_type, less<ii>, rb_tree_tag, tree_order_statistics_node_update> pbds;
int ma[3][111];
int freq[3][111][111];
int s[111][111][111];
ll c(ll n)
{
return (n*(n-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++)
{
ma[0][B[i]]++;
ma[1][T[i]]++;
ma[2][G[i]]++;
freq[0][T[i]][G[i]]++;
freq[1][G[i]][B[i]]++;
freq[2][B[i]][T[i]]++;
s[B[i]][T[i]][G[i]]++;
}
ll ans = 0;
for(int i=0;i<102;i++)
{
for(int j=0;j<3;j++)
{
ans+=c(ma[j][i]);
}
}
for(int a=0;a<3;a++)
{
for(int i=0;i<102;i++)
{
for(int j=0;j<102;j++)
{
ans-=c(freq[a][i][j]);
}
}
}
for(int i=0;i<102;i++)
{
for(int j=0;j<102;j++)
{
for(int k=0;k<102;k++)
{
ans+=c(s[i][j][k]);
}
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |