QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#862227#8830. Breaking BaddsptCompile Error//C++231.1kb2025-01-18 23:10:102025-01-18 23:10:17

Judging History

你现在查看的是最新测评结果

  • [2025-01-18 23:10:17]
  • 评测
  • [2025-01-18 23:10:10]
  • 提交

answer

#include <time.h>
#include <random>
#include <stdio.h>
#include <string.h>
int c[1001], d[1001], a[1001][1001], b[1001][1001]; bool f[1001][5];
int main()
{
    std::mt19937 g(std::random_device{}()); bool e[5] = {};
    int n; scanf("%d", &n);
    for (int i(1); i <= n; ++i)
    {
        c[i] = d[i] = i;
        for (int j(1); j <= n; ++j) scanf("%d", &a[i][j]);
    }
    for (int t(1); t <= 40; ++t)
    {
        std::shuffle(c + 1, c + n + 1, g); std::shuffle(d + 1, d + n + 1, g);
        for (int i(1); i <= n; ++i) for (int j(1); j <= n; ++j) b[c[i]][d[j]] = a[i][j];
        std::swap(a, b);
        for (int i(1); i <= n; ++i) for (int j(0); j < 5; ++j) f[i][j] = false;
        f[0][0] = true;
        for (int i(1); i <= n; ++i) for (int j(i), h(0); j <= n; ++j)
        {
            h += a[j][i];
            for (int k(0); k < 5; ++k) f[j][(k + h) % 5] |= f[i - 1][k];
            h += a[j][j + 1] - a[j][i];
        }
        for (int i(0); i < 5; ++i) e[i] |= f[n][i];
    }
    for (int i(0); i < 5; ++i) putchar(e[i] ? 'Y' : 'N');
    return !putchar('\n');
}

Details

answer.code: In function ‘int main()’:
answer.code:17:14: error: ‘shuffle’ is not a member of ‘std’
   17 |         std::shuffle(c + 1, c + n + 1, g); std::shuffle(d + 1, d + n + 1, g);
      |              ^~~~~~~
answer.code:17:49: error: ‘shuffle’ is not a member of ‘std’
   17 |         std::shuffle(c + 1, c + n + 1, g); std::shuffle(d + 1, d + n + 1, g);
      |                                                 ^~~~~~~
answer.code:9:17: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |     int n; scanf("%d", &n);
      |            ~~~~~^~~~~~~~~~
answer.code:13:42: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |         for (int j(1); j <= n; ++j) scanf("%d", &a[i][j]);
      |                                     ~~~~~^~~~~~~~~~~~~~~~