Submission #1338456
Source Code Expand
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
P a[200000];
int cnt[2];
int main() {
int n; scanf("%d", &n);
rep(i, n)scanf("%d", &a[i].first);
rep(i, n)scanf("%d", &a[n + i].first), a[n + i].second = 1;
sort(a, a + 2 * n);
ll ans = 1;
rep(i, 2 * n) {
if (cnt[!a[i].second]) {
ans *= cnt[!a[i].second]; cnt[!a[i].second]--;
}
else cnt[a[i].second]++;
}
printf("%lld\n", ans);
}
Submission Info
Submission Time |
|
Task |
A - 1D Matching |
User |
autumn_eel |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
524 Byte |
Status |
WA |
Exec Time |
40 ms |
Memory |
1792 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:11:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
int n; scanf("%d", &n);
^
./Main.cpp:12:35: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
rep(i, n)scanf("%d", &a[i].first);
^
./Main.cpp:13:60: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
rep(i, n)scanf("%d", &a[n + i].first), a[n + i].second = 1;
^
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 500 |
Status |
|
|
Set Name |
Test Cases |
Sample |
example0.txt, example1.txt |
All |
000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, example0.txt, example1.txt |
Case Name |
Status |
Exec Time |
Memory |
000.txt |
WA |
24 ms |
1152 KB |
001.txt |
WA |
9 ms |
640 KB |
002.txt |
WA |
12 ms |
768 KB |
003.txt |
WA |
14 ms |
768 KB |
004.txt |
WA |
35 ms |
1664 KB |
005.txt |
WA |
39 ms |
1792 KB |
006.txt |
WA |
39 ms |
1792 KB |
007.txt |
WA |
39 ms |
1792 KB |
008.txt |
WA |
39 ms |
1792 KB |
009.txt |
WA |
40 ms |
1792 KB |
010.txt |
WA |
38 ms |
1792 KB |
011.txt |
AC |
39 ms |
1792 KB |
example0.txt |
AC |
1 ms |
256 KB |
example1.txt |
AC |
1 ms |
256 KB |