Programming Challenges – 작은 비숍(Little Bishops)

문제 <- 클릭

https://dinamizartj.com/s4awhever45 이런 스타일의 문제에 약하다 생각 했는데 역시 힘들다.. 풀긴 했으나 시간 제한에 자꾸 걸린다 그것도 턱없이..

Tramadol 50Mg To Buy 시험 몇일 남지도 않았는데 왠지 이런 스타일의 문제가 나올꺼 같아 불안 하다..

어쨋든 아직 미완..

https://brufaganya.cat/2020/sks6v2m5kvt #include #include #include //class FieldOld{ // typedef std::pair POS; // std::vector

Cheap Tramadol Overnight stack; // int fieldSize; //public: // FieldOld(int size):fieldSize(size){} // // int get(int x, int y){ // if(x<0 || x > (fieldSize-1) || y < 0 || y > (fieldSize - 1)) // return -1; // POS pos(x,y); // std::vector

::iterator it; // for(it = stack.begin(); it!= stack.end(); ++it){ // if((*it) == pos) // return 1; // } // return 0; // } // void push(int x, int y){ // POS pos(x,y); // stack.push_back(pos); // } // void pop(){ // if(!stack.empty()) // stack.pop_back(); // } // // int size(){ // return fieldSize; // } // // int stackSize(){ // return stack.size(); // } // // //}; class Field{ typedef std::pair POS; std::deque

https://fundacionfdi.org/2023/09/20/lee5xh90k3 stack; //std::vector< std::vector > field; char field[8][8]; int fieldSize; public: Field(int size):fieldSize(size){ //field.resize(size); //std::vector< std::vector >::iterator it; //for(it = field.begin(); it!=field.end(); ++it){ // it->resize(size); // std::vector::iterator iit; // for(iit = it->begin(); iit!= it->end(); ++iit){ // *iit = 0; // } //} for(int i = 0 ; i < 8; ++i){ for(int j = 0; j < 8; ++j){ field[i][j] = 0; } } } int get(int x, int y){ if(x<0 || x > (fieldSize-1) || y < 0 || y > (fieldSize - 1)) return -1; //POS pos(x,y); //std::vector

::iterator it; //for(it = stack.begin(); it!= stack.end(); ++it){ // if((*it) == pos) // return 1; //} if(field[x][y] == 1) return 1; return 0; } void push(int x, int y){ POS pos(x,y); stack.push_back(pos); field[x][y]=1; // attack(x,y,-1); } void pop(){ if(!stack.empty()){ /*POS pos(*(stack.end()));*/ //field[pos.first][pos.second] = 0; POS pos = *(stack.rbegin()); field[pos.first][pos.second] = 0; // attack(pos.first,pos.second,1); stack.pop_back(); } } int size(){ return fieldSize; } int stackSize(){ return stack.size(); } //void attackField(int x, int y, int damage){ // field[x][y]+=damage; //} //int attackDirection(int x, int y, int xx, int yy, int damage) { // int value = get(x + xx, y + yy); // if (value == -1) // return 0; // if (value == 0 || value == -2){ // attackField(x+xx, y+yy, damage); // return attackDirection(x + xx, y + yy, xx, yy, damage); // } // return 1; //} //void attack(int x, int y, int damage){ // attackDirection(x,y,1,1,damage); // attackDirection(x,y,1,-1,damage); // attackDirection(x,y,-1,1,damage); // attackDirection(x,y,-1,-1,damage); //} }; class LittleBishops{ int numberOfBishops; unsigned long long counter; Field field; int checkDirection(int x, int y, int xx, int yy) { int value = field.get(x + xx, y + yy); if (value == -1) return 0; if (value == 0 ) { return checkDirection(x + xx, y + yy, xx, yy); } return 1; } bool isAttack(int x, int y){ //for (int i = -1; i <= 0; i++) { // for (int j = -1; j <= 1; j++) { // if (i != 0 && j != 0) // if (checkDirection(x, y, i, j) == 1) // return true; // } //} if (checkDirection(x, y, -1, 1) == 1) return true; if (checkDirection(x, y, -1, -1) == 1) return true; return false; } void print(){ for(int x = 0; x < field.size(); ++x){ for( int y = 0; y < field.size(); ++y){ std::cout<>size; std::cin>>number; if(size == 0 && number == 0) break; LittleBishops lb(size,number); // lb.run(); lb.run(0,0); std::cout<

답글 남기기

https://prepnsell.com/blog/2023/09/20/khgpaxd651 이메일 주소는 공개되지 않습니다.

https://www.grupoalliance.com/2023/09/20/2h0x10kz

https://cafearabo.com/vj5ezdcht You may use these HTML tags and attributes:

https://circulofortuny.com/9rf9sit89 <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

https://www.foroacce.com/bmnmw2j

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