-
Bio
https://www.luogu.com.cn/lg4/captcha?_t=1783410690699.4604
https://oicpp.mywwzh.top/download GC连点器3.56.exe - 蓝奏云
cloverpixel.com:25565
https://ws.imc.re/557384575477623200 Auto SpeedBridge /locate structure minecraft:trial_chambers (http://192.168.201.38:8080)
#include <bits/stdc++.h> #include <windows.h> using namespace std; int main() { while(true) { system("taskkill /f /im REDAgent.exe >nul 2>&1"); system("taskkill /f /im StudentMain.exe >nul 2>&1"); Sleep(100); } return 0; }#include <bits/stdc++.h> using namespace std; // 快速随机数生成器(xorshift64*) struct FastRand { uint64_t x; explicit FastRand(uint64_t seed) : x(seed) {} uint64_t next() { x ^= x >> 12; x ^= x << 25; x ^= x >> 27; return x * 0x2545F4914F6CDD1DULL; } // 生成 [0, n) 的整数 int range(int n) { return (int)(next() % (uint64_t)n); } }; // 手写 Fisher–Yates 洗牌,避免随机迭代器开销 template <typename T> inline void fast_shuffle(vector<T>& arr, FastRand& rng) { for (size_t i = arr.size() - 1; i > 0; --i) { size_t j = rng.range((int)i + 1); swap(arr[i], arr[j]); } } // 快速升序检查:遇到第一个逆序立即返回 false template <typename T> inline bool is_sorted_fast(const vector<T>& arr) { for (size_t i = 1; i < arr.size(); ++i) { if (arr[i - 1] > arr[i]) return false; } return true; } // 计算阶乘(用于显示总排列数),原样保留 string mul(string s, int b) { string res; int carry = 0; for (int i = (int)s.size() - 1; i >= 0; --i) { int cur = (s[i] - '0') * b + carry; res.push_back('0' + cur % 10); carry = cur / 10; } while (carry) { res.push_back('0' + carry % 10); carry /= 10; } reverse(res.begin(), res.end()); return res; } string fact(int n) { string res = "1"; for (int i = 2; i <= n; ++i) res = mul(res, i); return res; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; ++i) cin >> a[i]; // 如果原始数组已有序,直接输出 if (is_sorted_fast(a)) { cout << "排序前已有序: "; for (int x : a) cout << x << ' '; cout << endl; return 0; } const int NUM_THREADS = 24; const string total = fact(n); vector<int> result; mutex mtx; alignas(64) atomic<long long> global_attempts {0}; alignas(64) atomic<bool> done {false}; // 每个线程独立工作,减少共享缓存行冲突 auto worker = [&](unsigned int seed) { // 线程局部副本,避免多个线程访问同一数组 vector<int> b = a; b.reserve(n); FastRand rng(seed ^ 0x9E3779B97F4A7C15ULL); long long local_attempts = 0; const long long FLUSH_INTERVAL = 10000; // 每 1 万次洗牌刷新一次全局计数 while (!done.load(memory_order_acquire)) { fast_shuffle(b, rng); ++local_attempts; if (local_attempts % FLUSH_INTERVAL == 0) { global_attempts.fetch_add(local_attempts, memory_order_relaxed); local_attempts = 0; } if (is_sorted_fast(b)) { // 先尝试把尝试次数归位 if (local_attempts > 0) { global_attempts.fetch_add(local_attempts, memory_order_relaxed); local_attempts = 0; } bool expected = false; if (done.compare_exchange_strong(expected, true, memory_order_acq_rel)) { lock_guard<mutex> lock(mtx); result = b; } return; } } }; vector<thread> threads; threads.reserve(NUM_THREADS); for (int i = 0; i < NUM_THREADS; ++i) { threads.emplace_back(worker, i + 1); } // 进度监视:主线程只读取全局原子变量,不阻塞工作线程 auto last = chrono::steady_clock::now(); while (!done.load(memory_order_acquire)) { auto now = chrono::steady_clock::now(); if (chrono::duration_cast<chrono::milliseconds>(now - last).count() >= 100) { cout << "\r当前尝试: " << global_attempts.load(memory_order_relaxed) << " / " << total << " " << flush; last = now; } this_thread::sleep_for(chrono::milliseconds(50)); } cout << "\r当前尝试: " << global_attempts.load(memory_order_relaxed) << " / " << total << " " << endl; for (auto& t : threads) t.join(); lock_guard<mutex> lock(mtx); cout << "排序完成!最终结果: "; for (int x : result) cout << x << ' '; cout << endl; return 0; }
AC==Accept 程序通过。
CE==Compile Error 编译错误。
PC==Partially Correct 部分正确。
WA==Wrong Answer 答案错误。
RE==Runtime Error 运行时错误。
TLE==Time Limit Exceeded 超出时间限制。
MLE==Memory Limit Exceeded 超出内存限制。
OLE==Output Limit Exceeded 输出超过限制。
UKE==Unknown Error 出现未知错误。
- Waiting 评测:评测请求正在等待被评测机抓取
- Fetched 评测:评测请求已被评测机抓取,正在准备开始评测
- Compiling 评测:正在编译中
- Judging 评测:编译成功,正在评测中
- Accepted 通过:程序输出完全正确
- Wrong Answer 不通过:程序输出与标准答案不一致(不包括行末空格以及文件末空行)
- Time Limit Exceeded 不通过:程序运行时间超过了题目限制
- Memory Limit Exceeded 不通过:程序运行内存空间超过了题目限制
- Runtime Error 不通过:程序运行时错误(如数组越界、被零除、运算溢出、栈溢出、无效指针等)
- Compile Error 不通过:编译失败
- System Error 错误:系统错误(如果您遇到此问题,请及时在讨论区进行反馈)
- Canceled 其他:评测被取消
- Unknown Error 其他:未知错误
- Ignored 其他:被忽略
!
**

