Submission #22630041


Source Code Expand

Copy
/*
* @Author: Luisvacson
* @LastEditors: Luisvacson
* @Descriptions: None
* @Date: 2021-05-15 21:15:10
* @LastEditTime: 2021-05-15 21:15:53
* @FilePath: \C++\Practice\ABC201B.cpp
*/
#include <bits/stdc++.h>
using namespace std;
struct node {
string s;
int h;
} a[1005];
bool cmp(node x, node y) { return x.h > y.h; }
int n;
signed main() {
ios_base::sync_with_stdio(0);
cin >> n;
register int i;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
/*
 * @Author: Luisvacson
 * @LastEditors: Luisvacson
 * @Descriptions: None
 * @Date: 2021-05-15 21:15:10
 * @LastEditTime: 2021-05-15 21:15:53
 * @FilePath: \C++\Practice\ABC201B.cpp
 */
#include <bits/stdc++.h>
using namespace std;
struct node {
    string s;
    int h;
} a[1005];
bool cmp(node x, node y) { return x.h > y.h; }

int n;
signed main() {
    ios_base::sync_with_stdio(0);
    cin >> n;
    register int i;
    for (i = 1; i <= n; i++) {
        cin >> a[i].s >> a[i].h;
    }
    sort(a + 1, a + n + 1, cmp);
    cout << a[2].s << endl;
    return 0;
}

Submission Info

Submission Time
Task B - Do you know the second highest mountain?
User Luisvacson
Language C++ (GCC 9.2.1)
Score 200
Code Size 599 Byte
Status AC
Exec Time 4 ms
Memory 3616 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:21:18: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   21 |     register int i;
      |                  ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 10
Set Name Test Cases
Sample example0.txt, example1.txt, example2.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, example0.txt, example1.txt, example2.txt
Case Name Status Exec Time Memory
000.txt AC 1 ms 3516 KB
001.txt AC 2 ms 3612 KB
002.txt AC 3 ms 3608 KB
003.txt AC 2 ms 3588 KB
004.txt AC 2 ms 3580 KB
005.txt AC 2 ms 3616 KB
006.txt AC 4 ms 3616 KB
example0.txt AC 2 ms 3440 KB
example1.txt AC 2 ms 3508 KB
example2.txt AC 2 ms 3500 KB


2025-02-28 (Fri)
09:36:15 +00:00