結果

問題 No.2549 Paint Eggs
ユーザー k82bk82b
提出日時 2023-11-25 16:31:24
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 865 bytes
コンパイル時間 2,392 ms
コンパイル使用メモリ 204,080 KB
実行使用メモリ 14,428 KB
最終ジャッジ日時 2023-11-25 16:31:32
合計ジャッジ時間 7,338 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
10,332 KB
testcase_01 AC 5 ms
10,332 KB
testcase_02 AC 5 ms
10,332 KB
testcase_03 AC 5 ms
10,332 KB
testcase_04 AC 5 ms
10,332 KB
testcase_05 AC 5 ms
10,332 KB
testcase_06 AC 5 ms
10,332 KB
testcase_07 AC 5 ms
10,332 KB
testcase_08 AC 4 ms
10,332 KB
testcase_09 AC 4 ms
10,332 KB
testcase_10 AC 71 ms
13,660 KB
testcase_11 AC 54 ms
12,636 KB
testcase_12 AC 58 ms
12,764 KB
testcase_13 AC 69 ms
13,404 KB
testcase_14 AC 40 ms
11,868 KB
testcase_15 AC 7 ms
10,460 KB
testcase_16 AC 63 ms
13,276 KB
testcase_17 AC 47 ms
12,252 KB
testcase_18 AC 38 ms
11,996 KB
testcase_19 AC 56 ms
12,764 KB
testcase_20 AC 86 ms
14,428 KB
testcase_21 AC 87 ms
14,428 KB
testcase_22 AC 87 ms
14,428 KB
testcase_23 AC 91 ms
14,428 KB
testcase_24 AC 88 ms
14,428 KB
testcase_25 AC 86 ms
14,428 KB
testcase_26 AC 85 ms
14,428 KB
testcase_27 AC 85 ms
14,428 KB
testcase_28 AC 86 ms
14,428 KB
testcase_29 AC 85 ms
14,428 KB
testcase_30 AC 84 ms
14,428 KB
testcase_31 AC 91 ms
14,428 KB
testcase_32 AC 86 ms
14,428 KB
testcase_33 AC 89 ms
14,428 KB
testcase_34 AC 87 ms
14,428 KB
testcase_35 AC 86 ms
14,428 KB
testcase_36 AC 86 ms
14,428 KB
testcase_37 AC 88 ms
14,428 KB
testcase_38 AC 87 ms
14,428 KB
testcase_39 AC 84 ms
14,428 KB
testcase_40 AC 87 ms
14,428 KB
testcase_41 AC 93 ms
14,428 KB
testcase_42 AC 86 ms
14,428 KB
testcase_43 AC 91 ms
14,428 KB
testcase_44 AC 87 ms
14,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using Int=long long;
using Real=long double;
template<class T>inline bool chmin(T&A,T B){return(A>B?A=B,1:0);}
template<class T>inline bool chmax(T&A,T B){return(A<B?A=B,1:0);}
#define REP(i,n)for(int i=0;i<(n);++i)
#define REP1(i,n)for(int i=1;i<=(n);++i)
#define ALL(x)begin(x),end(x)
#define drop(x){cout<<x<<'\n';return;}
int N,M,K,A[2<<17];
vector<int>C[2<<17];
void sol()
{
	cin>>N>>M>>K;
	REP(i,N)
	{
		int c;cin>>c;
		C[--c].push_back(i);
	}
	Int ans=1e18;
	REP(i,M)cin>>A[i];
	REP(i,M)
	{
		int sk=0,mt=0;
		REP(j,size(C[i]))
		{
			while(sk<size(C[i])&&C[i][j]+K>C[i][sk])++sk;
			chmax(mt,sk-j);
		}
		chmin(ans,(Int)A[i]*(K-mt));
	}
	cout<<ans<<endl;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cout<<fixed<<setprecision(16);
	int T=1;
	//cin>>T;
	while(T--)sol();
}
0