-
Bio
~~ 古有SHHH今有HDXX。~~ 666~
评测状态
- Waiting 评测:评测请求正在等待被评测机抓取
- Fetched 评测:评测请求已被评测机抓取,正在准备开始评测
- Compiling 评测:正在编译中
- Judging 评测:编译成功,正在评测中
- Accepted 通过:程序输出完全正确
- Wrong Answer 不通过:程序输出与标准答案不一致(不包括行末空格以及文件末空行)
- Time Limit Exceeded 不通过:程序运行时间超过了题目限制
- Memory Limit Exceeded 不通过:程序运行内存空间超过了题目限制
- Runtime Error 不通过:程序运行时错误(如数组越界、被零除、运算溢出、栈溢出、无效指针等)
- Compile Error 不通过:编译失败
- System Error 错误:系统错误(如果您遇到此问题,请及时在讨论区进行反馈)
- Canceled 其他:评测被取消
- Unknown Error 其他:未知错误
- Ignored 其他:被忽略
yym的细节 @浴谷,一言你们想干什么/要不要这么离谱:
666
(一言啥时候念广告了?)
原来你也知道啊,一言:
`
lxn现在以经对其他人屏蔽了以下内容
![image(/file/271/eh1eMKlgGqexlw97XV7lA.png) ![image(/file/271/jRWS7x4_XQSQbs1a7eZrA.png)
#include #include 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); //mmmmmmmkqzwxecrvtbynum// 控制游戏速度 } return 0; }
# 手搓质数判断函数 是输出1,不是输出0; bool zp(int m){ bool b=0; for(int i=2;i<m;i++){ if(m%i==0){ b=1; break; } } return b; }
# 李欣柠干的好事——呈堂证供 ![image]

![image]# yangyouming106240329ly
-
Accepted Problems
-
Recent Activities
- 【2024竞赛班】分治 Assignment
- 20250530 测试 IOI
- 【2024级】队列&广搜 Assignment
- 【2024级】递归算法 Assignment
- 【2024级】基础dfs Assignment
- 【2024-2025-3-21】3月测试 IOI
- 【2024级】简单排序 Assignment
- 【2024级】递推算法 Assignment
- 【2024级】枚举&优化 Assignment
- 【2024级】字符串作业 Assignment
- 【2024级】字符&字符数组作业 Assignment
- 【2024级】语法测试 IOI
- 【2024级】函数作业 Assignment
- 【2024级】二维数组作业 Assignment
- 【2024级】循环结构作业 Assignment
- 【2024级】选择结构作业 Assignment
- 【2024级】顺序结构作业 Assignment
- 【2024级】一维数组作业 Assignment
-
Recent Solutions
This person is lazy and didn't wrote any solution
Problem Tags
- 递推
- 1