Submission #11356424
Source Code Expand
#include <bits/stdc++.h> #include <string> #define ft first #define sc second #define pt(sth) cout << sth << "\n" #define chmax(a, b) (a)=max(a, b); #define chmin(a, b) (a)=min(a, b); #define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD using namespace std; typedef long long ll; typedef pair<ll, ll> pll; static const ll INF=1e18; static const ll MAX=101010; static const ll MOD=1e9+7; /* for(i=0; i<N; i++) cin >> a[i]; */ int main(void) { ll i, j, k; ll N; cin >> N; pll p[MAX*2]; for(i=0; i<N; i++) { cin >> p[i].ft; p[i].sc=1; } for(i=N; i<N*2; i++) { cin >> p[i].ft; p[i].sc=-1; } sort(p, p+N*2); ll ans=1; ll t=0; for(i=0; i<N*2; i++) { t+=p[i].sc; if(t) moC(ans, *, abs(t)); } pt(ans); }
Submission Info
Submission Time | |
---|---|
Task | A - 1D Matching |
User | eQe |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 816 Byte |
Status | WA |
Exec Time | 95 ms |
Memory | 3456 KB |
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 | 58 ms | 3456 KB |
001.txt | WA | 23 ms | 3456 KB |
002.txt | WA | 30 ms | 3456 KB |
003.txt | WA | 33 ms | 3456 KB |
004.txt | WA | 85 ms | 3456 KB |
005.txt | WA | 95 ms | 3456 KB |
006.txt | WA | 94 ms | 3456 KB |
007.txt | WA | 94 ms | 3456 KB |
008.txt | WA | 95 ms | 3456 KB |
009.txt | WA | 94 ms | 3456 KB |
010.txt | WA | 94 ms | 3456 KB |
011.txt | AC | 94 ms | 3456 KB |
example0.txt | AC | 2 ms | 3456 KB |
example1.txt | AC | 3 ms | 3456 KB |