Submission #150259

# Submission time Handle Problem Language Result Execution time Memory
150259 2019-09-01T08:00:13 Z 샌즈뼈(#3582, exqt, esselem) Wine Tasting (FXCUP4_wine) C++17
0 / 100
10 ms 1044 KB
#include <bits/stdc++.h>
#include "bartender.h"
using namespace std;

std::vector<int> BlendWines(int K, std::vector<int> R)
{
	int N = R.size();
	int i;
	int C=7;
	vector<int> ret(N);
	for (i=0;i<N;i++) ret[i] = max(1,R[i]-C);
	return ret;
}
#include <bits/stdc++.h>
#include "taster.h"
using namespace std;

int a[40];
bool comp(int e1, int e2)
{
    if (a[e1]!=a[e2]) return a[e1]<a[e2];
    return Compare(e1,e2)==-1;
}

std::vector<int> SortWines(int K, std::vector<int> A)
{
	int N = A.size();
	vector<int> arr(N), ans(N);
	int i;
	for (i=0;i<N;i++) a[i]=A[i];
	for (i=0;i<N;i++) arr[i]=i;

    sort(arr.begin(),arr.end(),comp);

    for (i=0;i<N;i++)
        ans[arr[i]] = i+1;

	return ans;
}

Compilation message

taster.cpp: In function 'std::vector<int> SortWines(int, std::vector<int>)':
taster.cpp:22:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
     for (i=0;i<N;i++)
     ^~~
taster.cpp:25:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  return ans;
  ^~~~~~
# Verdict Execution time Memory Grader output
1 Correct 9 ms 644 KB Correct
2 Correct 9 ms 644 KB Correct
3 Correct 8 ms 772 KB Correct
4 Correct 10 ms 772 KB Correct
5 Correct 10 ms 908 KB Correct
6 Correct 9 ms 644 KB Correct
7 Correct 9 ms 1044 KB Correct
8 Correct 10 ms 772 KB Correct
9 Incorrect 10 ms 644 KB Wrong
10 Halted 0 ms 0 KB -