結果

問題 No.989 N×Mマス計算(K以上)
ユーザー kotatsugamekotatsugame
提出日時 2020-02-07 04:27:22
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 650 ms
コンパイル使用メモリ 69,744 KB
実行使用メモリ 4,928 KB
最終ジャッジ日時 2023-10-25 22:58:18
合計ジャッジ時間 2,312 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 36 ms
4,452 KB
testcase_11 AC 36 ms
4,380 KB
testcase_12 AC 41 ms
4,556 KB
testcase_13 AC 23 ms
4,348 KB
testcase_14 AC 56 ms
4,928 KB
testcase_15 AC 17 ms
4,348 KB
testcase_16 AC 30 ms
4,348 KB
testcase_17 AC 22 ms
4,348 KB
testcase_18 AC 21 ms
4,348 KB
testcase_19 AC 36 ms
4,420 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main()
      | ^~~~

ソースコード

diff #

#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;
}
0