답안 #940376

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
940376 2024-03-07T08:44:01 Z 1075508020060209tc ACM (COCI19_acm) C++14
0 / 50
7 ms 11356 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define X first
#define Y second

int n;int m;
string sar[200005];
int slvar[200005];
int pen[200005];


bool cmp(int i,int j){
if(slvar[i]>slvar[j]){return 1;}
if(slvar[i]<slvar[j]){return 0;}
if(pen[i]<pen[j]){return 1;}
if(pen[i]>pen[j]){return 0;}
return sar[i]<sar[j];
}
int vl(string s){
int ret=(s[0]-'0')*10+s[1]-'0';
return ret;
}
void clc(int id){
for(int i=1;i<=m;i++){
    char typ;
   string s;
   cin>>s;
   typ=s[0];
   if(typ=='-'){continue;}
   slvar[id]++;
   int it=1;
   vector<int>vc;
   for(int t=1;t<=4;t++){
        int vl=0;
        while(it<s.size()&&isalnum(s[it])){
            vl=vl*10+s[it]-'0';
            it++;
        }
        vc.push_back(vl);
        it++;
   }
    pen[id]+=vc[0]*20*60+vc[1]*3600+vc[2]*60+vc[3];
}
}

string hero="NijeZivotJedanACM";
int hid;
int ar[200005];
signed main(){
cin>>n>>m;
for(int i=1;i<=n;i++){
    cin>>sar[i];
    if(sar[i]==hero){
        hid=i;
    }
    clc(i);
    ar[i]=i;
}
cin>>sar[hid];
clc(hid);
sort(ar+1,ar+n+1,cmp);
for(int i=1;i<=n;i++){
    if(ar[i]==hid){
        cout<<i<<"\n";
    }
}

}

Compilation message

acm.cpp: In function 'void clc(long long int)':
acm.cpp:36:17: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |         while(it<s.size()&&isalnum(s[it])){
      |               ~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 11096 KB Output isn't correct
2 Incorrect 7 ms 11356 KB Output isn't correct
3 Incorrect 3 ms 11096 KB Output isn't correct
4 Incorrect 7 ms 11236 KB Output isn't correct
5 Incorrect 7 ms 11356 KB Output isn't correct