結果

問題 No.989 N×Mマス計算(K以上)
ユーザー yukarinokiyukarinoki
提出日時 2020-02-14 21:50:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,267 bytes
コンパイル時間 933 ms
コンパイル使用メモリ 90,964 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 01:49:33
合計ジャッジ時間 3,243 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 RE -
testcase_02 AC 2 ms
5,376 KB
testcase_03 RE -
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 36 ms
5,376 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 22 ms
5,376 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 22 ms
5,376 KB
testcase_18 AC 23 ms
5,376 KB
testcase_19 AC 35 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <tuple>
#include <cassert>

using namespace std;

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define mp(a,b) make_pair((a), (b))
#define mt(a,b,c) make_tuple((a),(b),(c))

typedef long long ll;

int main(){
    long long int n,m,k; cin >> n >> m >> k;
    string s; cin >> s;
    vector<long long int> v(m); rep(i,m) cin >> v[i];
    vector<long long int> a(n); rep(i,n) cin >> a[i];
    sort(all(a));
    long long int ans = 0;
    if(s=="+") for(int i=0;i<m;i++){
        int id = lower_bound(all(a), k-v[i]) - a.begin();
        ans = ans + n-id;      
    }
    else for(int i=0;i<m;i++){
        assert(0);
        int id = lower_bound(all(a), k/v[i]) - a.begin();
        ans = ans + n-id;
    }      
    cout << ans << endl;

    return 0;
}
0