답안 #726871

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
726871 2023-04-19T13:15:36 Z kerem ACM (COCI19_acm) C++14
50 / 50
3 ms 340 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fir first
#define sec second
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int32_t main(){
    fast;
    int n,m;
    vector<pair<int,pair<int,string>>> v;
    cin >> n >> m;
    for(int i=0;i<=n;i++){
        string s;
        int x=0,y=0;
        cin >> s;
        for(int j=0;j<m;j++){
            string t;
            cin >> t;
            if(t=="-")
                continue;
            if(t[0]!='-'){
                x++;
                y+=(t[1]-49)*1200;
            }
            if(t.size()>2)
                y+=(t[3]-48)*36000+(t[4]-48)*3600+(t[6]-48)*600+(t[7]-48)*60+(t[9]-48)*10+(t[10]-48);
        }
        if(s!="NijeZivotJedanACM" or i==n)
            v.pb({-x,{y,s}});
    }
    sort(v.begin(),v.end());
//    for(int i=0;i<v.size();i++)
//        cout << v[i].fir << " " << v[i].sec.fir << " " << v[i].sec.sec << endl;
    for(int i=0;i<v.size();i++){
        if(v[i].sec.sec=="NijeZivotJedanACM"){
            cout << i+1;
            return 0;
        }
    }
    return 0;
}

Compilation message

acm.cpp: In function 'int32_t main()':
acm.cpp:35:18: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, std::pair<long long int, std::__cxx11::basic_string<char> > > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |     for(int i=0;i<v.size();i++){
      |                 ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 3 ms 340 KB Output is correct