사용자 랭킹

랭킹 사용자 한마디 푼 문제↓ 출제 답안 수 정답 비율
3773 Repil 11 0 25 11 (44%)
3773 Hexa 11 0 94 32 (34%)
3773 dnvy0084 11 0 58 22 (37%)
3773 soso0265 11 0 34 12 (35%)
3773 Song 11 0 67 18 (26%)
3773 spadeworker 11 0 33 11 (33%)
3773 leed 11 0 58 14 (24%)
3773 kth3321 11 0 21 11 (52%)
3773 uwangg 11 0 55 12 (21%)
3773 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%)
3773 kilo32 11 0 44 12 (27%)
3773 boooooom 11 0 30 11 (36%)
3773 dhchoi 11 0 49 26 (53%)
3773 hjazz 할룽 11 0 30 24 (80%)
3773 astralhpi 11 0 68 15 (22%)
3773 mobumcy 11 0 20 14 (70%)
3773 jincreator 11 0 34 11 (32%)
3773 tlawo0113 11 0 50 12 (24%)
3773 lhw0772 11 0 53 11 (20%)
3773 inknights 11 0 17 11 (64%)