結果
問題 | No.989 N×Mマス計算(K以上) |
ユーザー |
![]() |
提出日時 | 2020-03-05 21:30:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 53 ms / 2,000 ms |
コード長 | 394 bytes |
コンパイル時間 | 1,534 ms |
コンパイル使用メモリ | 171,308 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-14 02:08:40 |
合計ジャッジ時間 | 2,624 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include<bits/stdc++.h> int main(){ int n,m,k;std::cin>>n>>m>>k; char c;std::cin>>c; std::vector<int>a(n),b(m); for(int i=0;i<m;i++)std::cin>>b.at(i); std::sort(b.begin(),b.end()); long long ans=0; for(int i=0;i<n;i++){ int x;std::cin>>x; ans+=b.end()-std::lower_bound(b.begin(),b.end(),c=='+'?k-x:(k+x-1)/x); } std::cout<<ans<<std::endl; }