Submission #660240

#TimeUsernameProblemLanguageResultExecution timeMemory
660240berrMed (COCI22_med)C++17
50 / 50
1 ms352 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int cmp(string x, string y) { for(int i=0; i<min(x.size(), y.size()); i++) { cout<<x[i]<<" "<<y[i]<<"\n"; if(x[i]<y[i]) return 1; if(y[i]<x[i]) return 0; } return x.size()<y.size(); } int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin>>n; vector<int> tot(n); vector<string> s(n); for(int i=0; i<n; i++) { cin>>s[i]; for(int l=0; l<5; l++) { int x; cin>>x; tot[i]+=x; } } for(int i=0; i<n; i++) { int r=n, j=n; int v=tot[i]+500, z=tot[i]-500; for(int l=0; l<n; l++) { if(i==l) continue; if(v>tot[l]||(v==tot[l]&&s[i]<s[l])) r--; if(z>tot[l]||(z==tot[l]&&s[i]<s[l])) j--; } cout<<r<<" "<<j<<"\n"; } }

Compilation message (stderr)

Main.cpp: In function 'long long int cmp(std::string, std::string)':
Main.cpp:8:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'const long unsigned int' [-Wsign-compare]
    8 |     for(int i=0; i<min(x.size(), y.size()); i++)
      |                  ~^~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...