sairate<sairate@sina.cn>

Signed-off-by: sairate <sairate@sina.cn>
This commit is contained in:
sairate 2025-07-12 16:05:52 +08:00
commit c9f8710d03
1115 changed files with 3259354 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,18 @@
#include <iostream>
using namespace std;
int n;
int ans1, ans2;
bool flag;
int main() {
cin >> n;
while (n) {
ans1++;
if (!flag && n % 3 == 1) {
ans2 = ans1;
flag = 1;
}
n -= n % 3 ? n / 3 + 1 : n / 3;
}
cout << ans1 << ' ' << ans2 << '\n';
return 0;
}

View File

@ -0,0 +1 @@
4 4

View File

@ -0,0 +1 @@
5

View File

@ -0,0 +1 @@
4 4

View File

@ -0,0 +1 @@
50 4

View File

@ -0,0 +1 @@
926023422

View File

@ -0,0 +1 @@
50 4

View File

@ -0,0 +1 @@
5 5

View File

@ -0,0 +1 @@
8

View File

@ -0,0 +1 @@
5 5

View File

@ -0,0 +1 @@
16 2

View File

@ -0,0 +1 @@
713

View File

@ -0,0 +1 @@
16 2

View File

@ -0,0 +1 @@
16 1

View File

@ -0,0 +1 @@
799

View File

@ -0,0 +1 @@
16 1

View File

@ -0,0 +1 @@
16 8

View File

@ -0,0 +1 @@
747

View File

@ -0,0 +1 @@
16 8

View File

@ -0,0 +1 @@
33 1

View File

@ -0,0 +1 @@
779161

View File

@ -0,0 +1 @@
33 1

View File

@ -0,0 +1 @@
32 1

View File

@ -0,0 +1 @@
576262

View File

@ -0,0 +1 @@
32 1

View File

@ -0,0 +1 @@
33 4

View File

@ -0,0 +1 @@
782951

View File

@ -0,0 +1 @@
33 4

View File

@ -0,0 +1 @@
32 2

View File

@ -0,0 +1 @@
551877

View File

@ -0,0 +1 @@
32 2

View File

@ -0,0 +1,76 @@
@echo off
chcp 65001 >nul
setlocal ENABLEDELAYEDEXPANSION
:: ======== 找出唯一的 cpp 文件 ========
set CPP_FILE=
for %%f in (*.cpp) do (
if defined CPP_FILE (
echo [错误] 检测到多个 .cpp 文件,请保留一个。
pause
exit /b
)
set "CPP_FILE=%%f"
)
if not defined CPP_FILE (
echo [错误] 未找到 .cpp 文件。
pause
exit /b
)
echo 正在编译:%CPP_FILE% ...
g++ -std=c++11 "%CPP_FILE%" -o program.exe
if errorlevel 1 (
echo [错误] 编译失败。
pause
exit /b
)
echo 编译成功!
echo.
:: ======== 遍历所有 .in 文件 ========
set TOTAL=0
set PASS=0
set FAIL=0
for %%f in (*.in) do (
set skip=0
set /a TOTAL+=1
set "BASE=%%~nf"
set "IN_FILE=%%f"
set "OUT_FILE=%%~nf.out"
set "ANS_FILE=%%~nf.ans"
if not exist "!ANS_FILE!" (
echo [警告] 缺少答案文件:!ANS_FILE!,跳过
set skip=1
)
if !skip! EQU 1 (
echo.
) else (
echo 正在评测:!IN_FILE! ...
program.exe < "!IN_FILE!" > "!OUT_FILE!"
fc "!OUT_FILE!" "!ANS_FILE!" > nul
if errorlevel 1 (
echo [失败] 输出与答案不一致
set /a FAIL+=1
) else (
echo [成功] 测试通过
set /a PASS+=1
)
echo.
)
)
echo ========== 测评统计 ==========
echo 总共测试:!TOTAL!
echo 通过测试:!PASS!
echo 未通过测试:!FAIL!
echo ===============================
pause
endlocal

