mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
parent
148a2511af
commit
dd6f260b29
30
S2OJ/1803/1803.cpp
Normal file
30
S2OJ/1803/1803.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
#include <iostream>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
const int N = 3e7 + 5;
|
||||
|
||||
int n, s, b, c, d, a[N], ans;
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
cin >> n >> s >> b >> c >> d;
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
a[i] = i;
|
||||
s = (static_cast<long long>(s) * b + c) % d;
|
||||
std::swap(a[i], a[s % i + 1]);
|
||||
}
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
ans = std::max(ans, i - a[i]);
|
||||
}
|
||||
|
||||
cout << ans << endl;
|
||||
|
||||
return 0;
|
||||
}
|
BIN
S2OJ/1803/data/bubble1.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble1.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble1.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble10.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble10.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble10.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble2.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble2.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble2.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble3.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble3.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble3.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble4.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble4.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble4.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble5.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble5.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble5.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble6.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble6.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble6.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble6.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble7.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble7.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble7.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble7.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble8.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble8.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble8.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble8.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble9.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble9.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/bubble9.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/bubble9.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1803/data/problem.conf
(Stored with Git LFS)
Normal file
BIN
S2OJ/1803/data/problem.conf
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user