Diff
checker
文本
文本
图像
文档
Excel
文件夹
Legal
Enterprise
桌面版
定价
登录
下载 Diffchecker 桌面版
比较文本
查找两个文本文件之间的差异
工具
历史
实时编辑器
折叠未更改行
关闭换行
视图
拆分
统一
比对精度
智能
单词
字符
语法高亮
选择语法
忽略
文本转换
转到第一个差异
编辑输入
Diffchecker Desktop
运行Diffchecker最安全的方式。获取Diffchecker桌面应用:您的差异永远不会离开您的电脑!
获取桌面版
Untitled diff
创建于
9年前
差异永不过期
清除
导出
分享
解释
15 删除
行
总计
删除
字符
总计
删除
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
49 行
全部复制
12 添加
行
总计
添加
字符
总计
添加
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
49 行
全部复制
#include <stdio.h>
#include <stdio.h>
#include <stack>
#include <stack>
#include <map>
#include <map>
#include <string.h>
#include <string.h>
#include <string>
#include <string>
#include <iostream>
#include <iostream>
#include <algorithm>
#include <algorithm>
#include <iomanip>
#include <iomanip>
#include <math.h>
#include <math.h>
#include <vector>
#include <vector>
#include <set>
#include <set>
#include <queue>
#include <queue>
#include <functional>
#include <functional>
using namespace std;
using namespace std;
#define ll long long
#define ll long long
#define mp make_pair
#define mp make_pair
#define pb push_back
#define pb push_back
//#define ld long double
//#define ld long double
const double sn = 1e-6;
const double sn = 1e-6;
ll mod = 1000000007;
ll mod = 1000000007;
ll dp[5000005];
ll dp[5000005];
复制
已复制
复制
已复制
ll
t, l, r;
int
t, l, r;
int main() {
int main() {
复制
已复制
复制
已复制
scanf("%
I64d%I64d%I64d
", &t, &l, &r);
scanf("%
d %d %d
", &t, &l, &r);
ll ans = 0;
ll ans = 0;
复制
已复制
复制
已复制
for (
ll
i = 2; i <= r; i++) {
for (
int
i = 2; i <= r; i++) {
dp[i] = LLONG_MAX;
dp[i] = LLONG_MAX;
}
}
复制
已复制
复制
已复制
for (
ll
i = 2; i <= r; i++) {
for (
int
i = 2; i <= r; i++) {
dp[i] = min(
dp[i],
((i*
(i - 1)
)
/ 2
)
);
dp[i] = min(
dp[i],
1ll * i *
(i - 1)
/ 2
);
复制
已复制
复制
已复制
for (
ll
j = 2 * i; j <= r; j += i) {
for (
int
j = 2 * i; j <= r; j += i) {
ll
t = j/i;
int
t = j/i;
ll val =
((t*
(t - 1)
)
/ 2
)
;
ll val =
1ll * t *
(t - 1)
/ 2
;
val = (val * i);
val = (val * i);
dp[j] = min(dp[j], (val + dp[i]));
dp[j] = min(dp[j], (val + dp[i]));
}
}
}
}
ll ti = 1;
ll ti = 1;
复制
已复制
复制
已复制
for (
ll
i = 0; i <= r - l; i++) {
for (
int
i = 0; i <= r - l; i++) {
ll v1 = ti
%mod
, v2 = dp[i+l]%mod;
ll v1 = ti
, v2 = dp[i+l]%mod;
ll v3 =
(v1*v2) % mod
;
ll v3 =
v1 * v2
;
ans = (ans + v3) % mod;
ans = (ans + v3) % mod;
ti = (ti*t) % mod;
ti = (ti*t) % mod;
}
}
printf("%I64d\n", ans%mod);
printf("%I64d\n", ans%mod);
return 0;
return 0;
}
}
已保存差异
原始文本
打开文件
#include <stdio.h> #include <stack> #include <map> #include <string.h> #include <string> #include <iostream> #include <algorithm> #include <iomanip> #include <math.h> #include <vector> #include <set> #include <queue> #include <functional> using namespace std; #define ll long long #define mp make_pair #define pb push_back //#define ld long double const double sn = 1e-6; ll mod = 1000000007; ll dp[5000005]; ll t, l, r; int main() { scanf("%I64d%I64d%I64d", &t, &l, &r); ll ans = 0; for (ll i = 2; i <= r; i++) { dp[i] = LLONG_MAX; } for (ll i = 2; i <= r; i++) { dp[i] = min(dp[i], ((i*(i - 1)) / 2)); for (ll j = 2 * i; j <= r; j += i) { ll t = j/i; ll val = ((t*(t - 1)) / 2); val = (val * i); dp[j] = min(dp[j], (val + dp[i])); } } ll ti = 1; for (ll i = 0; i <= r - l; i++) { ll v1 = ti%mod, v2 = dp[i+l]%mod; ll v3 = (v1*v2) % mod; ans = (ans + v3) % mod; ti = (ti*t) % mod; } printf("%I64d\n", ans%mod); return 0; }
更改后文本
打开文件
#include <stdio.h> #include <stack> #include <map> #include <string.h> #include <string> #include <iostream> #include <algorithm> #include <iomanip> #include <math.h> #include <vector> #include <set> #include <queue> #include <functional> using namespace std; #define ll long long #define mp make_pair #define pb push_back //#define ld long double const double sn = 1e-6; ll mod = 1000000007; ll dp[5000005]; int t, l, r; int main() { scanf("%d %d %d", &t, &l, &r); ll ans = 0; for (int i = 2; i <= r; i++) { dp[i] = LLONG_MAX; } for (int i = 2; i <= r; i++) { dp[i] = min( dp[i], 1ll * i * (i - 1) / 2 ); for (int j = 2 * i; j <= r; j += i) { int t = j/i; ll val = 1ll * t * (t - 1) / 2; val = (val * i); dp[j] = min(dp[j], (val + dp[i])); } } ll ti = 1; for (int i = 0; i <= r - l; i++) { ll v1 = ti, v2 = dp[i+l]%mod; ll v3 = v1 * v2; ans = (ans + v3) % mod; ti = (ti*t) % mod; } printf("%I64d\n", ans%mod); return 0; }
查找差异