Submission #4060143


Source Code Expand

#include<cstdio>
#include<algorithm>
#define mod 1000000007
using namespace std;
int main(){
    int a[100000],b[100000];
    long long ans=1LL,l=0LL,n;
    scanf("%lld",&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(long long i=1;i<n;i++){
        if(a[l]>=b[i]||b[l]>=a[i]){
            ans*=(long 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 563 Byte
Status WA
Exec Time 36 ms
Memory 896 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:26:23: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("%ld\n",ans);
                       ^
./Main.cpp:8:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld",&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
AC × 2
AC × 4
WA × 10
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 36 ms 896 KB
example0.txt AC 1 ms 128 KB
example1.txt AC 1 ms 128 KB