Submission #00080


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include<bits/stdc++.h>
using namespace std;
int main(){
long long n,m,g;cin>>n>>m>>g;
vector<vector<long long>>s(m,vector<long long>(0));
for(int i=0;i<m;i++){
long long d;cin>>d;
long long u;
for(int j=0;j<d;j++){
cin>>u;
}
for(int j=0;j<d;j++){
cin>>u;
s[i].push_back(u);
}
}
vector<long long>t(0);
for(int i=0;i<m;i++){
for(int j=1;j<s[i].size();j++){
s[i][j]+=s[i][j-1];
}
for(int j=s[i].size()-1;j>=0;j-=g){
t.push_back(s[i][j]);
}
}
sort(t.begin(),t.end());
long long f=0;
for(int i=0;i<t.size();i++){
f+=t[i]*2;
}
cout<<f<<"\n";
}

ステータス

項目 データ
問題 0004 - Delivery
ユーザー名 ei2326
投稿日時 2023-09-20 16:51:32
言語 C++17
状態 Accepted
得点 300
ソースコード長 765 Byte
最大実行時間 83 ms
最大メモリ使用量 7180 KB

セット

セット 得点 Cases
1 ALL 300 / 300 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
hand_made01.txt AC 57 ms 2896 KB
1
hand_made02.txt AC 83 ms 7180 KB
1
hand_made03.txt AC 28 ms 508 KB
1
in01.txt AC 40 ms 1244 KB
1
in02.txt AC 49 ms 1448 KB
1
in03.txt AC 18 ms 560 KB
1
in04.txt AC 40 ms 1264 KB
1
in05.txt AC 34 ms 1112 KB
1
in06.txt AC 48 ms 1396 KB
1
in07.txt AC 24 ms 764 KB
1
in08.txt AC 60 ms 1828 KB
1
in09.txt AC 46 ms 1204 KB
1
in10.txt AC 20 ms 572 KB
1
in11.txt AC 50 ms 1956 KB
1
in12.txt AC 39 ms 1160 KB
1
in13.txt AC 40 ms 1028 KB
1
in14.txt AC 52 ms 1428 KB
1
in15.txt AC 31 ms 968 KB
1
in16.txt AC 19 ms 628 KB
1
in17.txt AC 46 ms 1436 KB
1
in18.txt AC 41 ms 1228 KB
1
in19.txt AC 30 ms 720 KB
1
in20.txt AC 33 ms 1056 KB
1
in21.txt AC 58 ms 3624 KB
1
in22.txt AC 31 ms 1128 KB
1
in23.txt AC 35 ms 1120 KB
1
in24.txt AC 50 ms 2768 KB
1
in25.txt AC 59 ms 4780 KB
1
in26.txt AC 76 ms 6140 KB
1
in27.txt AC 57 ms 3380 KB
1
in28.txt AC 38 ms 1108 KB
1
in29.txt AC 38 ms 2492 KB
1
in30.txt AC 35 ms 920 KB
1
sample01.txt AC 21 ms 508 KB
1
sample02.txt AC 21 ms 608 KB
1
sample03.txt AC 28 ms 584 KB
1