結果
問題 | No.989 N×Mマス計算(K以上) |
ユーザー |
|
提出日時 | 2020-02-07 04:27:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 55 ms / 2,000 ms |
コード長 | 326 bytes |
コンパイル時間 | 601 ms |
コンパイル使用メモリ | 70,184 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 07:11:24 |
合計ジャッジ時間 | 2,081 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 8 | main() | ^~~~
ソースコード
#include<iostream>#include<algorithm>using namespace std;int N,M;char op;long A[1<<17],B[1<<17];long K,ans;main(){cin>>N>>M>>K;cin>>op;for(int j=0;j<M;j++){cin>>B[j];}sort(B,B+M);for(int i=0;i<N;i++){cin>>A[i];ans+=B+M-lower_bound(B,B+M,op=='+'?K-A[i]:(K+A[i]-1)/A[i]);}cout<<ans<<endl;}