Submission #259521

#TimeUsernameProblemLanguageResultExecution timeMemory
259521c4ts0upPoi (IOI09_poi)C++17
100 / 100
889 ms17560 KiB
/* ID: c4ts0up LANG: C++ TASK: */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define pb push_back #define ff first #define ss second const int NMAX = 2005; int n, t, p; vector <int> tasks, scores; vector <int> done[NMAX]; int main() { /*// freopen("", "r", stdin); freopen("", "w", stdout); //*/ cin >> n >> t >> p; scores.resize(n+1); tasks.resize(t); for (int i=1; i<=n; i++) { for (int j=0; j<t; j++) { int aux; cin >> aux; tasks[j] += aux; if (aux) done[i].pb(j); } } for (int i=1; i<=n; i++) { for (int x : done[i]) scores[i] += n-tasks[x]; } int philscore = scores[p]; int philsolved = done[p].size(); int above = 0; for (int i=1; i<=n; i++) { if (scores[i] > philscore) above++; else if (scores[i] < philscore) continue; // mismo puntaje else { if (done[i].size() > philsolved) above++; else if (done[i].size() < philsolved) continue; // mismo numero de tareas resueltas else { if (i < p) above++; else continue; } } } cout << philscore << " " << above+1 << endl; return 0; }

Compilation message (stderr)

poi.cpp: In function 'int main()':
poi.cpp:56:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (done[i].size() > philsolved) above++;
        ~~~~~~~~~~~~~~~^~~~~~~~~~~~
poi.cpp:57:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    else if (done[i].size() < philsolved) continue;
             ~~~~~~~~~~~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...