Submission #4060125
Source Code Expand
#include<cstdio> #include<algorithm> #define mod 1000000007 using namespace std; int main(){ int n,a[100000],b[100000],l=0; long ans=1L; 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); for(int i=1;i<n;i++){ if(a[l]>=b[i]||b[l]>=a[i]){ ans*=(long)(i-l+1); ans%=mod; } else{ l=i; } } printf("%ld\n",ans); }
Submission Info
Submission Time | |
---|---|
Task | A - 1D Matching |
User | AC961009 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 542 Byte |
Status | WA |
Exec Time | 36 ms |
Memory | 896 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:8:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&n); ^ ./Main.cpp:10:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&a[i]); ^ ./Main.cpp:13:26: 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 | 22 ms | 640 KB |
001.txt | WA | 8 ms | 384 KB |
002.txt | WA | 11 ms | 384 KB |
003.txt | WA | 12 ms | 384 KB |
004.txt | WA | 32 ms | 896 KB |
005.txt | WA | 36 ms | 896 KB |
006.txt | WA | 36 ms | 896 KB |
007.txt | WA | 36 ms | 896 KB |
008.txt | WA | 36 ms | 896 KB |
009.txt | WA | 36 ms | 896 KB |
010.txt | AC | 36 ms | 896 KB |
011.txt | AC | 35 ms | 896 KB |
example0.txt | AC | 1 ms | 128 KB |
example1.txt | AC | 1 ms | 128 KB |