사용자 랭킹

랭킹 사용자 한마디 푼 문제↓ 출제 답안 수 정답 비율
3822 freddok 11 0 31 14 (45%)
3822 knockcode 11 0 24 11 (45%)
3822 arusia 11 0 32 11 (34%)
3822 woc505 11 0 36 13 (36%)
3822 mirr1028 11 0 26 12 (46%)
3822 hyjk826 11 0 19 13 (68%)
3822 tozone1 11 0 34 13 (38%)
3822 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%)
3822 hwlee0103 11 0 30 12 (40%)
3822 HTKIM 11 0 24 11 (45%)
3822 koru 11 0 25 11 (44%)
3822 dys02007 11 0 90 12 (13%)
3822 dkfrhtmvkt 11 0 27 12 (44%)
3822 psycos88 11 0 21 12 (57%)
3822 hjazz 할룽 11 0 30 24 (80%)
3822 park870130 11 0 31 11 (35%)
3822 newenws 11 0 23 13 (56%)
3822 Kohun 11 0 60 12 (20%)
3822 jeonhyoju 11 0 35 11 (31%)
3822 cheh344 해산물이 싫어요 11 0 30 11 (36%)