Submission #00157
ソースコード
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 | #include <map> #include <set> #include <list> #include <cstdio> #include <cmath> #include <deque> #include <queue> #include <stack> #include <bitset> #include <cctype> #include <string> #include <vector> #include <cstdlib> #include <cstring> #include <iomanip> #include <sstream> #include <iostream> #include <algorithm> #include <functional> using namespace std; #define fr first #define sc second #define mp make_pair typedef long long int64; typedef pair< int , int > iP; typedef pair< iP, int > iiP; const int INF = 2 << 28; const double EPS = 1e-10; int main() { int n; while (cin >> n, n) { int maxi = -1, mp = -1; for ( int i = 0; i < n; i++) { int p, d1, d2; cin >> p >> d1 >> d2; if (maxi < d2 + d1) { mp = p; maxi = d2 + d1; } } cout << mp << " " << maxi << endl; } } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - 病院でウォーキング |
ユーザー名 | Jogasaki_Mika_Tanto_P |
投稿日時 | 2016-08-29 09:57:27 |
言語 | C++ |
状態 | Accepted |
得点 | 4 |
ソースコード長 | 952 Byte |
最大実行時間 | 49 ms |
最大メモリ使用量 | 688 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 4 / 4 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
00sample.in | AC | 20 ms | 476 KB |
1
|
01.in | AC | 25 ms | 452 KB |
1
|
02.in | AC | 22 ms | 552 KB |
1
|
03.in | AC | 33 ms | 532 KB |
1
|
04.in | AC | 30 ms | 512 KB |
1
|
05.in | AC | 26 ms | 496 KB |
1
|
06.in | AC | 33 ms | 472 KB |
1
|
07.in | AC | 41 ms | 456 KB |
1
|
08.in | AC | 36 ms | 688 KB |
1
|
09.in | AC | 31 ms | 540 KB |
1
|
10.in | AC | 49 ms | 652 KB |
1
|