사용자 랭킹
랭킹 | 사용자 | 한마디 | 푼 문제↓ | 출제 | 답안 수 | 정답 비율 |
---|---|---|---|---|---|---|
3482 | relu | 코테 합격 기원 | 12 | 0 | 33 | 16 (48%) |
3782 | deblan2 | 11 | 0 | 26 | 11 (42%) | |
3782 | AIGO | 11 | 0 | 45 | 12 (26%) | |
3782 | limited107 | 11 | 0 | 31 | 11 (35%) | |
3782 | lqez | 11 | 1 | 33 | 11 (33%) | |
3782 | cos | 11 | 0 | 43 | 15 (34%) | |
3782 | redrumjisu | 11 | 0 | 34 | 16 (47%) | |
3782 | Protos | 11 | 0 | 47 | 14 (29%) | |
3782 | miffyzzang | 11 | 0 | 34 | 11 (32%) | |
3782 | Repil | 11 | 0 | 25 | 11 (44%) | |
3782 | Hexa | 11 | 0 | 94 | 32 (34%) | |
3782 | dnvy0084 | 11 | 0 | 58 | 22 (37%) | |
3782 | soso0265 | 11 | 0 | 34 | 12 (35%) | |
3782 | Song | 11 | 0 | 67 | 18 (26%) | |
3782 | spadeworker | 11 | 0 | 33 | 11 (33%) | |
3782 | leed | 11 | 0 | 58 | 14 (24%) | |
3782 | kth3321 | 11 | 0 | 21 | 11 (52%) | |
3782 | uwangg | 11 | 0 | 55 | 12 (21%) | |
3782 | 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%) |
3782 | kilo32 | 11 | 0 | 44 | 12 (27%) |