Works Application 2017 笔试题 [Exam1] Magic Cube
来源:互联网 发布:淘宝客订单一直失效 编辑:程序博客网 时间:2024/05/21 06:16
[Exam1] Magic Cube
Description
Magic cube is a cube (M*M*M) which contains a integer number (0 <= number < P) in each cell (So you know there are M ^ 3 numbers).
Alice have one big cube and N smaller cubes (each small cube is unique).
The cube is magic since when you put a small cube in bigger one, the number in the same location will add up and mod P.
Your job is to determine the location of each small cube, so that we can make every number in big cube equal 0 after putting all the small cubes.
Notice
We guarantee that there is only one solution.
You cannot rotate cube.
We give the numbers in cubes in order of position [0,0,0], [0,0,1], …, [0,1,0], …,[1,0,0], …
Limits
Memory limit per test: 256 megabytes
Tiem limit per test: The faster the better
Compile & Environment
C++
g++ Main.cc -o Main -fno-asm -Wall -lm –static -std=c++0x -DONLINE_JUDGE
Java J2SE 8
Maximum stack size is 50m
Input
The first line is three integer M (2 <= M <= 7), N (1<= N <= 12), P ( 3 <= P <=5 )
Second line is M*M*M integers, showing the numbers in big cube.
Then is N lines, in which first is a integer L[i] ( 1 <= L[i] < M) shows the length of the small cube, then follows L[i] ^ 3 numbers (0 <= number < P).
Output
Output N lines of triad of integers, shows the location of this small cube.
Sample Test
Input
2 1 3
1 0 0 0 0 0 0 0
1 2
Output
0 0 0
- Works Application 2017 笔试题 [Exam1] Magic Cube
- Works Application 2017 笔试题
- Works Application 2017 笔试 [Exam2] Wireless Routers
- Maigc Cubes:2017 Works Application笔试
- Works Applications的笔试题
- ZOJ Magic Cube 2477
- zoj2477 Magic Cube (bfs)
- ZOJ-2477 Magic Cube
- Magic Cube ZOJ
- Works applications 2014笔试题(1)
- Works applications 笔试题(2)
- Works applications 笔试题(3)
- Works Application面试总结
- Works Application面试经验
- Works System的笔试
- Works Applications 面试笔试!
- SSD3-EXAM1
- How Tomcat works 之The Application 应用
- hive UDF函数开发
- 关于论坛数据库的设计
- 贪吃蛇
- python入门学习记录
- 搭建windows的GIT server报错:/usr/bin/git.exe: error while loading shared libraries
- Works Application 2017 笔试题 [Exam1] Magic Cube
- 矩形覆盖
- redis入门
- 数字货币钱包开发
- StringBuilder与StringBuffer的区别(转)
- 用到BMOB数据库和登录,自己封装的几个方法
- HDU 1231(最大子段和)
- poj 2481 Cows 树状数组+逆序对变形
- 双端队列+与非运算——Basic Data Structure ( HDU 5929 )