Submission #00101
ソースコード
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 45 46 47 48 49 50 | #include<bits/stdc++.h> using namespace std; const int INF = (1<<30); int N, D; int p[50][50]; int main() { cin >> N >> D; for ( int i=0; i<N; i++) { for ( int j=0; j<D; j++) { cin >> p[i][j]; } } int sum = 0, move = 0, prev = 0; vector< int > v; for ( int i=0; i<D; i++) { int mi = p[0][i], miNum = 0; for ( int j=1; j<N; j++) { if ( mi >= p[j][i] ) { if ( mi == p[j][i] ) { std::ostringstream stream; stream << miNum; string a = stream.str(); stream << j; string b = stream.str(); if ( a > b ) miNum = j; } else { mi = p[j][i]; miNum = j; } } } if ( i == 0 || p[prev][i] != mi ) { prev = miNum; if ( i != 0 ) move++; } v.push_back( prev+1 ); sum += mi; } cout << sum << " " << move << endl; for ( int i=0; i<v.size(); i++) { cout << v[i] << endl; } } |
ステータス
項目 | データ |
---|---|
問題 | 0005 - ホテル探し |
ユーザー名 | 椅子男 |
投稿日時 | 2016-08-12 11:53:36 |
言語 | C++11 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 910 Byte |
最大実行時間 | 17 ms |
最大メモリ使用量 | 780 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 11 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
2517-in1.txt | AC | 11 ms | 476 KB |
1
|
2517-in2.txt | AC | 14 ms | 400 KB |
1
|
2517-in3.txt | AC | 10 ms | 700 KB |
1
|
2517-in4.txt | AC | 12 ms | 616 KB |
1
|
2517-in5.txt | AC | 12 ms | 644 KB |
1
|
2517-in6.txt | AC | 14 ms | 620 KB |
1
|
2517-in7.txt | AC | 13 ms | 584 KB |
1
|
2517-in8.txt | AC | 14 ms | 684 KB |
1
|
2517-in9.txt | AC | 13 ms | 524 KB |
1
|
2517-in10.txt | AC | 14 ms | 448 KB |
1
|
2517-in11.txt | AC | 11 ms | 548 KB |
1
|
2517-in12.txt | AC | 11 ms | 516 KB |
1
|
2517-in13.txt | AC | 13 ms | 612 KB |
1
|
2517-in14.txt | AC | 10 ms | 580 KB |
1
|
2517-in15.txt | AC | 13 ms | 552 KB |
1
|
2517-in16.txt | AC | 11 ms | 520 KB |
1
|
2517-in17.txt | AC | 10 ms | 620 KB |
1
|
2517-in18.txt | AC | 10 ms | 460 KB |
1
|
2517-in19.txt | AC | 15 ms | 428 KB |
1
|
2517-in20.txt | AC | 11 ms | 508 KB |
1
|
2517-in21.txt | AC | 11 ms | 476 KB |
1
|
2517-in22.txt | AC | 11 ms | 440 KB |
1
|
2517-in23.txt | AC | 17 ms | 532 KB |
1
|
2517-in24.txt | AC | 11 ms | 504 KB |
1
|
2517-in25.txt | AC | 14 ms | 604 KB |
1
|
2517-in26.txt | WA | 15 ms | 572 KB |
1
|
2517-in27.txt | AC | 12 ms | 532 KB |
1
|
2517-in28.txt | AC | 14 ms | 504 KB |
1
|
2517-in29.txt | AC | 15 ms | 600 KB |
1
|
2517-in30.txt | AC | 13 ms | 544 KB |
1
|
2517-in31.txt | AC | 11 ms | 640 KB |
1
|
2517-in32.txt | AC | 14 ms | 608 KB |
1
|
2517-in33.txt | AC | 11 ms | 576 KB |
1
|
2517-in34.txt | AC | 11 ms | 552 KB |
1
|
2517-in35.txt | AC | 13 ms | 660 KB |
1
|
2517-in36.txt | AC | 15 ms | 628 KB |
1
|
2517-in37.txt | WA | 11 ms | 720 KB |
1
|
2517-in38.txt | WA | 11 ms | 560 KB |
1
|
2517-in39.txt | WA | 15 ms | 780 KB |
1
|
2517-in40.txt | WA | 12 ms | 720 KB |
1
|
2517-in41.txt | WA | 13 ms | 684 KB |
1
|