Submission #1833200
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define ll long long const int N = (int)1e5 + 7; const int mod = (int)1e9 + 7; int a[N], b[N]; int dp[N]; ll ans = 1; main() { int n; scanf ("%d", &n); for (int i = 1; i <= n; i++) { scanf ("%d", a + i); } for (int i = 1; i <= n; i++) { scanf ("%d", b + i); } sort(a + 1, a + n + 1); sort(b + 1, b + n + 1); for (int i = 1; i <= n; i++) { int l = i; int r = n; while (r - l > 1) { int mid = (l + r) / 2; if (a[mid] <= b[i]) { l = mid; } else { r = mid; } } if (a[r] <= b[i]) l = r; // cout << l << "asdasd\n"; ans *= (l - i + 1); ans %= mod; } printf ("%lld", ans); }
Submission Info
Submission Time | |
---|---|
Task | A - 1D Matching |
User | Shabdan |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 861 Byte |
Status | WA |
Exec Time | 43 ms |
Memory | 1024 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:15:28: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] int n; scanf ("%d", &n); ^ ./Main.cpp:17:28: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf ("%d", a + i); ^ ./Main.cpp:20:28: 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 | 26 ms | 768 KB |
001.txt | WA | 10 ms | 384 KB |
002.txt | WA | 13 ms | 512 KB |
003.txt | WA | 15 ms | 512 KB |
004.txt | WA | 38 ms | 896 KB |
005.txt | WA | 43 ms | 1024 KB |
006.txt | WA | 43 ms | 1024 KB |
007.txt | WA | 43 ms | 1024 KB |
008.txt | WA | 42 ms | 1024 KB |
009.txt | WA | 43 ms | 1024 KB |
010.txt | WA | 42 ms | 1024 KB |
011.txt | AC | 42 ms | 1024 KB |
example0.txt | AC | 1 ms | 256 KB |
example1.txt | AC | 1 ms | 256 KB |