QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#125599#91. Secret PermutationQwerty1232Compile Error//C++20252b2023-07-16 23:56:342023-07-16 23:56:38

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:38]
  • 评测
  • [2023-07-16 23:56:34]
  • 提交

answer

#include <bits/stdc++.h>

//#include "permutation.h"

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

void solve(int n) {
	rnd.seed(2);
 	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:10:13: error: declaration of ‘int n’ shadows a parameter
   10 |         int n = 7;
      |             ^
answer.code:8:16: note: ‘int n’ previously declared here
    8 | void solve(int n) {
      |            ~~~~^
answer.code:13:12: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
   13 |     return 0;
      |            ^