提出 #22001350


ソースコード 拡げる

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
template<class T,class U> inline bool chmin(T&x,U y){if(x>y){x=y;return true;}return false;}
template<class T,class U> inline bool chmax(T&x,U y){if(x<y){x=y;return true;}return false;}

void solve(){
    int n;
    cin>>n;
    vector<int> a(n),b(n);
    int A=INT_MIN, B=INT_MAX;
    for(auto&i:a) cin>>i,chmax(A,i);
    for(auto&i:b) cin>>i,chmin(B,i);
    if(A>B) cout<<0<<'\n';
    else cout<<B-A+1<<'\n';
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    solve();
}

提出情報

提出日時
問題 B - Intersection
ユーザ Motsu_xe
言語 C++ (GCC 9.2.1)
得点 200
コード長 629 Byte
結果 AC
実行時間 7 ms
メモリ 3652 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 16
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All extreme_00.txt, extreme_01.txt, extreme_02.txt, manual_00.txt, manual_01.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, sample_01.txt, sample_02.txt, sample_03.txt
ケース名 結果 実行時間 メモリ
extreme_00.txt AC 6 ms 3612 KiB
extreme_01.txt AC 2 ms 3584 KiB
extreme_02.txt AC 2 ms 3616 KiB
manual_00.txt AC 7 ms 3544 KiB
manual_01.txt AC 2 ms 3652 KiB
random_00.txt AC 2 ms 3424 KiB
random_01.txt AC 3 ms 3500 KiB
random_02.txt AC 2 ms 3456 KiB
random_03.txt AC 2 ms 3604 KiB
random_04.txt AC 2 ms 3488 KiB
random_05.txt AC 2 ms 3580 KiB
random_06.txt AC 2 ms 3484 KiB
random_07.txt AC 2 ms 3544 KiB
sample_01.txt AC 2 ms 3480 KiB
sample_02.txt AC 3 ms 3572 KiB
sample_03.txt AC 2 ms 3644 KiB