Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Untitled diff
Created
9 years ago
Diff never expires
Clear
Export
Share
Explain
15 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
49 lines
Copy
12 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
49 lines
Copy
#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];
Copy
Copied
Copy
Copied
ll
t, l, r;
int
t, l, r;
int main() {
int main() {
Copy
Copied
Copy
Copied
scanf("%
I64d%I64d%I64d
", &t, &l, &r);
scanf("%
d %d %d
", &t, &l, &r);
ll ans = 0;
ll ans = 0;
Copy
Copied
Copy
Copied
for (
ll
i = 2; i <= r; i++) {
for (
int
i = 2; i <= r; i++) {
dp[i] = LLONG_MAX;
dp[i] = LLONG_MAX;
}
}
Copy
Copied
Copy
Copied
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
);
Copy
Copied
Copy
Copied
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;
Copy
Copied
Copy
Copied
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;
}
}
Saved diffs
Original text
Open file
#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; }
Changed text
Open file
#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; }
Find difference