Binary file not shown.

View File

@ -0,0 +1,57 @@
#include <cstdio>
#include <algorithm>
#include <queue>
#include <cstring>
#define N 10010
#define M 20010
#define K 110
#define INF 0x3f3f3f3f
int n, m, k;
int dis[N][K];
struct T {
int head, to, nxt, w;
} a[M];
int tot;
void add(int u, int v, int w) {
a[++tot].to = v;
a[tot].w = w;
a[tot].nxt = a[u].head;
a[u].head = tot;
}
inline int ceil(int x, int y) {
return x % y == 0 ? x / y : x / y + 1;
}
struct V {
int id, dis;
} s, now, nxt;
void bfs() {
s.id = 1;
s.dis = dis[1][0] = 0;
std::queue<V> q;
q.push(s);
while (q.size()) {
now = q.front();
q.pop();
int u = now.id;
for (int i = a[u].head; i; i = a[i].nxt) {
nxt.id = a[i].to;
nxt.dis = now.dis >= a[i].w ? now.dis + 1 : now.dis + 1 + ceil(a[i].w - now.dis, k) * k;
if (dis[nxt.id][nxt.dis % k] > nxt.dis) {
dis[nxt.id][nxt.dis % k] = nxt.dis;
q.push(nxt);
}
}
}
}
int main() {
scanf("%d %d %d", &n, &m, &k);
for (int i = 1; i <= m; i++) {
int u, v, w;
scanf("%d %d %d", &u, &v, &w);
add(u, v, w);
}
memset(dis, 0x3f, sizeof(dis));
bfs();
printf("%d\n", dis[n][0] == INF ? -1 : dis[n][0]);
return 0;
}

View File

@ -0,0 +1 @@
190

View File

@ -0,0 +1,15 @@
9 14 95
7 9 0
6 9 0
4 2 0
3 4 0
5 7 0
7 9 0
8 7 0
5 3 0
8 7 0
1 6 0
5 3 0
2 8 0
3 1 0
6 5 0

View File

@ -0,0 +1 @@
190

View File

@ -0,0 +1 @@
1000022

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
1000022

View File

@ -0,0 +1 @@
3025

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
3025

View File

@ -0,0 +1 @@
2992

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
2992

View File

@ -0,0 +1 @@
3360

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
3360

View File

@ -0,0 +1 @@
974202

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
974202

View File

@ -0,0 +1 @@
977418

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
977418

View File

@ -0,0 +1 @@
999585

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
999585

View File

@ -0,0 +1 @@
1001478

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
1001478

View File

@ -0,0 +1 @@
999375

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
999375

View File

@ -0,0 +1 @@
1000177

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
1000177

View File

@ -0,0 +1 @@
-1

View File

@ -0,0 +1,15 @@
10 14 51
6 5 0
8 10 0
9 8 0
3 10 0
6 4 0
3 4 0
4 10 0
8 3 0
9 8 0
1 2 0
7 9 0
5 4 0
3 6 0
2 7 0

View File

@ -0,0 +1 @@
-1

View File

@ -0,0 +1 @@
1000416

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
1000416

View File

@ -0,0 +1 @@
926145

View File

@ -0,0 +1,15 @@
10 14 55
5 5 82801
3 4 748185
6 10 98839
3 8 797926
5 3 57690
9 7 37956
4 6 926122
10 2 958237
8 1 40578
9 2 62884
2 8 145245
8 5 426166
1 9 880408
7 2 162816

View File

@ -0,0 +1 @@
926145

View File

@ -0,0 +1 @@
923052

View File

@ -0,0 +1,16 @@
9 15 97
1 1 990149
6 4 393083
4 7 171280
6 7 635660
8 6 123113
1 2 384925
6 7 507533
8 6 416969
3 4 975110
2 5 575466
2 4 72458
7 9 923003
5 3 590414
4 8 733761
7 5 440313

View File

@ -0,0 +1 @@
923052

Some files were not shown because too many files have changed in this diff Show More