QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#886039 | #9909. 阿尔塔尔 2 | gapeqi | Compile Error | / | / | C++14 | 359b | 2025-02-06 20:17:09 | 2025-02-06 20:17:12 |
Judging History
This is the latest submission verdict.
- [2025-02-06 20:17:12]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2025-02-06 20:17:09]
- Submitted
answer
#include "altar.h"
#include<bits/stdc++.h>
using namespace std;
int a[5005];
int altar(int n)
{
mt19937 rd(20240207);
for(int i=1;i<=n;i++) a[i]=i; int tp=n;
while(1)
{
random_shuffle(a+1,a+tp,rd); int t=tp; tp=0;
for(int i=1;i<t;i++)
if(!sense(a[0],a[i])) a[++tp]=0;
if(!tp)return a[0];
}
}
Details
answer.code: In function ‘int altar(int)’: answer.code:11:23: warning: ‘void std::random_shuffle(_RAIter, _RAIter, _Generator&&) [with _RAIter = int*; _Generator = mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&]’ is deprecated: use 'std::shuffle' instead [-Wdeprecated-declarations] 11 | random_shuffle(a+1,a+tp,rd); int t=tp; tp=0; | ~~~~~~~~~~~~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from answer.code:2: /usr/include/c++/14/bits/stl_algo.h:4530:5: note: declared here 4530 | random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h: In instantiation of ‘void std::random_shuffle(_RAIter, _RAIter, _Generator&&) [with _RAIter = int*; _Generator = mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&]’: answer.code:11:23: required from here 11 | random_shuffle(a+1,a+tp,rd); int t=tp; tp=0; | ~~~~~~~~~~~~~~^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4546:55: error: no match for call to ‘(std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>) (long int)’ 4546 | _RandomAccessIterator __j = __first + __rand((__i - __first) + 1); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/random:48, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:179: /usr/include/c++/14/bits/random.h:689:7: note: candidate: ‘std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::operator()() [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253; result_type = long unsigned int]’ 689 | operator()(); | ^~~~~~~~ /usr/include/c++/14/bits/random.h:689:7: note: candidate expects 0 arguments, 1 provided