### 테스트케이스 1번이 자꾸 실패가 뜹니다.

계속 테스트케이스 1번이 실패가 뜨는데 혹시 이랫던 분 계신가요?

###### 작성중인 코드―solution.cpp
``````1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <string>
#include <vector>
#include <algorithm>
#include<iostream>
#include<functional>
using namespace std;

using ll = long long;

bool comp2(pair<ll, int> a, pair<ll, int> b)
{
return a.second < b.second;
}
int solution(vector<int> food_times, long long k) {
int answer = 0, cond = 1;

ll sum = 0;
ll size = food_times.size();

vector<int>::iterator iter = food_times.begin();
int  i = 0;
ll temp = k, count = 0, temp1 = 0 ,count2 =0 ,loop = 1;
vector<pair<ll, int>> copy;
vector<pair<ll, int>>::iterator iter1;
for (iter = food_times.begin(); iter != food_times.end(); iter++)
{
sum += (*iter);
copy.push_back(make_pair((ll)(*iter), i + 1));
i++;
}

if (sum <= k)
{
}

iter1 = copy.begin();

sort(copy.begin(), copy.end());

iter1 = copy.begin();

count = (*iter1).first;
loop = count;
while (cond)
{
temp -= size * count;
if (temp<0) break;
else if (size == 0) break;
else {
temp1 = temp;
count2 = 0;
for (; (*iter1).first == loop; iter1++) {
count2++;
}
loop = (*iter1).first;
iter1 -= 1;
count = loop - (*iter1).first;
iter1 += 1;
size -= count2;
}
}

temp1 = temp1 % size;

sort(iter1, copy.end(), comp2);

for (; temp1>0; temp1--) iter1++;