Background: old age, did so long to forget the EOF to the end of the document,
Experience: Be sure to debug yourself, until you feel that all the situation is considered or WA again with the help of the network.
Learning: 1. This is entitled reduction of Time to all m tables, then check the table.
#include <stdio.h>int main (void) { int num, x, y, Z;while (scanf ("%d", &num)!=eof) {for (int i = 1; i*i <= nu M i++) {for (int j = i, J*j <= num; j + +) {for (int k = j; k *k<= num; k++) {if (i*i + j*j + k*k = num) {x = I;y = J;z = k ; goto L1;}}} L1: printf ("%d%d%d\n", X, Y, z);}
HDU 1248
Study: 1. It seems that the great God is solved by DP
#include <stdio.h>int main () {int t;scanf ("%d", &t), while (t--) {int. m, min = 10000000;scanf ("%d", &m); for ( int i = 0; I * <= m; i++) {for (int j = 0; J *, <= M; j + +) {for (int k = 0; K * <= m; k++) {if (I * + j * *) + K * <= M&A Mp;&m-(I * + J * + + K *) < min) min = M-(i * + j * + K * 350);}} printf ("%d\n", Min);} return 0;}
HDU 1407 1248 Violent enumeration