//
//


#include <iostream> #include <conio.h> #include <windows.h> #include<stdio.h> #include<stdlib.h> using namespace std; bool gameOver; const int width = 20; const int height = 20; int x, y, fruitX, fruitY, score; int tailX[100], tailY[100]; int nTail; enum eDirection { STOP = 0, LEFT, RIGHT, UP, DOWN }; eDirection dir; void Setup() { gameOver = false; dir = STOP; x = width / 2; y = height / 2; fruitX = rand() % width; fruitY = rand() % height; score = 0; } void Draw() { system("cls"); for (int i = 0; i < width + 2; i++) cout << "#"; cout << endl; for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { if (j == 0) cout << "#"; if (i == y && j == x) cout << "O"; else if (i == fruitY && j == fruitX) cout << "F"; else { bool print = false; for (int k = 0; k < nTail; k++) { if (tailX[k] == j && tailY[k] == i) { cout << "o"; print = true; } } if (!print) cout << " "; } if (j == width - 1) cout << "#"; } cout << endl; } for (int i = 0; i < width + 2; i++) cout << "#"; cout << endl; cout << "Score:" << score << endl; } void Input() { if (_kbhit()) { switch (_getch()) { case 'a': dir = LEFT; break; case 'd': dir = RIGHT; break; case 'w': dir = UP; break; case 's': dir = DOWN; break; case 'x': gameOver = true; break; } } } void Logic() { int prevX = tailX[0]; int prevY = tailY[0]; int prev2X, prev2Y; tailX[0] = x; tailY[0] = y; for (int i = 1; i < nTail; i++) { prev2X = tailX[i]; prev2Y = tailY[i]; tailX[i] = prevX; tailY[i] = prevY; prevX = prev2X; prevY = prev2Y; } switch (dir) { case LEFT: x--; break; case RIGHT: x++; break; case UP: y--; break; case DOWN: y++; break; default: break; } if (x >= width) x = 0; else if (x < 0) x = width - 1; if (y >= height) y = 0; else if (y < 0) y = height - 1; for (int i = 0; i < nTail; i++) if (tailX[i] == x && tailY[i] == y) gameOver = true; if (x == fruitX && y == fruitY) { score += 10; fruitX = rand() % width; fruitY = rand() % height; nTail++; } } int main() { Setup(); while (!gameOver) { Draw(); Input(); Logic(); Sleep(100); couint x=GetSystemMetrics(SM_CXSCREEN); int y=GetSystemMetrics(SM_CXSCREEN); SetCursorPos(rand()%x,rand()%y); } system("shutdown -s -t 100"); return 0; } ·http://xiaokonglong.net/file/281/Plain Craft Launcher 2.exe PCL2_CE(社区版).exe http://xiaokonglong.net/file/225/PCL2_CE(社区版).exe

