Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int
- main(int argc, char *argv[]) {
- const int TOTAL = 711;
- ulong a[4] = {TOTAL}, top[3] = {0}, max[3] = {0};
- ulong time;
- int i;
- #define L(level) \
- top[level] = level>0 ? a[level-1]+top[level-1] : 0; \
- max[level] = (TOTAL-top[level]) / (4 - level); \
- for(a[level]=TOTAL-top[level]-(3-level); a[level]>max[level]; a[level]--)
- time=nsec();
- L(0) {
- L(1) {
- L(2) {
- a[3] = TOTAL-top[2]-a[2];
- if(TOTAL * 1000000 == a[0] * a[1] * a[2] * a[3])
- print("%03uld %03uld %03uld %03uld\n", a[0], a[1], a[2], a[3]);
- }}}
- print("%0.03f\n", (double)(nsec() - time) / 1000 / 1000 / 1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement