Submission #00027


ソースコード

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
33
34
35
36
37
38
39
40
41
42
43
44
#include <bits/stdc++.h>
#define INF 1<<29
using namespace std;
int main(){
int n,d;
int stay[11111]={0};
int p[60][11111]={{0}};
int cost=INF,ans=0;
int befor=INF;
int cnt=0;
cin >> n >> d;
for(int i=0;i<n;i++){
for(int j=0;j<d;j++){
cin >> p[i][j];
}
}
for(int i=0;i<d;i++){
cost=INF;
for(int j=0;j<n;j++){
if(p[j][i]<cost){
cost=p[j][i];
stay[i]=j+1;
}
if(p[j][i]==cost && befor==j+1){
cost=p[j][i];
stay[i]=j+1;
}
}
if(befor!=stay[i]){
cnt++;
}
befor=stay[i];
ans+=cost;
}
cout << ans << " " << cnt-1 << endl;
for(int i=0;i<d;i++){
cout << stay[i] << endl;
}
}

ステータス

項目 データ
問題 0005 - ホテル探し
ユーザー名 udonkun
投稿日時 2016-08-12 09:40:24
言語 C++11
状態 Wrong Answer
得点 0
ソースコード長 734 Byte
最大実行時間 17 ms
最大メモリ使用量 3376 KB

セット

セット 得点 Cases
1 ALL 0 / 11 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2517-in1.txt AC 12 ms 3032 KB
1
2517-in2.txt AC 13 ms 3132 KB
1
2517-in3.txt AC 13 ms 3204 KB
1
2517-in4.txt AC 12 ms 3308 KB
1
2517-in5.txt AC 14 ms 3236 KB
1
2517-in6.txt AC 15 ms 3252 KB
1
2517-in7.txt AC 11 ms 3272 KB
1
2517-in8.txt AC 12 ms 3288 KB
1
2517-in9.txt AC 12 ms 3312 KB
1
2517-in10.txt AC 14 ms 3180 KB
1
2517-in11.txt AC 13 ms 3204 KB
1
2517-in12.txt AC 12 ms 3224 KB
1
2517-in13.txt AC 12 ms 3244 KB
1
2517-in14.txt AC 15 ms 3140 KB
1
2517-in15.txt AC 15 ms 3024 KB
1
2517-in16.txt AC 11 ms 3044 KB
1
2517-in17.txt AC 10 ms 3064 KB
1
2517-in18.txt AC 15 ms 3092 KB
1
2517-in19.txt AC 13 ms 3116 KB
1
2517-in20.txt AC 13 ms 3152 KB
1
2517-in21.txt AC 10 ms 3172 KB
1
2517-in22.txt AC 12 ms 3056 KB
1
2517-in23.txt AC 12 ms 3080 KB
1
2517-in24.txt AC 11 ms 3096 KB
1
2517-in25.txt AC 12 ms 3112 KB
1
2517-in26.txt WA 15 ms 3132 KB
1
2517-in27.txt AC 16 ms 3152 KB
1
2517-in28.txt AC 12 ms 3168 KB
1
2517-in29.txt AC 13 ms 3188 KB
1
2517-in30.txt AC 11 ms 3228 KB
1
2517-in31.txt AC 14 ms 3248 KB
1
2517-in32.txt AC 11 ms 3276 KB
1
2517-in33.txt AC 10 ms 3300 KB
1
2517-in34.txt AC 14 ms 3320 KB
1
2517-in35.txt AC 17 ms 3344 KB
1
2517-in36.txt AC 11 ms 3360 KB
1
2517-in37.txt WA 12 ms 3376 KB
1
2517-in38.txt WA 13 ms 3272 KB
1
2517-in39.txt WA 13 ms 3292 KB
1
2517-in40.txt WA 13 ms 3200 KB
1
2517-in41.txt WA 12 ms 3216 KB
1