Submission #2011433
Source Code Expand
#include "bits/stdc++.h"
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,n,0)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define pb push_back
using namespace std;
using ll = long long;
using P = pair<int,int>;
const int mod=1e9+7,INF=1<<30;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll LINF=1LL<<60, lmod = 1e9+7;
const int MAX_N = 100005;
ll fact[MAX_N];
int right[2*MAX_N];
vector<P> vec;
int main(){
ll N; cin >> N;
rep(i,N){
int a; scanf("%d",&a);
vec.pb(P(a,1));
}
rep(i,N){
int a; scanf("%d",&a);
vec.pb(P(a,-1));
}
sort(ALL(vec));
ll ans = 1LL;
ll cnt = 0;
rrep(i,2*N-1){
if(vec[i].second==-1) cnt++;
else{
(ans *= cnt) %= lmod;
cnt--;
}
}
cout << ans << endl;
return 0;
}
Submission Info
Submission Time
2018-01-23 17:55:08+0900
Task
A - 1D Matching
User
kurarrr
Language
C++14 (GCC 5.4.1)
Score
0
Code Size
953 Byte
Status
WA
Exec Time
41 ms
Memory
2420 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:28:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
int a; scanf("%d",&a);
^
./Main.cpp:32:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
int a; scanf("%d",&a);
^
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
25 ms
1400 KB
001.txt
WA
10 ms
892 KB
002.txt
WA
13 ms
892 KB
003.txt
WA
15 ms
1400 KB
004.txt
WA
37 ms
2420 KB
005.txt
WA
41 ms
2420 KB
006.txt
WA
41 ms
2420 KB
007.txt
WA
41 ms
2420 KB
008.txt
WA
41 ms
2420 KB
009.txt
WA
41 ms
2420 KB
010.txt
WA
41 ms
2420 KB
011.txt
WA
41 ms
2420 KB
example0.txt
AC
1 ms
256 KB
example1.txt
WA
1 ms
256 KB