Submission #150163

#TimeUsernameProblemLanguageResultExecution timeMemory
150163샌즈뼈 (#200)Wine Tasting (FXCUP4_wine)C++17
0 / 100
9 ms864 KiB
#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=6; vector<int> ret(N); for (i=0;i<N;i++) ret[i] = max(1,R[i]-C) - 1; 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 (stderr)

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 timeMemoryGrader output
Fetching results...