結果
| 問題 |
No.989 N×Mマス計算(K以上)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-18 22:41:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 2,000 ms |
| コード長 | 412 bytes |
| コンパイル時間 | 2,307 ms |
| コンパイル使用メモリ | 197,512 KB |
| 最終ジャッジ日時 | 2025-01-13 03:31:02 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0),ios::sync_with_stdio(false);
int n,m,k; char op; cin>>n>>m>>k>>op;
vector<int>a(n),b(m); for(auto&&i:b)cin>>i; for(auto&&i:a)cin>>i;
sort(b.begin(),b.end());
int64_t ans=0;
for(auto&&i:a){
if(op=='+')ans+=b.end()-lower_bound(b.begin(),b.end(),k-i);
else ans+=b.end()-lower_bound(b.begin(),b.end(),(k+i-1)/i);
}
cout<<ans<<"\n"s;
}