buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<"... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<"... | [["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 445 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
mt19937 rng(time(NULL));
const int D = 365, N = 26;
int d;
ll c[N + 1];
ll s[D + 1][N + 1];
ll last[N];
int contest[D];
ll calc(int idx, int x) {
ll ans = 0;
ll l = idx - 1, r = idx + 1;
ll len, len2;
while (l > 0 && contest[l] != contest[idx... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
mt19937 rng(time(NULL));
const int D = 365, N = 26;
int d;
ll c[N + 1];
ll s[D + 1][N + 1];
ll last[N];
int contest[D];
ll calc(int idx, int x) {
ll ans = 0;
ll l = idx - 1, r = idx + 1;
ll len, len2;
while (l > 0 && contest[l] != contest[idx... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 31, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 629 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int n;
cin >> n;
ll sum = 0;
for (int i = 1; i <= n; i++) {
sum += (i) * ((n / i) * (n / i + 1) / 2);
}
cout << sum << endl;
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll n;
cin >> n;
ll sum = 0;
for (ll i = 1; i <= n; i++) {
sum += (i) * ((n / i) * (n / i + 1) / 2);
}
cout << sum << endl;
} | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78]] | 1 | 94 |
n=int(input())
su = 0
for i in range(1,int(n**0/5)+1):
m = int(n/i) - i + 1
su += m*(2*i*i + (m-1)*i) - i*i
print(su) | n=int(input())
su = 0
for i in range(1,int(n**0.5)+1):
m = int(n/i) - i + 1
su += m*(2*i*i + (m-1)*i) - i*i
print(su) | [["-", 31, 652, 3, 4, 0, 657, 31, 657, 12, 612], ["-", 0, 657, 31, 652, 3, 4, 0, 657, 17, 85], ["-", 0, 657, 31, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 657, 31, 652, 3, 4, 0, 657, 12, 531]] | 5 | 69 |
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define int ll
main() {
ll n;
cin >> n;
ll ans = 0;
for (int i = 1; i < n; i++) {
ans += (n / i) * ((n / i) + 1) * i / 2;
}
cout << ans << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
#define int ll
main() {
ll n;
cin >> n;
ll ans = 0;
for (ll i = 1; i <= n; i++) {
ans += (n / i) * ((n / i) + 1) * i / 2;
}
cout << ans << endl;
return 0;
}
| [["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 87 |
N = int(input())
ans = 0
for i in range(N):
j = N // i
ans += i * j * (j+1) / 2
print(ans)
| N = int(input())
ans = 0
for i in range(1, N+1):
j = N // i
ans += i * j * (j+1) // 2
print(ans)
| [["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 8, 196, 0, 1, 0, 677, 12, 657, 17, 85], ["+", 8, 196, 0, 1, 0, 677, 12, 657, 17, 676]] | 5 | 41 |
#include <bits/stdc++.h>
#define SIS std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define lowbit(x) (x & -x)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for (int i = (b); i >= (a); i--)
#define REP(i, a, b) for (int i = (a); i <= (b); ++i)
#define PI 3.141592653589793238462... | #include <bits/stdc++.h>
#define SIS std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define lowbit(x) (x & -x)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for (int i = (b); i >= (a); i--)
#define REP(i, a, b) for (int i = (a); i <= (b); ++i)
#define PI 3.141592653589793238462... | [["+", 12, 16, 31, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 16, 31, 74, 39, 77, 39, 78], ["+", 12, 16, 31, 16, 31, 16, 31, 74, 0, 25]] | 1 | 291 |
/*
URL https://
SCORE 0
AC false
WA false
TLE false
MLE false
TASK_TYPE
FAILURE_TYPE
NOTES
*/
#include <algorithm>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <stack>
#inc... | /*
URL https://
SCORE 0
AC false
WA false
TLE false
MLE false
TASK_TYPE
FAILURE_TYPE
NOTES
*/
#include <algorithm>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <stack>
#inc... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 5,687 |
#include <bits/stdc++.h>
using namespace std;
vector<int> next_int_vector(int n) {
vector<int> v(n);
for (int i = 0; i < n; ++i) {
cin >> v.at(i);
}
return v;
}
int main() {
// https://img.atcoder.jp/abc172/editorial.pdf
int n;
cin >> n;
long ans = 0;
for (int i = 1; i <= n; ++i) {
int y =... | #include <bits/stdc++.h>
using namespace std;
vector<int> next_int_vector(int n) {
vector<int> v(n);
for (int i = 0; i < n; ++i) {
cin >> v.at(i);
}
return v;
}
int main() {
// https://img.atcoder.jp/abc172/editorial.pdf
int n;
cin >> n;
long ans = 0;
for (int i = 1; i <= n; ++i) {
long y ... | [["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 11, 12, 16, 31, 16, 12, 74, 0, 24], ["+", 31, 16, 12, 74, 39, 77, 39, 86, 0, 96], ["+", 0, 11, 12, 16, 31, 16, 12, 74, 0, 25]] | 1 | 116 |
#include <math.h>
#include <stdio.h>
int main() {
long i, k, n, ans = 0;
scanf("%ld", &n);
for (i = 1; i <= n; i++) {
k = floor(n / i);
ans += k * (k + 1) * i / 2;
}
printf("%d", ans);
return 0;
}
| #include <math.h>
#include <stdio.h>
int main() {
long i, k, n, ans = 0;
scanf("%ld", &n);
for (i = 1; i <= n; i++) {
k = floor(n / i);
ans += k * (k + 1) * i / 2;
}
printf("%ld", ans);
return 0;
}
| [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 81 |
#include <bits/stdc++.h>
using namespace std;
//#define LOCAL
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'
#define forn(i, a, b) for (ll i = a; i <= b; i++)
#define ft first
#define sd second
#define sz size()
#define pb push_back
#define pob pop_back()
#define pf push_front
#define pof pop_fron... | #include <bits/stdc++.h>
using namespace std;
//#define LOCAL
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'
#define forn(i, a, b) for (ll i = a; i <= b; i++)
#define ft first
#define sd second
#define sz size()
#define pb push_back
#define pob pop_back()
#define pf push_front
#define pof pop_fron... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 9, 0, 43, 39, 78]] | 1 | 192 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll x, ans = 0;
cin >> x;
for (ll i = 1; i <= x; i++) {
ll t = x / i;
ans += t * (t + 1) / 2;
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll x, ans = 0;
cin >> x;
for (ll i = 1; i <= x; i++) {
ll t = x / i;
ans += t * (t + 1) / 2 * i;
}
cout << ans << endl;
} | [["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]] | 1 | 69 |
n = int(input())
def calc_sum(b, e):
cnt = (e - b) // b
return (b + e) * cnt // 2
ans = 0
for i in range(1, n+1):
ans += calc_sum(i, n // i * i)
print(ans) | n = int(input())
def calc_sum(b, e):
cnt = (e - b) // b + 1
return (b + e) * cnt // 2
ans = 0
for i in range(1, n+1):
ans += calc_sum(i, n // i * i)
print(ans) | [["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 66 |
#ifdef BODY == == == == == == == == == == == == == == == == == == == == == == \
== == == == == == == == == == == == == == == == == == == == == == == == == \
== == == == == == == == == == == == == == == == ==
int solve2() {
lin(n);
vector<lint> a;
rep(k, 1, n) {
lint ans = 1;
lint plf = k, pp;
... | #ifdef BODY == == == == == == == == == == == == == == == == == == == == == == \
== == == == == == == == == == == == == == == == == == == == == == == == == \
== == == == == == == == == == == == == == == == ==
int solve2() {
lin(n);
vector<lint> a;
rep(k, 1, n) {
lint ans = 1;
lint plf = k, pp;
... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 6,872 |
N = int(input())
ans = 0
for i in range(1, N+1):
Y = N // j
ans += Y * (Y+1) * j / 2
print(int(ans)) | N = int(input())
ans = 0
for i in range(1, N+1):
Y = N // i
ans += Y * (Y+1) * i / 2
print(int(ans))
| [["-", 8, 196, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 22], ["-", 0, 1, 0, 677, 12, 657, 31, 657, 12, 22], ["+", 0, 1, 0, 677, 12, 657, 31, 657, 12, 22]] | 5 | 48 |
n = int(input())
ans = 0
for x in range(1, n+1):
k = n//x
ans += n*(2*x + (n-1)*x)//2
print(ans) | n = int(input())
ans = 0
for x in range(1, n+1):
k = n//x
ans += k*(2*x + (k-1)*x)//2
print(ans)
| [["-", 0, 1, 0, 677, 12, 657, 31, 657, 31, 22], ["+", 0, 1, 0, 677, 12, 657, 31, 657, 31, 22], ["-", 0, 657, 12, 657, 31, 23, 0, 657, 31, 22], ["+", 0, 657, 12, 657, 31, 23, 0, 657, 31, 22]] | 5 | 51 |
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
long long int sum = 0;
for (int i = 1; i <= n; i++) {
int m = floor((n + 0.0) / i);
sum += m * (m + 1) * i / 2;
}
cout << sum;
}
| #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
long long int sum = 0;
for (int i = 1; i <= n; i++) {
int m = floor((n + 0.0) / i);
sum += (long long int)m * (m + 1) * i / 2;
}
cout << sum;
}
| [["+", 12, 16, 31, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 39, 40], ["+", 12, 16, 31, 16, 31, 16, 31, 74, 0, 25]] | 1 | 76 |
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;
#include <algorithm>
#include <map>
#include <math.h>
#include <queue>
int main() {
int n;
cin >> n;
vector<int> a(n);
rep(i, n) {
int j(i);
while (j... | #include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;
#include <algorithm>
#include <map>
#include <math.h>
#include <queue>
int main() {
int n;
cin >> n;
vector<int> a(n);
rep(i, n) {
int j(i);
while (j... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 16, 12, 2, 63, 22], ["+", 0, 11, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 11, 12, 16, 12, 2, 3, 4, 0, 25]] | 1 | 134 |
#include <algorithm>
#include <climits>
#include <cmath>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long int
#define rep(i, n) fo... | #include <algorithm>
#include <climits>
#include <cmath>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long int
#define rep(i, n) fo... | [["-", 0, 1, 0, 11, 12, 16, 12, 69, 28, 22], ["+", 0, 1, 0, 11, 12, 16, 12, 69, 28, 22]] | 1 | 346 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m;
ll k;
cin >> n >> m >> k;
vector<int> a(n + 1, 0);
vector<int> b(m + 1, 0);
for (int i = 1; i <= n; i++)
cin >> a[i];
for (int i = 1; i <= m; i++)
cin >> b[i];
ve... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m;
ll k;
cin >> n >> m >> k;
vector<int> a(n + 1, 0);
vector<int> b(m + 1, 0);
for (int i = 1; i <= n; i++)
cin >> a[i];
for (int i = 1; i <= m; i++)
cin >> b[i];
ve... | [["-", 8, 1, 0, 11, 12, 16, 12, 69, 28, 22], ["+", 8, 1, 0, 11, 12, 16, 12, 69, 28, 22]] | 1 | 241 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long N;
scanf("%lld", N);
long ans = 0;
for (long j = 1; j <= N; j++) {
long X = N / j;
ans += (X * (X + 1) / 2) * j;
}
printf("%lld", ans);
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long N;
scanf("%ld", &N);
long ans = 0;
for (long j = 1; j <= N; j++) {
long X = N / j;
ans += (X * (X + 1) / 2) * j;
}
printf("%ld\n", ans);
}
| [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 1 | 77 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main() {
int n;
cin >> n;
vector<int> cnt(n + 1);
for (int i = 1; i <= n; i++) {
int j = 1;
while (i * j <= n) {
cnt[i * j]++;
j++;
}
}
ll ans = 0;
for (int i = ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main() {
int n;
cin >> n;
vector<ll> cnt(n + 1);
for (int i = 1; i <= n; i++) {
int j = 1;
while (i * j <= n) {
cnt[i * j]++;
j++;
}
}
ll ans = 0;
for (int i = 1... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]] | 1 | 125 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
// const ll MOD = 998244353;
const ll INF = MOD * MOD;
const long double EPS = 1e-12;
struct mint {
ll x;
mint(ll x = 0) : x((x % MOD + MOD) % MOD) {}
mint operator-() const { return mint(-x); }... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
// const ll MOD = 998244353;
const ll INF = MOD * MOD;
const long double EPS = 1e-12;
struct mint {
ll x;
mint(ll x = 0) : x((x % MOD + MOD) % MOD) {}
mint operator-() const { return mint(-x); }... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 146], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 147]] | 1 | 11,536 |
import sys
read = sys.stdin.read
def main():
n = int(input())
if n == 1:
print(1)
sys.exit()
# nd:num of div
r = 0
for i1 in range(1, n):
y = n // i1
r += y * (y + 1) * i1 / 2
print(int(r))
if __name__ == '__main__':
main() | import sys
read = sys.stdin.read
def main():
n = int(input())
if n == 1:
print(1)
sys.exit()
# nd:num of div
r = 0
for i1 in range(1, n + 1):
y = n // i1
r += y * (y + 1) * i1 / 2
print(int(r))
if __name__ == '__main__':
main() | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 85 |
#include <bits/stdc++.h>
using namespace std;
#define deb(x) cerr << #x << " = " << x << "\n";
#define deb2(x, y) cerr << #x << " = " << x << ", " << #y << " = " << y << "\n";
#define deb3(x, y, z) \
cerr << #x << " = " << x << ", " << #y << " = " << y << ", "... | #include <bits/stdc++.h>
using namespace std;
#define deb(x) cerr << #x << " = " << x << "\n";
#define deb2(x, y) cerr << #x << " = " << x << ", " << #y << " = " << y << "\n";
#define deb3(x, y, z) \
cerr << #x << " = " << x << ", " << #y << " = " << y << ", "... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0... | 1 | 170 |
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pb push_back
#define ll long long
#define ld long double
#define precision(x, d) cout << fixed << setprecision(d) << x
#define fill(a, b) memset((a), (b), sizeof((a... | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pb push_back
#define ll long long
#define ld long double
#define precision(x, d) cout << fixed << setprecision(d) << x
#define fill(a, b) memset((a), (b), sizeof((a... | [["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 258 |
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int i, N;
long long int ans = 0;
cin >> N;
for (i = 1; i <= N; i++) {
int x = N / i;
ans += i * x * (x + 1) / 2;
}
cout << ans << "\n";
return 0;
}
| #include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
long long int i, N;
long long int ans = 0;
cin >> N;
for (i = 1; i <= N; i++) {
long long int x = N / i;
ans += i * x * (x + 1) / 2;
}
cout << ans << "\n";
return 0;
}
| [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 7, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 81 |
#include <algorithm>
#include <bitset>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
const int INF = 0x7fffffff;
us... | #include <algorithm>
#include <bitset>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
const int INF = 0x7fffffff;
us... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 161 |
#include <bits/stdc++.h>
using namespace std;
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, n1, n2) for (ll i = n1; i < n2; i++)
#define bFOR(i, n1, n2) for (ll i = n1; i >= n2; i--)
#define speed_up ... | #include <bits/stdc++.h>
using namespace std;
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, n1, n2) for (ll i = n1; i < n2; i++)
#define bFOR(i, n1, n2) for (ll i = n1; i >= n2; i--)
#define speed_up ... | [["-", 0, 1, 0, 11, 12, 23, 0, 16, 31, 22], ["-", 0, 1, 0, 11, 12, 23, 0, 16, 17, 48]] | 1 | 410 |
N= int(input())
ans = 0
for j in range(N):
N_j = N//j
ans += j*(1+N_j)*N_j//2
print(ans) | N= int(input())
ans = 0
for j in range(1,N+1):
N_j = N//j
ans += j*(1+N_j)*N_j//2
print(ans) | [["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 41 |
import sys
input = sys.stdin.readline
#n = int(input())
#l = list(map(int, input().split()))
'''
a=[]
b=[]
for i in range():
A, B = map(int, input().split())
a.append(A)
b.append(B)'''
n=10000000
ans=0
for i in range(1,n+1):
ans+=i*(n//i)*(1+n//i)//2
print(ans) | import sys
input = sys.stdin.readline
#n = int(input())
#l = list(map(int, input().split()))
'''
a=[]
b=[]
for i in range():
A, B = map(int, input().split())
a.append(A)
b.append(B)'''
n=int(input())
ans=0
for i in range(1,n+1):
ans+=i*(n//i)*(1+n//i)//2
print(ans) | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]] | 5 | 55 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
re... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
re... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22]] | 1 | 363 |
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
struct _ {
ios_base::Init i;
_() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); }
} _;
vector<long long> spf(1e7 + 1, 0);
int main() {
long long n;
cin >> n;
iota(spf.begin(), spf.begin() + n, 0);
for (lo... | #include <iostream>
#include <numeric>
#include <vector>
using namespace std;
struct _ {
ios_base::Init i;
_() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); }
} _;
vector<long long> spf(1e7 + 1, 0);
int main() {
long long n;
cin >> n;
iota(spf.begin(), spf.begin() + n + 1, 0);
for... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 238 |
#include "algorithm"
#include "bitset"
#include "cassert"
#include "climits"
#include "cmath"
#include "cstdio"
#include "ctime"
#include "functional"
#include "iomanip"
#include "iostream"
#include "list"
#include "map"
#include "numeric"
#include "queue"
#include "random"
#include "set"
#include "stack"
#include "str... | #include "algorithm"
#include "bitset"
#include "cassert"
#include "climits"
#include "cmath"
#include "cstdio"
#include "ctime"
#include "functional"
#include "iomanip"
#include "iostream"
#include "list"
#include "map"
#include "numeric"
#include "queue"
#include "random"
#include "set"
#include "stack"
#include "str... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 365 |
import bisect
N, M, K = map(int, input().split())
Alist = [0] + list(map(int, input().split()))
Blist = list(map(int, input().split()))
B = [Blist[0]]
for b in Blist[1:]:
B.append(b + B[-1])
sums = 0
ans = 0
for idx, a in enumerate(Alist):
sums += a
if sums > K:
break
k = K - sums
print(... | import bisect
N, M, K = map(int, input().split())
Alist = [0] + list(map(int, input().split()))
Blist = list(map(int, input().split()))
B = [Blist[0]]
for b in Blist[1:]:
B.append(b + B[-1])
sums = 0
ans = 0
for idx, a in enumerate(Alist):
sums += a
if sums > K:
break
k = K - sums
tmp = ... | [["-", 0, 7, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 145 |
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()
n,m,k = na()
a = na()
b = na()
aa = [0]
bb = [0]
for i in a:
aa.append(aa[-1]+i)
for i in b:
... | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()
n,m,k = na()
a = na()
b = na()
aa = [0]
bb = [0]
for i in a:
aa.append(aa[-1]+i)
for i in b:
... | [["-", 3, 4, 0, 657, 12, 652, 63, 319, 319, 22], ["+", 0, 657, 31, 657, 12, 652, 63, 319, 319, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 191 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
const int maxn = 2e5 + 10;
const int mod = 1e9 + 7;
int n, m, k;
int a[maxn];
int b[maxn];
ll suma[maxn];
ll sumb[maxn];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> m >> k;... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
const int maxn = 2e5 + 10;
const int mod = 1e9 + 7;
int n, m, k;
int a[maxn];
int b[maxn];
ll suma[maxn];
ll sumb[maxn];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> m >> k;... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 285 |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
ll n, m, k;
ll a[212345], b[212345];
int main() {
scanf("%lld%lld%lld", &n, &m, &k);
a[0] = 0;
b[0] = 0;
for (ll i = 1; i <= n; i++) {
scanf("%lld", &a[i]);
a[i] = a[i] + a[i - 1];
}
for (ll i = 1; i... | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
ll n, m, k;
ll a[212345], b[212345];
int main() {
scanf("%lld%lld%lld", &n, &m, &k);
a[0] = 0;
b[0] = 0;
for (ll i = 1; i <= n; i++) {
scanf("%lld", &a[i]);
a[i] = a[i] + a[i - 1];
}
for (ll i = 1; i... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 0 | 244 |
#include <bits/stdc++.h>
using namespace std;
/// Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout << #var << " " << var << endl;
#define co(q) cout << q << endl;
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9 + 7;
const int MAX = 1e5;
#define pi acos(-... | #include <bits/stdc++.h>
using namespace std;
/// Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout << #var << " " << var << endl;
#define co(q) cout << q << endl;
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9 + 7;
const int MAX = 1e5;
#define pi acos(-... | [["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22]] | 1 | 309 |
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define fs first
#define sc second
#define task "tst"
using namespace std;
const ll N = 2e5 + 9;
const ll inf = 1e9 + 7;
typedef pair<ll, ll> LL;
ll n, m, k, a[N], b[N], cur, got, i;
ll pre[N];
ll bs(ll v) {
ll l, mid, h;
l = 1;
h = m;
while ... | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define fs first
#define sc second
#define task "tst"
using namespace std;
const ll N = 2e5 + 9;
const ll inf = 1e9 + 7;
typedef pair<ll, ll> LL;
ll n, m, k, a[N], b[N], cur, got, i;
ll pre[N];
ll bs(ll v) {
ll l, mid, h;
l = 1;
h = m;
while ... | [["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 7, 8, 9, 0, 57, 64, 93, 0, 94], ["+", 0, 7, 8, 9, 0, 57, 64, 116, 0, 117]] | 1 | 333 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2e5 + 7;
int a[N], b[N];
int32_t main() {
int n, m, k;
cin >> n >> m >> k;
for (int i = 1; i <= n; i++) {
cin >> a[i];
a[i] += a[i - 1];
}
for (int i = 1; i <= m; i++) {
cin >> b[i];
b[i] += b[i - 1];
}
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2e5 + 7;
int a[N], b[N];
int32_t main() {
int n, m, k;
cin >> n >> m >> k;
for (int i = 1; i <= n; i++) {
cin >> a[i];
a[i] += a[i - 1];
}
for (int i = 1; i <= m; i++) {
cin >> b[i];
b[i] += b[i - 1];
}
... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 195 |
#include <algorithm>
#include <cassert>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string.h>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
typedef long l... | #include <algorithm>
#include <cassert>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string.h>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
typedef long l... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 17, 72], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 12, 13]] | 1 | 263 |
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
using vi = vector<int>;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n, m, k;
cin >> n >> m >> k;
vi psa(n + 1), psb(m + 1);
for (int i = 1; i <= n; i++) {
int a;
cin >> a;
psa.at(i) = min(k + 1, ... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
using vi = vector<int>;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n, m, k;
cin >> n >> m >> k;
vi psa(n + 1), psb(m + 1);
for (int i = 1; i <= n; i++) {
int a;
cin >> a;
psa.at(i) = min(k + 1, ... | [["+", 0, 52, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 52, 15, 339, 51, 16, 31, 16, 17, 19], ["+", 0, 52, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98]] | 1 | 257 |
#pragma GCC optimize(2, 3, "Ofast", "unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define in inline
namespace fast_io {
char buf[1 << 12], *p1 = buf, *p2 = buf, sr[1 << 23], z[23], nc;
int C = -1, Z = 0, Bi = 0, ny;
in char gc() {
return p1 == p2 && (p2 = (p1 = b... | #pragma GCC optimize(2, 3, "Ofast", "unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define in inline
namespace fast_io {
char buf[1 << 12], *p1 = buf, *p2 = buf, sr[1 << 23], z[23], nc;
int C = -1, Z = 0, Bi = 0, ny;
in char gc() {
return p1 == p2 && (p2 = (p1 = b... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 744 |
## coding: UTF-8
import bisect
N, M, K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
#Cum_A = []
Cum_B = []
yoryoku = []
na = K
for i in range(len(A)):
na -= A[i]
yoryoku.append(na)
#Cum_A.append(na)
nb = 0
for j in range(len(B)):
nb += B[j]
... | ## coding: UTF-8
import bisect
N, M, K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
#Cum_A = []
Cum_B = []
yoryoku = [K]
na = K
for i in range(len(A)):
na -= A[i]
yoryoku.append(na)
#Cum_A.append(na)
nb = 0
for j in range(len(B)):
nb += B[j]
... | [["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 22], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["-", 12, 652, 3, 4, 0, 657, 31, 657, 17, 72], ["-", 12, 652, 3, 4, 0, 657, 31, 657, 12, 612]] | 5 | 172 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int maxn = 200010;
#define ll long long
int n, m;
ll k;
ll sa[maxn], sb[maxn];
int ans;
int main() {
scanf("%d%d%lld", &n, &m, &k);
for (int i = 1; i <= n; ++i) {
scanf("%lld", &sa[i]);
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int maxn = 200010;
#define ll long long
int n, m;
ll k;
ll sa[maxn], sb[maxn];
int ans;
int main() {
scanf("%d%d%lld", &n, &m, &k);
for (int i = 1; i <= n; ++i) {
scanf("%lld", &sa[i]);
... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 225 |
#include <bits/stdc++.h>
using namespace std;
#define f(i, a, b) for (register int i = a; i <= b; ++i)
#define ll long long
#define N 200005
inline ll read() {
ll s = 0, w = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-')
w = -1;
ch = getchar();
}
while (ch <= '9' && ch >= ... | #include <bits/stdc++.h>
using namespace std;
#define f(i, a, b) for (register int i = a; i <= b; ++i)
#define ll long long
#define N 200005
inline ll read() {
ll s = 0, w = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-')
w = -1;
ch = getchar();
}
while (ch <= '9' && ch >= ... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 294 |
#include <bits/stdc++.h>
using namespace std;
#define N 200005
#define ll long long
ll n, m, k, a[N], b[N], sa[N], sb[N];
int main() {
cin >> n >> m >> k;
for (int i = 1; i <= n; i++)
cin >> a[i];
for (int i = 1; i <= m; i++)
cin >> b[i];
for (int i = 1; i <= n; i++)
sa[i] = sa[i - 1] + a[i];
fo... | #include <bits/stdc++.h>
using namespace std;
#define N 200005
#define ll long long
ll n, m, k, a[N], b[N], sa[N], sb[N];
int main() {
cin >> n >> m >> k;
for (int i = 1; i <= n; i++)
cin >> a[i];
for (int i = 1; i <= m; i++)
cin >> b[i];
for (int i = 1; i <= n; i++)
sa[i] = sa[i - 1] + a[i];
fo... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 238 |
from bisect import*
from itertools import*
N, M, K = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a = list(accumulate(a))
b = list(accumulate(b))
ans = 0
for i in range(N):
rest = K - a[i]
if rest < 0:
continue
else:
pre = bisect(b, rest)... | from bisect import*
from itertools import*
N, M, K = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a = list(accumulate(a))
b = list(accumulate(b))
ans = bisect(b, K)
for i in range(N):
rest = K - a[i]
if rest < 0:
continue
else:
pre = bise... | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]] | 5 | 129 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, int> P;
struct edge {
int to;
ll cost;
};
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, 1, -1};
int main() {
int n, m;
ll k;
cin >> n >> m >> k;
vector<ll> a(n + 1, 0), b(m + 1, 0);
for (int i = 1; i <= n; i++) {
ci... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, int> P;
struct edge {
int to;
ll cost;
};
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, 1, -1};
int main() {
int n, m;
ll k;
cin >> n >> m >> k;
vector<ll> a(n + 1, 0), b(m + 1, 0);
for (int i = 1; i <= n; i++) {
ci... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 262 |
# n + 1 長の array を返す
def cumulative_sum(array)
tmp = [0]
previous = 0
array.each { |num| tmp << previous += num }
tmp
end
n, m, k = gets.split.map(&:to_i)
books_1 = gets.split.map(&:to_i)
cumulative_books_1 = cumulative_sum(books_1)
books_2 = gets.split.map(&:to_i)
cumulative_books_2 = cumulative_sum(books_2)
... | # n + 1 長の array を返す
def cumulative_sum(array)
tmp = [0]
previous = 0
array.each { |num| tmp << previous += num }
tmp
end
n, m, k = gets.split.map(&:to_i)
books_1 = gets.split.map(&:to_i)
cumulative_books_1 = cumulative_sum(books_1)
books_2 = gets.split.map(&:to_i)
cumulative_books_2 = cumulative_sum(books_2)
... | [["-", 0, 493, 0, 652, 486, 739, 0, 475, 756, 612], ["+", 0, 493, 0, 652, 486, 739, 0, 475, 756, 612]] | 4 | 144 |
#include <bits/stdc++.h>
#define REP(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for (int(i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
template <t... | #include <bits/stdc++.h>
#define REP(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for (int(i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
template <t... | [["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 12, 22]] | 1 | 313 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i, a, n) for (int i = a; i < n; i++)
#define rf(i, n, a) for (int i = n; i >= a; i--)
#define F first
#define S second
#define all(c) (c).begin(), (c).end()
#define sz(v) (int)(v... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i, a, n) for (int i = a; i < n; i++)
#define rf(i, n, a) for (int i = n; i >= a; i--)
#define F first
#define S second
#define all(c) (c).begin(), (c).end()
#define sz(v) (int)(v... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]] | 1 | 326 |
#include <bits/stdc++.h>
using namespace std;
int n, m;
long long k;
long long ans;
int main() {
cin >> n;
for (int i = 1; i <= n; ++i) {
long long pom = n / i;
ans += pom * (pom + 1) / 2;
}
cout << ans;
}
| #include <bits/stdc++.h>
using namespace std;
int n, m;
long long k;
long long ans;
int main() {
cin >> n;
for (int i = 1; i <= n; ++i) {
long long pom = n / i;
ans += pom * (pom + 1) / 2 * i;
}
cout << ans;
}
| [["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]] | 1 | 69 |
#include <iostream>
using namespace std;
long long ans;
int main() {
long long n;
cin >> n;
for (long long i = 1LL; i <= n; ++i) {
ans += ((n / i + 1LL) * (n / i)) / 2LL;
}
cout << ans << endl;
return 0;
} | #include <iostream>
using namespace std;
long long ans;
int main() {
long long n;
cin >> n;
for (long long i = 1LL; i <= n; ++i) {
ans += i * ((n / i + 1LL) * (n / i)) / 2LL;
}
cout << ans << endl;
return 0;
} | [["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48]] | 1 | 70 |
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e7 + 1;
int n;
long long d[maxn];
void sieve() {
for (int i = 1; i < maxn; ++i) {
for (int j = i; j < maxn; j += i) {
d[j]++;
}
}
}
void p() {
int n;
cin >> n;
long long ans = 0;
for (int i = 1; i <= n; ++i) {
for (int j =... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e7 + 1;
int n;
long long d[maxn];
void sieve() {
for (int i = 1; i < maxn; ++i) {
for (int j = i; j < maxn; j += i) {
d[j]++;
}
}
}
void p() {
int n;
cin >> n;
long long ans = 0;
for (int i = 1; i <= n; ++i) {
for (int j =... | [["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 259 |
#include <iostream>
using namespace std;
int f[10000009];
int main() {
for (int i = 1; i <= 1000008; i++) {
for (int j = i; j <= 1000008; j = j + i) {
f[j]++;
}
}
int a;
cin >> a;
long long ans = 0;
for (int i = 1; i <= a; i++) {
ans = ans + i * f[i];
}
cout << ans << endl;
} | #include <iostream>
using namespace std;
int f[10000009];
int main() {
for (int i = 1; i <= 10000007; i++) {
for (int j = i; j <= 10000007; j = j + i) {
f[j]++;
}
}
int a;
cin >> a;
long long ans = 0;
for (int i = 1; i <= a; i++) {
ans = ans + i * f[i];
}
cout << ans << endl;
} | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 105 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); ++i)
int main() {
int n;
cin >> n;
ll sum = 0;
int n1;
for (int i = 1; i <= n; ++i) {
n1 = n / i;
sum ... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); ++i)
int main() {
int n;
cin >> n;
ll sum = 0;
int n1;
for (ll i = 1; i <= n; ++i) {
n1 = n / i;
sum +... | [["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78]] | 1 | 93 |
#include <iostream>
#include <vector>
void stupid() {
unsigned int N;
std::vector<unsigned int> numDivisor;
unsigned long long sum;
std::cin >> N;
numDivisor = std::vector<unsigned int>(N, 1);
for (int i = 1; i < N; ++i) {
for (int j = i; j < N; ++j) {
if ((j + 1) % (i + 1) == 0) {
numDivi... | #include <iostream>
#include <vector>
void stupid() {
unsigned int N;
std::vector<unsigned int> numDivisor;
unsigned long long sum;
std::cin >> N;
numDivisor = std::vector<unsigned int>(N, 1);
for (int i = 1; i < N; ++i) {
for (int j = i; j < N; ++j) {
if ((j + 1) % (i + 1) == 0) {
numDivi... | [["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 43, 39, 86, 0, 87], ["+", 0, 7, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 511 |
#include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
int main() {
int n;
cin >> n;
long long int an = 0;
rep1(i, n + 1) { an += i * (n / i) * (... | #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
int main() {
long long int n;
cin >> n;
long long int an = 0;
rep1(i, n + 1) { an += i * (... | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 87 |
#include <bits/stdc++.h>
#define two(a) (1 << (a))
#define LINF (1ll << 61)
#define EPS (1e-14)
#define Lshift(a, b) ((a) << (b))
#define Rshift(a, b) ((a) >> (b))
#define rep(a, b) for (a = 0; a < b; a++)
#define xrep(a, b, c) for (a = b; a < c; a++)
#define INF (1 << 29)
#define sz(a) int(a.size())
#define mset(x) me... | #include <bits/stdc++.h>
#define two(a) (1 << (a))
#define LINF (1ll << 61)
#define EPS (1e-14)
#define Lshift(a, b) ((a) << (b))
#define Rshift(a, b) ((a) >> (b))
#define rep(a, b) for (a = 0; a < b; a++)
#define xrep(a, b, c) for (a = b; a < c; a++)
#define INF (1 << 29)
#define sz(a) int(a.size())
#define mset(x) me... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 189 |
#D
n = int(input())
#約数の数を求める>>倍数であり、n以下であるものの総和を求める
ans = 0
for i in range(1, n + 1):
#iの倍数の数を求める
m = n // i
#初項i:公差i:m項までの等比数列の和
ans += n * (2 * i + i * (n - 1)) *0.5
print(int(ans)) | #D
n = int(input())
#約数の数を求める>>倍数であり、n以下であるものの総和を求める
ans = 0
for i in range(1, n + 1):
#iの倍数の数を求める
m = n // i
#初項i:公差i:m項までの等比数列の和
ans += m * (2 * i + i * (m - 1)) *0.5
print(int(ans)) | [["-", 0, 1, 0, 677, 12, 657, 31, 657, 31, 22], ["+", 0, 1, 0, 677, 12, 657, 31, 657, 31, 22], ["-", 0, 657, 12, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 657, 12, 657, 12, 23, 0, 657, 31, 22]] | 5 | 58 |
n=int(input())
ans=0
for i in range(1,n+1):
j=n//i
ans+=j*j*(j+1)//2
print(ans)
| n=int(input())
ans=0
for i in range(1,n+1):
j=n//i
ans+=i*j*(j+1)//2
print(ans) | [["-", 0, 677, 12, 657, 31, 657, 31, 657, 31, 22], ["+", 0, 677, 12, 657, 31, 657, 31, 657, 31, 22]] | 5 | 45 |
N = int(input())
a=0
for i in range(1,n+1):
x,y=i,(n//i)*i
a+=((n//i)*(x+y)//2)
print(a) | n=int(input())
ans=0
for i in range(1,n+1):
x,y=i,(n//i)*i
ans+=((n//i)*(x+y)//2)
print(ans) | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 0, 7, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 31, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 57 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int n = 0, ans = 0;
cin >> n;
for (int i = 1; i <= n; ++i)
ans += (n / i) * (n / i + 1) * i / 2;
cout << ans << '\n';
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n = 0;
long long ans = 0;
cin >> n;
for (int i = 1; i <= n; ++i)
ans += 1ll * (n / i) * (n / i + 1) * i / 2;
cout << ans << '\n';
return 0;
} | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 12, 16, 31, 16, 31, 16, 31, 16, 31, 13], ["+", 12, 16, 31, 16, 31, 16, 31, 16, 17, 48]] | 1 | 71 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 1; i < (int)(n); i++)
using namespace std;
int main() {
int64_t n, c = 0;
cin >> n;
rep(i, n) {
int64_t y = n / i;
c += (y * (y + 1) * i) / 2;
}
cout << c << endl;
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 1; i < (int)(n); i++)
using namespace std;
int main() {
int64_t n, c = 0;
cin >> n;
rep(i, n + 1) {
int64_t y = n / i;
c += (y * (y + 1) * i) / 2;
}
cout << c << endl;
}
| [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]] | 1 | 68 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define vi vector<int>
#define all(x) (x).begin(), (x).end()
#define INF (1 << 30) - 1
using ll = long long;
using namespace std;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <c... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define vi vector<int>
#define all(x) (x).begin(), (x).end()
#define INF (1 << 30) - 1
using ll = long long;
using namespace std;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <c... | [["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 0, 7, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 7, 10, 43, 39, 78]] | 1 | 191 |
#include <bits/stdc++.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll n;
int ans = 0;
cin >> n;
vector<int> a(n);
rep(i, n) {
for (int j = i; j <= n; j += i + 1)
a[j] += 1;
... | #include <bits/stdc++.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll n;
ll ans = 0;
cin >> n;
vector<ll> a(n);
rep(i, n) {
for (int j = i; j <= n; j += i + 1)
a[j] += 1;
}
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]] | 1 | 118 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long ans = 0;
for (int i = 1; i <= n; i++) {
int t = n / i;
long l = i * t * (t + 1) / 2;
ans += l;
}
System.out.println(ans);
}
} | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long ans = 0;
for (int i = 1; i <= n; i++) {
long t = n / i;
long l = i * t * (t + 1) / 2;
ans += l;
}
System.out.println(ans);
}
}
| [["-", 0, 7, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 7, 8, 196, 0, 503, 39, 506, 0, 96]] | 3 | 100 |
N=int(input())
print( sum(j*(N//j)*(N//j+1)//2 for j in range(1,N)) ) | N=int(input())
print(sum(j*(N//j)*(N//j+1)//2 for j in range(1,N+1))) | [["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 40 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, sum = 0, j;
cin >> n;
vector<int> a(n + 1, 0);
for (i = 1; i <= n; i++) {
for (j = 0; j <= n; j += i) {
a[j]++;
}
}
for (i = 1; i <= n; i++) {
sum += a[i] * i;
}
cout << sum;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n, i, sum = 0, j;
cin >> n;
vector<long long int> a(n + 1, 0);
for (i = 1; i <= n; i++) {
for (j = 0; j <= n; j += i) {
a[j]++;
}
}
for (i = 1; i <= n; i++) {
sum += a[i] * i;
}
cout << sum;
}
| [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 39, 344, 3, 347, 0, 77, 39, 86, 0, 96]] | 1 | 105 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int N;
cin >> N;
ll ans = 0;
for (int i = 1; i <= N; i++) {
int c = N / i;
ans += c * (c + 1) / 2 * i;
}
cout << ans;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int N;
cin >> N;
ll ans = 0;
for (int i = 1; i <= N; i++) {
ll c = N / i;
ans += c * (c + 1) / 2 * i;
}
cout << ans;
return 0;
} | [["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 78]] | 1 | 71 |
#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define IOS \
ios::sync_with_stdio(0); ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define x first
#define y second
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define IOS \
ios::sync_with_stdio(0); ... | [["+", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148]] | 1 | 169 |
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#incl... | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#incl... | [["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40]] | 1 | 230 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const ll mod = 1e9 + 7;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
ll f(ll n) { return n * (n + 1) / 2; }
int main() {
int n;
cin >> n;
ll... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const ll mod = 1e9 + 7;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
ll f(ll n) { return n * (n + 1) / 2; }
int main() {
int n;
cin >> n;
ll... | [["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107]] | 1 | 147 |
def main():
N = int(input())
tot = 0
for d in range(1, N+1):
nd = N//d
tot += (d * (nd + 1) * nd) // 2
print(tot)
| N = int(input())
tot = 0
for d in range(1, N+1):
nd = N//d
tot += (d * (nd + 1) * nd) // 2
print(tot)
| [["-", 36, 36, 36, 36, 0, 656, 0, 14, 0, 669], ["-", 36, 36, 36, 36, 0, 656, 0, 14, 141, 22], ["-", 36, 36, 0, 656, 0, 14, 54, 54, 0, 24], ["-", 36, 36, 0, 656, 0, 14, 54, 54, 0, 25], ["-", 36, 36, 36, 36, 0, 656, 0, 14, 0, 102]] | 5 | 52 |
#include <iostream>
using namespace std;
int main(void) {
long long N;
cin >> N;
long long ans = 0;
for (int X = 0; X < N; X++) {
long long Y = N / X;
long long G = Y * (Y + 1) * X / 2;
ans += G;
}
cout << ans << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main(void) {
long long N;
cin >> N;
long long ans = 0;
for (int X = 1; X <= N; X++) {
long long Y = N / X;
long long G = Y * (Y + 1) * X / 2;
ans += G;
}
cout << ans << endl;
return 0;
}
| [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 80 |
#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define vi vector<int>
#define vl vector<ll>
#define vvi vector<vector<int>... | #include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define vi vector<int>
#define vl vector<ll>
#define vvi vector<vector<int>... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 9, 0, 7, 10, 43, 49, 50, 51, 22]] | 1 | 183 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(0)... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(0)... | [["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40]] | 1 | 139 |
#include <bits/stdc++.h>
#define rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define SZ(x) ((int)(x).size())
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
struct Vector {
double x, y;
};
template <class T> inline bool chmin(T &a, T b) {... | #include <bits/stdc++.h>
#define rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define SZ(x) ((int)(x).size())
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
struct Vector {
double x, y;
};
template <class T> inline bool chmin(T &a, T b) {... | [["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 78], ["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78]] | 1 | 298 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
long long res = 0;
for (int i = 1; i <= n; i++) {
res += (n / i) * ((n / i) + 1) * i / 2;
}
cout << res << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
long long res = 0;
for (int i = 1; i <= n; i++) {
res += (long long)(n / i) * ((n / i) + 1) * i / 2;
}
cout << res << endl;
return 0;
} | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 12, 16, 31, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 12, 16, 31, 16, 31, 16, 31, 74, 0, 25]] | 1 | 72 |
N=int(input())
N=10**7
#N=100
ans=0
for i in range(1,N+1):
ans+=i*((1+(N//i))*(N//i)//2)
#print(ans)
pass
print(ans) | N=int(input())
#N=10**7
#N=100
ans=0
for i in range(1,N+1):
ans+=i*((1+(N//i))*(N//i)//2)
#print(ans)
pass
print(ans) | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 31, 612], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 578], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 58 |
n = int(input())
cnts = [k*(n//k)*((n//k)+1)//2 for k in range(1,n//2)]
print(sum(cnts)+ ((n//2)+n)*(n-(n//2)+1)//2) | n = int(input())
cnts = [k*(n//k)*((n//k)+1)//2 for k in range(1,n//2+1)]
print(sum(cnts)+ ((n//2+1)+n)*(n-(n//2+1)+1)//2) | [["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 31, 23, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 31, 23, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 12, 612]] | 5 | 73 |
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
ull B = 100000007;
int mod = 1000000007;
class Solution {
public:
ll d(int n) {
ll res = 0;
res += n * (n + 1) / 2;
for (int i = 2; i <= n; ++i) {
int t = n / i;
// cout << t * (i + i + (t - 1)... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
ull B = 100000007;
int mod = 1000000007;
class Solution {
public:
ll d(ll n) {
ll res = 0;
res += n * (n + 1) / 2;
for (ll i = 2; i <= n; ++i) {
ll t = n / i;
// cout << t * (i + i + (t - 1) * ... | [["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 78]] | 1 | 138 |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e7 + 10;
int D[N], n, ans;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
for (int i = 1; i <= 1e7; ++i) {
for (int j = i; j <= 1e7; j += i) {
++D[j];
}
}
cin >> n;
for (int i = 1; i <= n; ++i)
ans += D[i] * i;
... | #include <bits/stdc++.h>
using namespace std;
const int N = 1e7 + 10;
long long D[N], n, ans;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
for (int i = 1; i <= 1e7; ++i) {
for (int j = i; j <= 1e7; j += i) {
++D[j];
}
}
cin >> n;
for (int i = 1; i <= n; ++i)
ans += D[i]... | [["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96]] | 1 | 125 |
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int N;
cin >> N;
ll ans = 0;
vector<ll> g(N + 1);
for (int i = 1; i <= N; i++) {
int Y = N / i;
g[i] = (Y * (Y + 1) * i) / 2;
ans += g[i];
}
cout << ans << endl;
} | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll N;
cin >> N;
ll ans = 0;
vector<ll> g(N + 1);
for (int i = 1; i <= N; i++) {
ll Y = N / i;
g[i] = (Y * (Y + 1) * i) / 2;
ans += g[i];
}
cout << ans << endl;
} | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 78]] | 1 | 98 |
#include <bits/stdc++.h>
using namespace std;
// (setq-default c-basic-offset 2)
int main() {
int n;
cin >> n;
long long ret = 0;
for (int i = 1; i <= n; ++i) {
int j = n / i;
long long s = i * j * (j + 1) / 2;
ret += s;
}
cout << ret << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
// (setq-default c-basic-offset 2)
int main() {
long long n;
cin >> n;
long long ret = 0;
for (long long i = 1; i <= n; ++i) {
long long j = n / i;
long long s = i * j * (j + 1) / 2;
ret += s;
}
cout << ret << endl;
return 0;
}
| [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 78 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main(void) {
long long n;
cin >> n;
long long ans = 0;
for (int i = 1; i <= n; i++) {
int tmpN = n / i;
ans += (tmpN + 1) * tmpN / 2 * i;
}
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main(void) {
long long n;
cin >> n;
long long ans = 0;
for (long long i = 1; i <= n; i++) {
long long tmpN = n / i;
ans += (tmpN + 1) * tmpN / 2 * i;
}
cout << ans << endl;
return 0;
} | [["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 79 |
#include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
typedef long long ll;
constexpr long long INFLL = 1e18;
using namespace std;
int main() {
int n;
cin >> n;
ll ans = 0;
int max_i;
for (... | #include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
typedef long long ll;
constexpr long long INFLL = 1e18;
using namespace std;
int main() {
ll n;
cin >> n;
ll ans = 0;
ll max_i;
for (in... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 102 |
#include <algorithm>
#include <iostream>
int main() {
int N;
std::cin >> N;
int ans = 0;
for (int i = 1; i <= N; ++i) {
int j = N / i;
ans += i * j * (j + 1) / 2;
}
std::cout << ans;
} | #include <algorithm>
#include <iostream>
int main() {
int N;
std::cin >> N;
long long ans = 0;
for (int i = 1; i <= N; ++i) {
long long j = N / i;
ans += i * j * (j + 1) / 2;
}
std::cout << ans;
} | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 67 |
n = int(input())
ans = 0
for i in range(n):
nu = n // i
ans += nu * (nu+1) * i // 2
print(ans)
| n = int(input())
ans = 0
for i in range(1,n+1):
nu = n // i
ans += nu * (nu+1) * i // 2
print(ans)
| [["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 41 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll sum(int N) { return N * (N + 1) / 2; }
int main() {
int N;
cin >> N;
ll g = N * (N + 1) / 2;
ll ans = 0;
for (int i = 1; i <= N; i++) {
ans += i * sum(N / i);
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll sum(ll N) { return N * (N + 1) / 2; }
int main() {
int N;
cin >> N;
ll g = N * (N + 1) / 2;
ll ans = 0;
for (ll i = 1; i <= N; i++) {
ans += i * sum(ll(N / i));
}
cout << ans << endl;
} | [["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["+", 12, 16, 12, 2, 3, 4, 0, 2, 63, 22], ["+", 12, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 2, 3, 4, 0, 25]] | 1 | 95 |
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n); i >= 0; i--)
#define repf(i, ... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n); i >= 0; i--)
#define repf(i, ... | [["+", 12, 16, 31, 16, 31, 2, 63, 23, 0, 22], ["+", 12, 16, 31, 16, 31, 2, 63, 23, 0, 25], ["+", 12, 16, 31, 16, 31, 2, 3, 4, 0, 24]] | 1 | 215 |
n=int(input())
ans=0
for i in range(1,n+1):
x=math.floor(n/i)
ans+=(x*(x+1)*i)/2
print(int(ans)) | import math
n=int(input())
ans=0
for i in range(1,n+1):
x=math.floor(n/i)
ans+=(x*(x+1)*i)/2
print(int(ans)) | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]] | 5 | 55 |
#include <bits/stdc++.h>
using namespace std;
#if USE_CP_REDIR
#define CP \
freopen("input.txt", "r", stdin); \
freopen("output.txt", "w", stdout);
#endif
int main() {
#ifdef CP
CP;
#endif
int N;
c... | #include <bits/stdc++.h>
using namespace std;
#if USE_CP_REDIR
#define CP \
freopen("input.txt", "r", stdin); \
freopen("output.txt", "w", stdout);
#endif
int main() {
#ifdef CP
CP;
#endif
int N;
c... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 82 |
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Comparator;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
public class Main implements Runnable { // クラス名はMain1
PrintWriter out = new PrintWriter(System.out);
InputReader sc = ... |
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Comparator;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
public class Main implements Runnable { // クラス名はMain1
PrintWriter out = new PrintWriter(System.out);
InputReader sc = ... | [["-", 8, 196, 0, 503, 39, 224, 468, 506, 0, 507], ["+", 8, 196, 0, 503, 39, 224, 468, 506, 0, 96], ["-", 0, 503, 49, 200, 51, 227, 39, 506, 0, 507], ["+", 0, 503, 49, 200, 51, 227, 39, 506, 0, 96], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 24], ["+", 0, 11, 12, 16, 31, 74, 39, 506, 0, 96], ["+", 0, 1, 0, 11, 12, 16, 31, 7... | 3 | 1,542 |
#include <bits/stdc++.h>
typedef long long LL;
typedef unsigned long long LONG;
const int N = 1e5 + 5;
const int INF = 0x3f3f3f3f;
const int MAXINT = 2147483647;
const int mod = 1000000007;
const long long MAXLONG = 9223372036854775807;
const LL INT32 = (LL(MAXINT) + 1) * 2;
using namespace std;
typedef pair<int, int>... | #include <bits/stdc++.h>
typedef long long LL;
typedef unsigned long long LONG;
const int N = 1e5 + 5;
const int INF = 0x3f3f3f3f;
const int MAXINT = 2147483647;
const int mod = 1000000007;
const long long MAXLONG = 9223372036854775807;
const LL INT32 = (LL(MAXINT) + 1) * 2;
using namespace std;
typedef pair<int, int>... | [["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 78]] | 1 | 182 |
n = int(input())
ans = 0
for i in arnge(1, n + 1):
for j in range(1, n + 1, i):
ans += j
print(ans)
| n = int(input())
ans = 0
for i in range(1, n + 1):
for j in range(i, n + 1, i):
ans += j
print(ans)
| [["-", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22], ["+", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22]] | 5 | 44 |
N = int(input())
l = list(range(1, N+1))
def calc(i):
return (i + N//i * i) * i // 2
ans = 0
for i in range(1, N+1):
ans += calc(i)
print(ans) | N = int(input())
l = list(range(1, N+1))
def calc(i):
return (i + N//i * i) * (N//i) // 2
ans = 0
for i in range(1, N+1):
ans += calc(i)
print(ans) | [["+", 0, 37, 0, 657, 31, 657, 12, 23, 0, 24], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 17, 676], ["+", 0, 37, 0, 657, 31, 657, 12, 23, 0, 25]] | 5 | 66 |
import java.io.*;
import java.util.*;
public class Main {
static class Scan {
private byte[] buf = new byte[1024];
private int index;
private InputStream in;
private int total;
public Scan() { in = System.in; }
public int scan() throws IOException {
if (total < 0)
throw new Input... | import java.io.*;
import java.util.*;
public class Main {
static class Scan {
private byte[] buf = new byte[1024];
private int index;
private InputStream in;
private int total;
public Scan() { in = System.in; }
public int scan() throws IOException {
if (total < 0)
throw new Input... | [["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 0, 503, 49, 200, 51, 227, 39, 506, 0, 507], ["+", 0, 503, 49, 200, 51, 227, 39, 506, 0, 96]] | 3 | 642 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.