QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#125598#91. Secret PermutationQwerty1232Compile Error//C++20237b2023-07-16 23:56:182023-07-16 23:56:18

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-16 23:56:18]
  • 评测
  • [2023-07-16 23:56:18]
  • 提交

answer

#include <bits/stdc++.h>

//#include "permutation.h"

std::mt19937 rnd(2086);
std::vector<int> vec(n);

void solve(int n) {
 	int n = 7;
	vec.resize(n);
    std::shuffle(vec.begin(), vec.begin() + 4, rnd);
    return 0;
}


Details

answer.code:6:22: error: ‘n’ was not declared in this scope; did you mean ‘yn’?
    6 | std::vector<int> vec(n);
      |                      ^
      |                      yn
answer.code: In function ‘void solve(int)’:
answer.code:9:13: error: declaration of ‘int n’ shadows a parameter
    9 |         int n = 7;
      |             ^
answer.code:8:16: note: ‘int n’ previously declared here
    8 | void solve(int n) {
      |            ~~~~^
answer.code:12:12: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
   12 |     return 0;
      |            ^