結果

問題 No.989 N×Mマス計算(K以上)
ユーザー yukarinokiyukarinoki
提出日時 2020-02-14 21:43:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,307 bytes
コンパイル時間 783 ms
コンパイル使用メモリ 88,060 KB
実行使用メモリ 4,452 KB
最終ジャッジ日時 2023-07-28 17:36:07
合計ジャッジ時間 2,167 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 33 ms
4,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 19 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 28 ms
4,380 KB
testcase_17 AC 19 ms
4,380 KB
testcase_18 AC 21 ms
4,376 KB
testcase_19 AC 32 ms
4,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 as = 0;
    rep(i,n) as = (as + a[i])%k;
    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++){
        int id = lower_bound(all(a), k/v[i]) - a.begin();
        ans = ans + n-id;
    }      
    cout << ans << endl;

    return 0;
}
0