Submission #225666

#TimeUsernameProblemLanguageResultExecution timeMemory
225666Ruxandra985Rope (JOI17_rope)C++14
0 / 100
5 ms384 KiB
#include <bits/stdc++.h> using namespace std; int f[1000010] , v[1000010]; int main() { FILE *fin = stdin; FILE *fout = stdout; int n , m , i , sol , j; fscanf (fin,"%d%d",&n,&m); for (i = 1 ; i <= n ; i++){ fscanf (fin,"%d",&v[i]); f[v[i]]++; } for (i = 1 ; i <= m ; i++){ sol = n - f[i]; /// iti alegi o culoare auxiliara for (j = 1 ; j <= m ; j++){ if (j != i) sol = min(sol , n - f[i] - f[j]); } fprintf (fout,"%d\n",sol); } return 0; }

Compilation message (stderr)

rope.cpp: In function 'int main()':
rope.cpp:10:12: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     fscanf (fin,"%d%d",&n,&m);
     ~~~~~~~^~~~~~~~~~~~~~~~~~
rope.cpp:12:16: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         fscanf (fin,"%d",&v[i]);
         ~~~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...