# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
225666 | Ruxandra985 | Rope (JOI17_rope) | C++14 | 5 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |