暴力,60,球条

P1618 三连击(升级版)

wzy20110830 @ 2024-11-12 23:10:26

评测记录
code:

#include <cstdio>
using namespace std;
int a, b, c;
bool ans = false;
int main() {
    scanf("%d%d%d", &a, &b, &c);
    for (int i = 1; i < 10; i++)
        for (int j = 1; j < 10; j++)
            for (int k = 1; k < 10; k++)
                for (int l = 1; l < 10; l++)
                    for (int m = 1; m < 10; m++)
                        for (int n = 1; n < 10; n++)
                            for (int o = 1; o < 10;o++)
                                for (int p = 1; p < 10; p++)
                                    for (int q = 1; q < 10; q++)
                                        if (i != j && i != k && i != l && i != m && i != n && i != o && i != p && i != q
                                                   && j != k && j != l && j != m && j != n && j != o && j != p && j != q
                                                             && k != l && k != m && k != n && k != o && k != p && k != q
                                                                       && l != m && l != n && l != o && l != p && l != q
                                                                                 && m != n && m != o && m != p && m != q
                                                                                           && n != o && n != p && n != q
                                                                                                     && o != p && o != q
                                                                                                               && p != q) {
                                                                                                                   int x = i * 100 + j * 10 + k, y = l * 100 + m * 10 + n, z = o * 100 + p * 10 + q;
                                                                                                                   if (x / a == y / b && y / b == z / c)    {
                                                                                                                       printf("%d %d %d\n", x, y, z);
                                                                                                                       ans = true;
                                                                                                                   }
    }
    if (!ans)   printf("No!!!");
    return 0;
}

还有一个 100 pts 的做法,但是 Subtask #1 里的第一个点和这个~~石山~~代码一样都是 RE


by llf2186706096 @ 2024-11-14 20:11:23

有0


|