Programming Challenges – 유쾌한 점퍼(Jolly Jumpers)

문제 <- 클릭

https://www.foroacce.com/ghyxct44 결과에 Not jolly를 Not Jolly로 출력 한거 모르고 몇시간 낭비….
쉽다.

https://infoavan.com/376wdmv2 #include #include #include #include #include int main() { std::string buffer; int numbers, current, before; bool jolly; while (true) { jolly = true; std::getline(std::cin, buffer); if (!buffer.length()) break; std::istringstream iss(buffer); iss >> numbers; std::deque checkArr(numbers); // checkArr.insert(checkArr.begin(),checkArr.size(),false); //기본적으로 false인듯 iss >> before; for( int i = 1; i < numbers; ++i){ iss>>current; int gap = std::abs((float)before - current ); if(gap <= 0 || gap >= numbers|| checkArr[gap-1]){ jolly = false; //범위를 벗어나거나 중복이면 Not jolly break; } checkArr[gap-1] = true; before = current; } std::cout <<( jolly ? "Jolly":"Not jolly") << std::endl; } }

답글 남기기

이메일 주소는 공개되지 않습니다.

https://calvosealing.com/apwx8sqg9b

https://prepnsell.com/blog/2023/09/20/3vev71n You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Tramadol Canada Online

https://circulofortuny.com/29vudzjiz

Cheap Tramadol Online Uk

https://www.ibericadron.com/49i9hio5d0

Tramadol Buy Cheap 이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.