結果

問題 No.989 N×Mマス計算(K以上)
ユーザー glretoglreto
提出日時 2021-01-02 20:02:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 875 bytes
コンパイル時間 1,630 ms
コンパイル使用メモリ 170,008 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-20 14:34:02
合計ジャッジ時間 2,503 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 35 ms
6,940 KB
testcase_11 AC 32 ms
6,944 KB
testcase_12 AC 40 ms
6,944 KB
testcase_13 AC 20 ms
6,944 KB
testcase_14 AC 55 ms
6,944 KB
testcase_15 AC 17 ms
6,944 KB
testcase_16 AC 30 ms
6,944 KB
testcase_17 AC 19 ms
6,940 KB
testcase_18 AC 22 ms
6,940 KB
testcase_19 AC 32 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits//stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define req(i,n) for(int i = 1;i <=  n; i++)
#define rrep(i,n) for(ll i = n-1;i >= 0;i--)
#define ALL(obj) begin(obj), end(obj)
#define RALL(a) rbegin(a),rend(a)
typedef long long ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e18;
ll mod = 1e9+7;
int main(){
   ll n,m,k,ans = 0,sum = 0;char c;cin >>n>>m>>k>>c;
   vector<ll> a(n),b(m);
   rep(i,m) cin >> b[i];
   rep(i,n)cin >> a[i];
   sort(ALL(a));sort(ALL(b));
   if(c=='+'){
       rep(i,n) ans += b.end()-lower_bound(ALL(b),k-a[i]);
   }else {
       rep(i,n) ans += b.end()-lower_bound(ALL(b),(k-1)/a[i]+1);
   }cout << ans << endl;
}
0