結果
| 問題 |
No.31 悪のミックスジュース
|
| コンテスト | |
| ユーザー |
dnish
|
| 提出日時 | 2018-06-14 16:00:06 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 839 bytes |
| コンパイル時間 | 1,630 ms |
| コンパイル使用メモリ | 168,228 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-30 14:23:32 |
| 合計ジャッジ時間 | 2,389 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 12 |
ソースコード
#include "bits/stdc++.h"
#define REP(i,n,N) for(int i=(n); i<(N); i++)
#define RREP(i,n,N) for(int i=(N-1); i>=n; i--)
#define CK(n,a,b) (a)<=(n)&&(n)<(b)
#define ALL(v) (v).begin(),(v).end()
#define p(s) cout<<(s)<<endl
typedef long long ll;
using namespace std;
const ll mod =1e6+7;
ll N,V;
int main(){
while(cin>>N>>V){
ll ans=0;
ll C[110] = {};
REP(i,0,N){
cin>>C[i];
}
int ind=N;
REP(i,0,N){
ans+=C[i];
if(ind==N&&C[i]<C[i+1]){
ind=i+1;
}
}
if(N>=V){
p(ans);
}else{
V-=N;
int d1 = V/ind;
int d2 = V%ind;
REP(i,0,ind){
ans+=C[i]*(d1+(d2>0));
d2--;
}
p(ans);
}
}
}
dnish