Submission #1000667
Source Code Expand
#include<bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; int main() { int N, A[100000], B[100000]; int cd[100001]; cd[0] = 1; for(int i = 1; i < 100001; i++) cd[i] = (1LL * cd[i - 1] * i) % mod; scanf("%d", &N); for(int i = 0; i < N; i++) { scanf("%d", &A[i]); } for(int i = 0; i < N; i++) { scanf("%d", &B[i]); } sort(A, A + N); sort(B, B + N); int ret = 1; int curd = 0; while(curd < N) { int back = curd; while(curd < N && A[curd] < B[back]) ++curd; while(curd < N && B[curd] < A[back]) ++curd; ret = 1LL * ret * cd[(curd - back)] % mod; } cout << ret << endl; }
Submission Info
Submission Time | |
---|---|
Task | A - 1D Matching |
User | ei13333 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 677 Byte |
Status | WA |
Exec Time | 40 ms |
Memory | 1408 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:14:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &N); ^ ./Main.cpp:16:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &A[i]); ^ ./Main.cpp:19:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &B[i]); ^
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 | 1280 KB |
001.txt | WA | 11 ms | 768 KB |
002.txt | WA | 14 ms | 896 KB |
003.txt | WA | 15 ms | 896 KB |
004.txt | WA | 35 ms | 1280 KB |
005.txt | WA | 39 ms | 1408 KB |
006.txt | WA | 39 ms | 1408 KB |
007.txt | WA | 39 ms | 1408 KB |
008.txt | WA | 39 ms | 1408 KB |
009.txt | WA | 39 ms | 1408 KB |
010.txt | AC | 39 ms | 1408 KB |
011.txt | AC | 40 ms | 1408 KB |
example0.txt | AC | 3 ms | 640 KB |
example1.txt | AC | 3 ms | 640 KB |