結果
| 問題 |
No.989 N×Mマス計算(K以上)
|
| コンテスト | |
| ユーザー |
glreto
|
| 提出日時 | 2021-01-02 20:02:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 59 ms / 2,000 ms |
| コード長 | 875 bytes |
| コンパイル時間 | 1,609 ms |
| コンパイル使用メモリ | 174,132 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-12 10:08:13 |
| 合計ジャッジ時間 | 2,750 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#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;
}
glreto