Submission #2215323


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define inf 1000000007
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define mt make_tuple

ll a[101010], b[101010], c[101010], ans=0;
int n;

int main(){
cin >> n;
rep(i, 0, n-1)cin >> a[i];
rep(i, 0, n-1)cin >> b[i];
rep(i, 0, n-1)cin >> c[i];
sort(a, a+n);
sort(b, b+n);
sort(c,c+n);

rep(i, 0, n-1){
int l = lower_bound(a, a+n, b[i])-a;
int r = upper_bound(c, c+n, b[i])-c;
ans+=1LL*l*(n-r);
}
cout << ans << endl;
return 0;}

Submission Info

Submission Time
Task C - Snuke Festival
User KazukiMH
Language C++14 (GCC 5.4.1)
Score 300
Code Size 656 Byte
Status AC
Exec Time 144 ms
Memory 2560 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 32
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt AC 143 ms 2560 KB
02.txt AC 143 ms 2560 KB
03.txt AC 120 ms 2560 KB
04.txt AC 118 ms 2560 KB
05.txt AC 82 ms 2560 KB
06.txt AC 82 ms 2560 KB
07.txt AC 70 ms 2560 KB
08.txt AC 70 ms 2560 KB
09.txt AC 59 ms 2560 KB
10.txt AC 59 ms 2560 KB
11.txt AC 56 ms 2560 KB
12.txt AC 56 ms 2560 KB
13.txt AC 140 ms 2560 KB
14.txt AC 141 ms 2560 KB
15.txt AC 138 ms 2560 KB
16.txt AC 138 ms 2560 KB
17.txt AC 142 ms 2560 KB
18.txt AC 139 ms 2560 KB
19.txt AC 144 ms 2560 KB
20.txt AC 55 ms 2560 KB
21.txt AC 55 ms 2560 KB
22.txt AC 135 ms 2560 KB
23.txt AC 137 ms 2560 KB
24.txt AC 139 ms 2560 KB
25.txt AC 139 ms 2560 KB
26.txt AC 1 ms 256 KB
27.txt AC 1 ms 256 KB
28.txt AC 1 ms 256 KB
29.txt AC 1 ms 256 KB
s1.txt AC 1 ms 256 KB
s2.txt AC 1 ms 256 KB
s3.txt AC 1 ms 256 KB