結果
| 問題 |
No.989 N×Mマス計算(K以上)
|
| コンテスト | |
| ユーザー |
beet
|
| 提出日時 | 2020-02-14 22:07:32 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 74 ms / 2,000 ms |
| コード長 | 648 bytes |
| コンパイル時間 | 2,493 ms |
| コンパイル使用メモリ | 197,576 KB |
| 最終ジャッジ日時 | 2025-01-09 00:16:06 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
//INSERT ABOVE HERE
signed main(){
Int n,m,k;
cin>>n>>m>>k;
char op;
cin>>op;
vector<Int> as(n),bs(m);
for(Int i=0;i<m;i++) cin>>bs[i];
for(Int i=0;i<n;i++) cin>>as[i];
sort(as.begin(),as.end());
Int ans=0;
for(Int b:bs){
if(op=='+') ans+=as.end()-lower_bound(as.begin(),as.end(),k-b);
if(op=='*') ans+=as.end()-lower_bound(as.begin(),as.end(),(k+b-1)/b);
}
cout<<ans<<endl;
return 0;
}
beet