답안 #508774

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
508774 2022-01-13T17:53:17 Z ammar2000 ACM (COCI19_acm) C++17
0 / 50
6 ms 484 KB
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define F first
#define S second
#define coy cout<<"YES\n"
#define con cout<<"NO\n"
#define co1 cout<<"-1\n"
#define sc(x) scanf("%lld",&x)
using namespace std;
const int SI=3e5+7;
ll INF=8e18+7;
int MOD=1e9+7;
ll n,m;
vector <pair < pair <ll,ll> ,string > >v;
int main()
{
    sc(n),sc(m);
    for (int i=0;i<n;i++)
    {
        string s;
        cin>>s;
        ll sol,pen;
        sol=pen=0;
        for (int u=0;u<m;u++)
        {
            string h;
            cin>>h;
            if (h[0]=='-')
                continue;
            sol++;
            pen+=(h[1]-'1')*60*20;
            pen+=(h[4]-'0')*3600;
            pen+=(h[6]-'0')*600;
            pen+=(h[7]-'0')*60;
            pen+=(h[9]-'0')*10;
            pen+=(h[10]-'0');
        }
        if (s=="NijeZivotJedanACM")
            continue;
       v.pb({{-sol,pen},s});
    }
        string s;
        cin>>s;
        ll sol,pen;
        sol=pen=0;
        for (int u=0;u<m;u++)
        {
            string h;
            cin>>h;
            if (h[0]=='-')
                continue;
            sol++;
            pen+=(h[1]-'1')*60;
            pen+=(h[4]-'0')*3600;
            pen+=(h[6]-'0')*600;
            pen+=(h[7]-'0')*60;
            pen+=(h[9]-'0')*10;
            pen+=(h[10]-'0');
        }
       v.pb({{-sol,pen},s});
    sort (v.begin(),v.end());
    ll ans=0;
    for (auto r:v)
    {
        //cout <<r.F.F<<" " <<r.F.S<<" "<<r.S<<"\n";
        if (r.S=="NijeZivotJedanACM")
            break;
         ans++;
    }
    cout <<ans+1;
   // use scanf not cin
   return 0;
}

Compilation message

acm.cpp: In function 'int main()':
acm.cpp:9:20: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 | #define sc(x) scanf("%lld",&x)
      |               ~~~~~^~~~~~~~~~~
acm.cpp:18:5: note: in expansion of macro 'sc'
   18 |     sc(n),sc(m);
      |     ^~
acm.cpp:9:20: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 | #define sc(x) scanf("%lld",&x)
      |               ~~~~~^~~~~~~~~~~
acm.cpp:18:11: note: in expansion of macro 'sc'
   18 |     sc(n),sc(m);
      |           ^~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Incorrect 5 ms 424 KB Output isn't correct
3 Incorrect 0 ms 204 KB Output isn't correct
4 Incorrect 5 ms 428 KB Output isn't correct
5 Incorrect 6 ms 484 KB Output isn't correct