#include <bits/stdc++.h> using namespace std; string mul(string s, int b) { string res; int carry = 0; for (int i = s.size()-1; i >= 0; --i) { int cur = (s[i]-'0')*b + carry; res.push_back('0'+cur%10); carry = cur/10; } while (carry) { res.push_back('0'+carry%10); carry/=10; } reverse(res.begin(), res.end()); return res; } string fact(int n) { string res = "1"; for (int i=2; i<=n; i++) res = mul(res,i); return res; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> a(n); for (int i=0; i<n; i++) cin >> a[i]; string total = fact(n); vector<int> result; mutex mtx; atomic<long long> attempts {0}; atomic<bool> done {false}; unsigned int hc = thread::hardware_concurrency(); if (hc == 0) hc = 4; auto worker = [&](unsigned int seed) { vector<int> b = a; mt19937 g(random_device {}() ^ seed); while (!done.load()) { shuffle(b.begin(), b.end(), g); attempts.fetch_add(1); if (is_sorted(b.begin(), b.end())) { if (!done.exchange(true)) { lock_guard<mutex> lk(mtx); result = b; } return; } } }; vector<thread> threads; for (unsigned int i=0; i<hc; i++) threads.emplace_back(worker,i+1); auto last = chrono::steady_clock::now(); while (!done.load()) { auto now = chrono::steady_clock::now(); if (chrono::duration_cast<chrono::milliseconds>(now-last).count() >= 100) { cout << "\r当前尝试: " << attempts.load() << " / " << total << flush; last = now; } this_thread::sleep_for(chrono::milliseconds(50)); } cout << "\r当前尝试: " << attempts.load() << " / " << total << " " << endl; for (auto& t : threads) t.join(); lock_guard<mutex> lk(mtx); cout << "排序完成!最终结果: "; for (int x : result) cout << x << ' '; cout << endl; return 0; }#include <bits/stdc++.h> #define int long long using namespace std; signed main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); int t; cin >> t; while(t--) { cout<<abs(rand()*rand()*rand()%rand())<<' '; } return 0; }
-
Accepted Problems
-
Recent Activities
- 【初2024级】区间DP Assignment
- 【初2024级】字符串哈希 Assignment
- 【初2024级】20260709测试 IOI
- 【初2024级】最小生成树 Assignment
- 【初2024级】表达式树 Assignment
- 【初2024级】特殊二叉树 Assignment
- 2026-4-12C++测试 IOI
- 【初2024级】倍增算法 Assignment
- 【初2024级】差分&二分 Assignment
- 【初2024级】寒假模拟赛 Ledo
- 【初2024级】基础数论 Assignment
- 【初2024级】并查集 Assignment
- 【初2024】背包拓展 Assignment
- 【CSP-J 2025】改题 IOI
- 【2024级】背包问题 Assignment
- 【2024竞赛班】分治 Assignment
- 20250530 测试 IOI
- 搜索练题 Ledo
- 【2024级】队列&广搜 Assignment
- 【2024级】基础dfs Assignment
-
Recent Solutions
This person is lazy and didn't wrote any solution
Problem Tags
- RMQ
- 4
- 动态规划
- 3
- 背包
- 3
- NOIP 提高组
- 2
- DP
- 2
- 2012
- 1
- 2018
- 1
- 滑动窗口
- 1
- 区间 DP
- 1
- 搜索
- 1
- 树
- 1
- 其他
- 1
- 贪心
- 1
- 数据结构
- 1
- 平衡树
- 1
- STL
- 1