사용자 랭킹
랭킹 | 사용자 | 한마디 | 푼 문제↓ | 출제 | 답안 수 | 정답 비율 |
---|---|---|---|---|---|---|
3769 | Song | 11 | 0 | 67 | 18 (26%) | |
3769 | spadeworker | 11 | 0 | 33 | 11 (33%) | |
3769 | leed | 11 | 0 | 58 | 14 (24%) | |
3769 | kth3321 | 11 | 0 | 21 | 11 (52%) | |
3769 | uwangg | 11 | 0 | 55 | 12 (21%) | |
3769 | includex | //CONCERT #include <stdio.h> #include <string.h> #include <vector> using namespace std; int getLastV(vector<int>& vlist, int _nVMax, int _nV, int _Vpos){ int nP = _nV + vlist[_Vpos]; int nM = _nV - vlist[_Vpos]; if(nP <= _nVMax){ if(vlist.size() > _Vpos + 1){ nP = getLastV(vlist, _nVMax, nP, _Vpos + 1); } }else{ nP = -1; } if(nM >= 0){ if(vlist.size() > _Vpos + 1){ nM = getLastV(vlist, _nVMax, nM, _Vpos + 1); } }else{ nM = -1; } if(nP > nM){ return nP; }else{ return nM; } return -1; } int main(){ char dumy[64]; int nCase = 0; scanf("%d", &nCase); gets(dumy); for(int i = 0; i < nCase; i++){ unsigned int nVCount = 0; unsigned int nVStart = 0; unsigned int nVMax = 0; scanf("%d %d %d", &nVCount, &nVStart, &nVMax); gets(dumy); vector<int> vlist; unsigned int nV = 0; for(int iV = 0; iV < nVCount; iV++){ scanf("%d", &nV); vlist.push_back(nV); } gets(dumy); printf("%d\n", getLastV(vlist, nVMax, nVStart, 0)); } return 0; } | 11 | 0 | 41 | 12 (29%) |
3769 | kilo32 | 11 | 0 | 44 | 12 (27%) | |
3769 | boooooom | 11 | 0 | 30 | 11 (36%) | |
3769 | dhchoi | 11 | 0 | 49 | 26 (53%) | |
3769 | hjazz | 할룽 | 11 | 0 | 30 | 24 (80%) |
3769 | astralhpi | 11 | 0 | 68 | 15 (22%) | |
3769 | mobumcy | 11 | 0 | 20 | 14 (70%) | |
3769 | jincreator | 11 | 0 | 34 | 11 (32%) | |
3769 | tlawo0113 | 11 | 0 | 50 | 12 (24%) | |
3769 | lhw0772 | 11 | 0 | 53 | 11 (20%) | |
3769 | inknights | 11 | 0 | 17 | 11 (64%) | |
3769 | rachael | 11 | 0 | 48 | 12 (25%) | |
3769 | oppab | 11 | 0 | 36 | 11 (30%) | |
3769 | nedin12 | 11 | 0 | 68 | 18 (26%) | |
3769 | wowrupi | CAC(Chosun ACM-ICPC CLUB) | 11 | 0 | 95 | 15 (15%) |