結果

問題 No.989 N×Mマス計算(K以上)
ユーザー 👑 CleyLCleyL
提出日時 2020-02-14 21:32:17
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 602 bytes
コンパイル時間 792 ms
コンパイル使用メモリ 75,612 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 10:44:24
合計ジャッジ時間 1,676 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
    long long n,m,k;cin>>n>>m>>k;
    char z;cin>>z;
    vector<long long> A(n);
    vector<long long> B(m);
    for(int i = 0; m > i; i++)cin>>B[i];
    for(int i = 0; n > i; i++)cin>>A[i];
    sort(A.begin(),A.end());
    long long ans = 0;
    for(int i = 0; m > i; i++){
        if(z == '+'){
            ans += (A.end()-lower_bound(A.begin(),A.end(),(k-B[i])));
        }else{
            ans += (A.end()-lower_bound(A.begin(),A.end(),((k-1)/B[i]+1)));
        }
    }
    cout << ans << endl;
    
    
}
0