2009-12-14から1日間の記事一覧

PKU 1023 The Fun Number System

PKU

The Fun Number System下位ビットから順に計算していく、Nのiビット目が1ならば、より上位のビットがiビット目に影響することはないので、出力も1となる。 #include <iostream> #include <string> using namespace std; int main() { int t; cin >> t; while ( t-- > 0 ) { int</string></iostream>…

PKU 1022 Packing Unit 4D Cubes

PKU

Packing Unit 4D Cubes4次元にビビらされるけど難しくはない。どれか1つのキューブの位置を適当に決めて、整合性をチェックしながら、隣接するキューブの位置を求めていく。 #include <iostream> #include <vector> using namespace std; struct CUBE { int id; // id int ne</vector></iostream>…