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
n=int(input()) ans=0 for i in range(n): if i%5==0: continue if i%3==0: continue ans+=i print(ans)
n=int(input()) ans=0 for i in range(1+n): if i%5==0: continue if i%3==0: continue ans+=i print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72]]
5
42
#include <bits/stdc++.h> using namespace std; int main() { long long m, l = 0; cin >> m; for (long long i = 0; i < m; i++) { if (i % 5 != 0 && i % 3 != 0) l += i; } cout << l << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long m, l = 0; cin >> m; for (long long i = 1; i <= m; i++) { if (i % 5 != 0 && i % 3 != 0) l += i; } cout << l << 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
68
#include <bits/stdc++.h> // macros #define M 1000000007 #define addmod(a, b, m) (a % m + b % m) % m #define submod(a, b, m) (a % m - b % m) % m #define mulmod(a, b, m) ((a % m) * (b % m)) % m #define F first #define S second #define APSUM(a, b, n) n *((a * .5) + (b * .5)) #define GPSUM(a, b, k) (b * k - a) / (k - 1) #...
#include <bits/stdc++.h> // macros #define M 1000000007 #define addmod(a, b, m) (a % m + b % m) % m #define submod(a, b, m) (a % m - b % m) % m #define mulmod(a, b, m) ((a % m) * (b % m)) % m #define F first #define S second #define APSUM(a, b, n) n *((a * .5) + (b * .5)) #define GPSUM(a, b, k) (b * k - a) / (k - 1) #...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
335
n = int(input()) fizzbuzz = [i for i in range(n+1) if i%5!=0 and i%3!=0] print(sum(fizzbuss))
n = int(input()) fizzbuzz = [i for i in range(n+1) if i%5!=0 and i%3!=0] print(sum(fizzbuzz))
[["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22]]
5
41
N = int(input()) def FB(n): if n%3 != 0 and n%5 !=0: return n else: return False ans = 0 for i in range(N): ans += FB(i) print(ans)
N = int(input()) def FB(n): if n%3 != 0 and n%5 !=0: return n else: return False ans = 0 for i in range(N+1): ans += FB(i) print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
54
#include <stdio.h> int main(void) { int n, i; long long int sum = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (n % 3 != 0 && n % 5 != 0) { sum += i; } } printf("%lld", sum); return 0; }
#include <stdio.h> int main(void) { int n, i; long long int sum = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%lld", sum); return 0; }
[["-", 15, 23, 0, 16, 31, 16, 31, 16, 31, 22], ["+", 15, 23, 0, 16, 31, 16, 31, 16, 31, 22], ["-", 15, 23, 0, 16, 12, 16, 31, 16, 31, 22], ["+", 15, 23, 0, 16, 12, 16, 31, 16, 31, 22]]
0
78
#include <bits/stdc++.h> #define rep(i, start, end) for (long long i = start; i < end; ++i) #define srt(x) sort((x).begin(), (x).end()); #define rsrt(x) sort((x).rbegin(), (x).rend()); #define deb(x) cout << #x << " = " << (x) << " (L" << LINE << ")" << endl; #define vdeb(x) ...
#include <bits/stdc++.h> #define rep(i, start, end) for (long long i = start; i < end; ++i) #define srt(x) sort((x).begin(), (x).end()); #define rsrt(x) sort((x).rbegin(), (x).rend()); #define deb(x) cout << #x << " = " << (x) << " (L" << LINE << ")" << endl; #define vdeb(x) ...
[["+", 0, 37, 0, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 14, 8, 9, 0, 37, 0, 23, 0, 25], ["-", 0, 9, 0, 57, 15, 339, 51, 91, 17, 111]]
1
164
#include <algorithm> #include <iostream> #include <vector> #define int long long using namespace std; signed main() { int n, sum = 0; cin >> n; // nums.resize(n); for (int i = 1; i <= n - 1; i++) { if (i % 3 != 0 && i % 5 != 0) sum += i; } cout << sum << endl; return 0; }
#include <algorithm> #include <iostream> #include <vector> #define int long long using namespace std; signed main() { int n, sum = 0; cin >> n; // nums.resize(n); for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) sum += i; } cout << sum << endl; return 0; }
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
76
#include <stdio.h> int main() { int a; scanf("%d", &a); int i; i = 1; long sum = 0; while (i <= a) { if (!(i % 3 == 0 || i % 5 == 0)) sum += i; i++; } printf("%d", sum); }
#include <stdio.h> int main() { int a; scanf("%d", &a); int i; i = 1; long sum = 0; while (i <= a) { if (!(i % 3 == 0 || i % 5 == 0)) sum += i; i++; } printf("%ld", sum); }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
74
n = input() i = 1 result = 0 while (i <= n): if (i % 3 != 0 and i % 5 != 0): result += i i += 1 print(result)
n = int(input()) i = 1 result = 0 while (i <= n): if (i % 3 != 0 and i % 5 != 0): result += i i += 1 print(result)
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
43
<?php $inp = intval( trim( fgets( STDIN ) ) ); $i = 0; $sum = 0; while($inp > $i) { if ($i % 5 === 0 && $i % 3 === 0) { } elseif ($i % 5 === 0) { } elseif ($i % 3 === 0) { } else { $sum += $i; } $i++; } echo $sum; ?>
<?php $inp = intval( trim( fgets( STDIN ) ) ); $i = 0; $sum = 0; while($inp >= $i) { if ($i % 5 === 0 && $i % 3 === 0) { } elseif ($i % 5 === 0) { } elseif ($i % 3 === 0) { } else { $sum += $i; } $i++; } echo $sum; ?>
[["-", 0, 493, 0, 52, 15, 23, 0, 16, 17, 47], ["+", 0, 493, 0, 52, 15, 23, 0, 16, 17, 20]]
6
93
#include <bits/stdc++.h> using namespace std; int main() { int input_num; cin >> input_num; int64_t sum = 0; int i; for (i = 0; i < input_num; i++) { if ((i % 3 == 0) && (i % 5 == 0)) { continue; } else if (i % 3 == 0) { continue; } else if (i % 5 == 0) { continue; } els...
#include <bits/stdc++.h> using namespace std; int main() { int input_num; cin >> input_num; int64_t sum = 0; int i; for (i = 1; i <= input_num; i++) { if ((i % 3 == 0) && (i % 5 == 0)) { continue; } else if (i % 3 == 0) { continue; } else if (i % 5 == 0) { continue; } el...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
106
#include <iostream> using namespace std; int main() { int n, ans = 0, sum = 0; cin >> n; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum; }
#include <iostream> using namespace std; int main() { int n, ans = 0; long long sum = 0; cin >> n; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum; }
[["-", 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]]
1
67
N = int(input()) ans = 0 for i in range(N): if (i % 15 == 0) or (i % 3 == 0) or (i % 5 == 0): continue else: ans += i print(ans)
N = int(input()) ans = 0 for i in range(1, N + 1): if (i % 15 == 0) or (i % 3 == 0) or (i % 5 == 0): continue else: ans += i 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
54
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array #define vi vector<int> #define vvi vector<vector<int>> #define vll vector<long long> #define forn(i, n) for (ll i = 0; i < (n); i++) #define fori(i, k, n) for (ll i = k; i < (n); i++) #define all(x) (x).begin(), (x).end() #define en '\...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array #define vi vector<int> #define vvi vector<vector<int>> #define vll vector<long long> #define forn(i, n) for (ll i = 0; i < (n); i++) #define fori(i, k, n) for (ll i = k; i < (n); i++) #define all(x) (x).begin(), (x).end() #define en '\...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
347
import sys input = sys.stdin.readline # 改行コード「\n」を呼んでしまうため、文字数など、注意!! n = int(input().replace("\n","")) anslist = [] for i in range(1, n): if (i % 3 == 0) and (i % 5 == 0): continue # print('FizzBuzz', end=' ') elif i % 3 == 0: continue # print('Fizz', end=' ') elif i % 5...
import sys input = sys.stdin.readline # 改行コード「\n」を呼んでしまうため、文字数など、注意!! n = int(input().replace("\n","")) anslist = [] for i in range(1, n+1): if (i % 3 == 0) and (i % 5 == 0): continue # print('FizzBuzz', end=' ') elif i % 3 == 0: continue # print('Fizz', end=' ') elif i %...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
95
N = int(input()) print(sum([0 if i%3!=0 and i%5!=0 else i for i in range(1,N+1)]))
N = int(input()) print(sum([0 if i%3==0 or i%5==0 else i for i in range(1,N+1)]))
[["-", 0, 658, 8, 41, 0, 679, 31, 666, 667, 79], ["+", 0, 658, 8, 41, 0, 679, 31, 666, 667, 60], ["-", 3, 4, 0, 658, 8, 41, 0, 679, 17, 355], ["+", 3, 4, 0, 658, 8, 41, 0, 679, 17, 354], ["-", 0, 658, 8, 41, 0, 679, 12, 666, 667, 79], ["+", 0, 658, 8, 41, 0, 679, 12, 666, 667, 60]]
5
42
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { int n; long long int i; long long int ans = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 == 0) { continue; } else if (i % 5 == 0) { continue; } else { ans = ans + i; } ...
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { int n; long long int i; long long int ans = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 == 0) { continue; } else if (i % 5 == 0) { continue; } else { ans = ans + i; } ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
101
#include <bits/stdc++.h> using namespace std; #define int long long // typedef //------------------------------------------ typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef vector<PII> VP; // rep //------------------------------------------ #define FOR(i, ...
#include <bits/stdc++.h> using namespace std; #define int long long // typedef //------------------------------------------ typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef vector<PII> VP; // rep //------------------------------------------ #define FOR(i, ...
[["+", 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
141
a = int(input()) result = 0 for num in range(a): if (num%3 != 0) & (num%5 != 0): result += num print(result)
a = int(input()) result = 0 for num in range(1, a+1): if (num%3 != 0) & (num%5 != 0): result += num print(result)
[["+", 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
43
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <numeric> using namespace std; typedef long long ll; typedef unsigned long long ull; #define YES(n) cout << ((n) ? "YES" : "NO") << endl #define Yes(n) cout << ((n) ? "Yes" : "No") << endl int main() { ll n, cnt = 0, i = 1; cin >> n; for ...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <numeric> using namespace std; typedef long long ll; typedef unsigned long long ull; #define YES(n) cout << ((n) ? "YES" : "NO") << endl #define Yes(n) cout << ((n) ? "Yes" : "No") << endl int main() { ll n, cnt = 0, i = 1; cin >> n; for...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
101
#include <bits/stdc++.h> #define ll long long #define mkp make_pair #define fi first #define se second #define pb push_back #define pf push_front #define ppb pop_back #define ppf pop_front using namespace std; int z, o, ans; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { if (i % 3 == 0 |...
#include <bits/stdc++.h> #define ll long long #define mkp make_pair #define fi first #define se second #define pb push_back #define pf push_front #define ppb pop_back #define ppf pop_front using namespace std; ll z, o, ans; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { if (i % 3 == 0 ||...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78]]
1
95
#include <bits/stdc++.h> using namespace std; #define itn int #define nibu(K, x) binary_search(K.begin(), K.end(), x) #define rep(i, n) for (int i = 0; i < n; i++) #define all(x) x.begin(), x.end() #define sz(x) x.size() #define pb push_back #define mp make_pair #define F first #define S second #define out(x) cout << x...
#include <bits/stdc++.h> using namespace std; #define itn int #define nibu(K, x) binary_search(K.begin(), K.end(), x) #define rep(i, n) for (int i = 0; i < n; i++) #define all(x) x.begin(), x.end() #define sz(x) x.size() #define pb push_back #define mp make_pair #define F first #define S second #define out(x) cout << x...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 15, 339, 51, 16, 31, 16, 31, 16, 31, 22], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 31, 22], ["-", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22]]
1
173
a=int(input()) set3 = set(range(0,a,3)) set5 = set(range(0,a,5)) seta = set(range(0,a)) print(sum(seta-set3-set5))
a = int(input()) set3 = set(range(0, a+1, 3)) set5 = set(range(0, a+1, 5)) seta = set(range(0, a+1)) print(sum(seta-set3-set5))
[["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
56
n = int(input()) sum_num = 0 for i in range(n): if not (i % 3 == 0 and i % 5 == 0 or i % 3 == 0 or i % 5 == 0): sum_num += i print(sum_num)
n = int(input()) sum_num = 0 for i in range(1,n+1): if not (i % 3 == 0 and i % 5 == 0 or i % 3 == 0 or i % 5 == 0): sum_num += i print(sum_num)
[["+", 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
54
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using P = pair<int, int>; ll n, ans; int main() { cin >> n; ans = 0; rep(i, n) { if (!(i % 3 == 0 || i % 5 == 0)) ans += i; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 1; i < (n); ++i) using ll = long long; using P = pair<int, int>; ll n, ans; int main() { cin >> n; n++; ans = 0; rep(i, n) { if (!(i % 3 == 0 || i % 5 == 0)) ans += i; } cout << ans << endl; return 0; }
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 27, 17, 29]]
1
87
#include <bits/stdc++.h> using namespace std; #define gcd(a, b) __gcd(a, b) #define pb push_back #define sevensins \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define ll long long int #define mod 1000000...
#include <bits/stdc++.h> using namespace std; #define gcd(a, b) __gcd(a, b) #define pb push_back #define sevensins \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define ll long long int #define mod 1000000...
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
144
#include <stdio.h> int main() { int unused __attribute__((unused)); int i, N; long long sum = 0; unused = scanf("%d", &N); for (i = 0; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) sum += i; } printf("%lld", sum); return 0; }
#include <stdio.h> int main() { int unused __attribute__((unused)); int i, N; long long sum = 0; unused = scanf("%d", &N); for (i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) sum += i; } printf("%lld", sum); return 0; }
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
0
86
#include <ctype.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int compare_int(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main() { int N; scanf("%d", &N); int start = 0; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { start +=...
#include <ctype.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int compare_int(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main() { int N; scanf("%d", &N); long long start = 0; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { st...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
112
#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; int cnt = 0; cin >> n; rep(i, n) { if ((i + 1) % 3 != 0 && (i + 1) % 5 != 0) cnt += i + 1; } cout << cnt << endl; return 0; }
#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; ll cnt = 0; cin >> n; rep(i, n) { if ((i + 1) % 3 != 0 && (i + 1) % 5 != 0) cnt += i + 1; } cout << cnt << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
93
inputbox=int(input()) sum=0 for i in range (inputbox): if (i%3==0 or i%5==0): pass else: sum=sum+i print(sum)
inputbox=int(input()) sum=0 for i in range (inputbox+1): if (i%3==0 or i%5==0): pass else: sum=sum+i print(sum)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
46
N = int(input()) total = 0 for i in range(N): if i % 3 != 0 and i % 5 != 0: total += i + 1 print(total)
N = int(input()) total = 0 for i in range(1, N+1): if i % 3 != 0 and i % 5 != 0: total += i print(total)
[["+", 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], ["-", 64, 196, 0, 1, 0, 677, 12, 657, 17, 72], ["-", 64, 196, 0, 1, 0, 677, 12, 657, 12, 612]]
5
41
////////////////////////////////////////////////////////// //______________________________________________________// // ____ __ // // / ) / | // //---/__ /-----__---/__|----__----__----__------__--_/_-// // / ) /___) / | ...
////////////////////////////////////////////////////////// //______________________________________________________// // ____ __ // // / ) / | // //---/__ /-----__---/__|----__----__----__------__--_/_-// // / ) /___) / | ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
271
#include <assert.h> /*確認*/ #include <ctype.h> /*文字操作*/ #include <limits.h> /*限界*/ #include <math.h> /*計算*/ #include <stdbool.h>/*bool型*/ #include <stdio.h> /*入出力*/ #include <stdlib.h> /*標準ライブラリ*/ #include <string.h> /*文字列*/ //--------------------------------------------------- #define rep(i, n) for (int i = 0; i ...
#include <assert.h> /*確認*/ #include <ctype.h> /*文字操作*/ #include <limits.h> /*限界*/ #include <math.h> /*計算*/ #include <stdbool.h>/*bool型*/ #include <stdio.h> /*入出力*/ #include <stdlib.h> /*標準ライブラリ*/ #include <string.h> /*文字列*/ //--------------------------------------------------- #define rep(i, n) for (int i = 0; i ...
[["-", 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]]
0
131
#include <bits/stdc++.h> using namespace std; #define rep(i, c) for (int i = 0; i < (int)c; i++) #define ll long long #define upd_max(maxer, updater) \ if (maxer < updater) \ maxer = updater; #define upd_min(min...
#include <bits/stdc++.h> using namespace std; #define rep(i, c) for (int i = 0; i < (int)c; i++) #define ll long long #define upd_max(maxer, updater) \ if (maxer < updater) \ maxer = updater; #define upd_min(min...
[["+", 0, 14, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 27, 17, 29], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
102
// FizzBuzz Sum #include <bits/stdc++.h> using namespace std; int main() { int N, Ans = 0; cin >> N; for (int i = 1; i <= N; i++) { if ((i % 3) != 0 && (i % 5) != 0) { Ans += i; } } cout << Ans << endl; return 0; }
// FizzBuzz Sum #include <bits/stdc++.h> using namespace std; int main() { long long N, Ans = 0; cin >> N; for (int i = 1; i <= N; i++) { if ((i % 3) != 0 && (i % 5) != 0) { Ans += i; } } cout << Ans << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
73
#include <iostream> #include <stdio.h> //#include <bits/stdc++.h> #include <algorithm> #include <cassert> #include <cmath> #include <cmath> #include <cstdint> #include <cstring> #include <float.h> #include <iomanip> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string> #i...
#include <iostream> #include <stdio.h> //#include <bits/stdc++.h> #include <algorithm> #include <cassert> #include <cmath> #include <cmath> #include <cstdint> #include <cstring> #include <float.h> #include <iomanip> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string> #i...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22]]
1
292
#include <iostream> using namespace std; int main(void) { int n; cin >> n; long long ans = 0; for (int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) { ans += i; } } cout << ans << endl; }
#include <iostream> using namespace std; int main(void) { int n; cin >> n; long long ans = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { ans += i; } } cout << ans << endl; }
[["-", 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
68
#include <bits/stdc++.h> using namespace std; int main() { long long int n, sum = 0; cin >> n; for (long long int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum = sum + i; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long int n, sum = 0; cin >> n; for (long long int i = 0; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum = sum + i; } } cout << sum << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
71
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long sum = 0; for (int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } System.out.println(sum); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long sum = 0; for (int i = 1; i < n + 1; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } System.out.println(sum); } }
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
94
#include <iostream> using namespace std; int main() { int N, i, a = 0; cin >> N; for (i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { a = a; } else { a += i; } } cout << a; return 0; }
#include <iostream> using namespace std; int main() { long long N, i, a = 0; cin >> N; for (i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { a = a; } else { a += i; } } cout << a; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
74
N = int(input()) FB = [0]*N for i in range(1,N+1): if i % 3 != 0 and i % 5 != 0: FB[i] = i print(sum(FB))
N = int(input()) FB = [0]*N for i in range(1,N+1): if i % 3 != 0 and i % 5 != 0: FB[i-1] = i print(sum(FB))
[["+", 0, 1, 0, 662, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 662, 31, 206, 206, 657, 12, 612]]
5
53
#include <iostream> using namespace std; int main() { int N; int sum = 0; cin >> N; for (int i = 1; i <= N; i++) { if (!(i % 3 == 0) && !(i % 5 == 0)) { sum += i; } } cout << sum << endl; return 0; }
#include <iostream> using namespace std; int main() { long long N; long long sum = 0; cin >> N; for (long long i = 1; i <= N; i++) { if (!(i % 3 == 0) && !(i % 5 == 0)) { sum += i; } } cout << sum << 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]]
1
75
#define _CRT_SECURE_NO_WARNINGS #include <math.h> #include <stdio.h> int main() { unsigned long long i, j = 0, k, num = 0, ans = 0, N = 0; scanf("%llu", &N); num = N; for (i = 1; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } printf("%llu", ans); return 0; }
#define _CRT_SECURE_NO_WARNINGS #include <math.h> #include <stdio.h> int main() { unsigned long long i, j = 0, k, num = 0, ans = 0, N = 0; scanf("%llu", &N); num = N; for (i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } printf("%llu", ans); return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
0
94
#include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; long long int sum = 0; for (long long int i = 1; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; long long int sum = 0; for (long long int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
75
N = int(input()) count = 0 for i in range(N): if i %3 != 0: if i%5 != 0: count +=i print(count)
N = int(input()) count = 0 for i in range(N+1): if i %3 != 0: if i%5 != 0: count +=i print(count)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
40
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int sum; for (int i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { continue; } else { sum += i; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long long sum = 0; for (int i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { continue; } else { sum += i; } } cout << sum << endl; }
[["-", 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, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
69
a = input() count = 0 for i in range(1, int(a)): if i % 3 == 0 and i % 5 == 0: #print('FizzBuzz') count += 0 elif i % 3 == 0: #print('Fizz') count += 0 elif i % 5 == 0: #print('Buzz') count += 0 else: count += i #print(i) print(count)
a = input() count = 0 for i in range(1, int(a) + 1): if i % 3 == 0 and i % 5 == 0: #print('FizzBuzz') count += 0 elif i % 3 == 0: #print('Fizz') count += 0 elif i % 5 == 0: #print('Buzz') count += 0 else: count += i #print(i) print(count)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
70
n = int(input()) list = [] list1 = [] for i in range(1, n): if i%5==0 and i%3==0: list.append('FizzBuzz') elif i%3==0: list.append('Fizz') elif i%5==0: list.append('Buzz') else: list.append(i) for j in list: if isinstance(j, int): list1.append(j) print(sum(li...
n = int(input()) list = [] list1 = [] for i in range(1, n+1): if i%5==0 and i%3==0: list.append('FizzBuzz') elif i%3==0: list.append('Fizz') elif i%5==0: list.append('Buzz') else: list.append(i) for j in list: if isinstance(j, int): list1.append(j) print(sum(l...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
111
#include <bits/stdc++.h> #define r1(i, n) for (int i = 0; i < n; i++) #define r2(i, n) for (int i = 1; i < n + 1; i++) #define intc(n) \ int n; \ cin >> n; #define ll long long #defin...
#include <bits/stdc++.h> #define r1(i, n) for (int i = 0; i < n; i++) #define r2(i, n) for (int i = 1; i < n + 1; i++) #define intc(n) \ int n; \ cin >> n; #define ll long long #defin...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]]
1
93
#include <bits/stdc++.h> using namespace std; int main() { int N, C; cin >> N; C = 0; for (int i = 0; i < N; i++) { if ((i + 1) % 15 == 0) { } else if ((i + 1) % 3 == 0) { } else if ((i + 1) % 5 == 0) { } else { C = C + (i + 1); } } cout << C; }
#include <bits/stdc++.h> using namespace std; int main() { int64_t N, C; cin >> N; C = 0; for (int64_t i = 0; i < N; i++) { if ((i + 1) % 15 == 0) { } else if ((i + 1) % 3 == 0) { } else if ((i + 1) % 5 == 0) { } else { C = C + (i + 1); } } cout << C; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40]]
1
102
x = int(input()) sum = 0 for i in range(x): if (i%3 == 0) or (i%5 == 0): sum = sum else: sum += i print(sum)
x = int(input()) sum = 0 for i in range(1, x+1): if (i%3 == 0) or (i%5 == 0): sum = sum else: sum += i print(sum)
[["+", 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
48
N = int(input()) A=N//3 B=N//5 AanB=N//15 Ssum=(1+N)*N*(1/2) Asum=(1+A)*A*(1/2)*3 Bsum=(1+B)*B*(1/2)*5 AanBsum=(1+AanB)*AanB*(1/2)*15 print(Ssum-Asum-Bsum-AanBsum)
N=int(input()) A=N//3 B=N//5 AanB=N//15 Ssum=(1+N)*N*(1/2) Asum=(1+A)*A*(1/2)*3 Bsum=(1+B)*B*(1/2)*5 AanBsum=(1+AanB)*AanB*(1/2)*15 print(int(Ssum-Asum-Bsum+AanBsum))
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
99
using namespace std; #include <bits/stdc++.h> #define rep(i, s) for (int i = 0; i < s; ++i) #define repr(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define all(v) (v.begin(), v.end()) #define EACH(i, s) \ for (__typeo...
using namespace std; #include <bits/stdc++.h> #define rep(i, s) for (int i = 0; i < s; ++i) #define repr(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define all(v) (v.begin(), v.end()) #define EACH(i, s) \ for (__typeo...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
244
#include <iostream> using namespace std; int main() { long long n; cin >> n; long long sum = 0; for (long long i = 0; i < n; i++) { if (i % 15 == 0) { continue; } else if (i % 3 == 0) { continue; } else if (i % 5 == 0) { continue; } else { sum += i; } } cout << ...
#include <iostream> using namespace std; int main() { long long n; cin >> n; long long sum = 0; for (long long i = 0; i < n + 1; i++) { if (i % 15 == 0) { continue; } else if (i % 3 == 0) { continue; } else if (i % 5 == 0) { continue; } else { sum += i; } } cout...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
97
#include <stdio.h> int main() { int n; int total = 0; scanf("%d", &n); for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { total = total + i; } } printf("%d\n", total); return 0; }
#include <stdio.h> int main() { long long int n; long long int total = 0; scanf("%lld", &n); for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { total = total + i; } } printf("%lld\n", total); return 0; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
77
#include <bits/stdc++.h> using namespace std; int main() { long long ans = 0, n, a; cin >> n; for (long long i = 0; i < n; i++) { if (0 != i % 3 && 0 != i % 5) { ans += i; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long ans = 0, n, a; cin >> n; n++; for (long long i = 0; i < n; i++) { if (0 != i % 3 && 0 != i % 5) { ans += i; } } cout << ans << endl; }
[["+", 0, 14, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 27, 17, 29], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
69
import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().solve(); } void solve() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); long sum = 0; for (int i = 0; i < N; i++) { if (i % 3 == 0) { } else if (i % 5 == 0)...
import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().solve(); } void solve() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); long sum = 0; for (int i = 1; i <= N; i++) { if (i % 3 == 0) { } else if (i % 5 == 0)...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
3
136
#include <bits/stdc++.h> #define ll signed long long int #define MAXX 1000005 #define FAST \ ios_base::sync_with_stdio(0); \ cin.tie(0); \...
#include <bits/stdc++.h> #define ll signed long long int #define MAXX 1000005 #define FAST \ ios_base::sync_with_stdio(0); \ cin.tie(0); \...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 79], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79]]
1
86
#include <iostream> #include <string> using namespace std; bool fuzzbizzCol(unsigned long num) { if (num % 3 == 0) { return true; } if (num % 5 == 0) { return true; } return false; } int main() { string N; cin >> N; unsigned long sum = 0; for (int i = 0; i < stol(N); ++i) { bool isFZ =...
#include <iostream> #include <string> using namespace std; bool fuzzbizzCol(unsigned long num) { if (num % 3 == 0) { return true; } if (num % 5 == 0) { return true; } return false; } int main() { string N; cin >> N; unsigned long sum = 0; for (unsigned long i = 1; i <= stol(N); ++i) { ...
[["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 87], ["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96], ["-", 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
110
#include <iostream> using namespace std; int main() { long long sum = 0; long long N; cin >> N; for (int i = 0; i != N; ++i) { if (!(i % 3 == 0 || i % 5 == 0)) { sum += i; } } cout << sum << endl; }
#include <iostream> using namespace std; int main() { long long sum = 0; long long N; cin >> N; for (int i = 1; i <= N; ++i) { if (!(i % 3 == 0 || i % 5 == 0)) { sum += i; } } cout << sum << endl; }
[["-", 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, 79], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
71
#include <algorithm> #include <iomanip> #include <iostream> #include <list> #include <sstream> #include <stdio.h> #include <string> #include <valarray> #include <vector> using namespace std; vector<int> Data; int main(void) { long long int Max; cin >> Max; long long int Sum = 0; for (long long int Target = 1...
#include <algorithm> #include <iomanip> #include <iostream> #include <list> #include <sstream> #include <stdio.h> #include <string> #include <valarray> #include <vector> using namespace std; vector<int> Data; int main(void) { long long int Max; cin >> Max; long long int Sum = 0; for (long long int Target = 1...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
106
#include <iostream> #include <string> using namespace std; int main(void) { int N; cin >> N; long long ans = 0; for (int i = 1; i < N; i++) { if (i % 3 == 0) continue; else if (i % 5 == 0) continue; else ans += i; } cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main(void) { int N; cin >> N; long long ans = 0; for (int i = 1; i <= N; i++) { if (i % 3 == 0) continue; else if (i % 5 == 0) continue; else ans += i; } cout << ans << endl; return 0; }
[["-", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["-", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
79
#include <stdio.h> typedef long long int64; typedef unsigned long long uint64; int fbcheck(int i) { if (i % 3 == 0 || i % 5 == 0) { return 0; } return i; } int main() { int n; uint64 l = 0; scanf("%d", &n); for (int i = 0; i != n; i++) { l += fbcheck(i); } printf("%lld", l); return 0; }
#include <stdio.h> typedef long long int64; typedef unsigned long long uint64; int fbcheck(int i) { if (i % 3 == 0 || i % 5 == 0) { return 0; } return i; } int main() { int n; uint64 l = 0; scanf("%d", &n); for (int i = 1; i != n + 1; i++) { l += fbcheck(i); } printf("%lld", l); return 0;...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
102
def main(): n = int(input()) a = 0 for i in range(1,n): if not (i%3 == 0 or i%5 == 0): a += i print(a) if __name__ == "__main__": main()
def main(): n = int(input()) a = 0 for i in range(1,n+1): if not (i%3 == 0 or i%5 == 0): a += i print(a) 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
59
N=int(input()) sum_all=N*(N-1)//2 sum_Fizz=3*(N//3)*(N//3-1)//2 sum_Buzz=5*(N//5)*(N//5-1)//2 sum_FizzBuzz=15*(N//15)*(N//15-1)//2 print(sum_all-sum_Fizz-sum_Buzz+sum_FizzBuzz)
N=int(input()) sum_all=N*(N+1)//2 sum_Fizz=3*(N//3)*(N//3+1)//2 sum_Buzz=5*(N//5)*(N//5+1)//2 sum_FizzBuzz=15*(N//15)*(N//15+1)//2 print(sum_all-sum_Fizz-sum_Buzz+sum_FizzBuzz)
[["-", 12, 657, 31, 657, 12, 23, 0, 657, 17, 33], ["+", 12, 657, 31, 657, 12, 23, 0, 657, 17, 72]]
5
86
#include <stdio.h> int main() { long long int a, i, s = 0; scanf("%lld", &a); for (i = 0; i < a; i++) { if (i % 3 == 0 || i % 5 == 0) continue; else s += i; } printf("%lld", s); return 0; }
#include <stdio.h> int main() { long long int a, i, s = 0; scanf("%lld", &a); for (i = 0; i <= a; i++) { if (i % 3 == 0 || i % 5 == 0) continue; else s += i; } printf("%lld", s); return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
0
77
# -*- coding: utf-8 -*- def main(a=''): # 整数の入力 a = int(input()) # a = int(a) # スペース区切りの整数の入力 # b, c = map(int, input().split()) # b, c = map(int, input()) # # 文字列の入力 # a = input() # 出力 # print("{} {}".format(a+b+c, s)) sum = 0 for i in range(a): if i % 3 == 0: ...
# -*- coding: utf-8 -*- def main(a=''): # 整数の入力 a = int(input()) # a = int(a) # スペース区切りの整数の入力 # b, c = map(int, input().split()) # b, c = map(int, input()) # # 文字列の入力 # a = input() # 出力 # print("{} {}".format(a+b+c, s)) sum = 0 for i in range(a+1): if i % 3 == 0...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
74
#include <bits/stdc++.h> using namespace std; int main() { int n, total; cin >> n; total = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) total += i; } cout << total << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long int n, total; cin >> n; total = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { total += i; } } cout << total << endl; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
65
#include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; //#include<bits/stdc++.h> int main() { int N; cin >> N; long long sum = 0; vector<int> number; for (int i = 0; i < N; i++) { if (i % 15 == 0) continue; else if (i % 5 == 0) continue; el...
#include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; //#include<bits/stdc++.h> int main() { int N; cin >> N; long long sum = 0; vector<int> number; for (int i = 0; i <= N; i++) { if (i % 15 == 0) continue; else if (i % 5 == 0) continue; e...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
132
#include <stdio.h> int main() { int n; scanf("%d", &n); long long int sum = 0; for (int i = 0; i < n; i++) { if (i % 5 != 0 && i % 3 != 0) { sum += i; } } printf("%lld", sum); return 0; }
#include <stdio.h> int main() { int n; scanf("%d", &n); long long int sum = 0; for (int i = 0; i < n + 1; i++) { if (i % 5 != 0 && i % 3 != 0) { sum += i; } } printf("%lld", sum); return 0; }
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
76
#include <iostream> using namespace std; int main() { long long n, i, res = 0; cin >> n; for (i = 1; i < n; i++) { bool fb = true; if (i % 3 == 0) fb = false; if (i % 5 == 0) fb = false; if (fb) res += i; } cout << res; return 0; }
#include <iostream> using namespace std; int main() { long long n, i, res = 0; cin >> n; for (i = 1; i <= n; i++) { bool fb = true; if (i % 3 == 0) fb = false; if (i % 5 == 0) fb = false; if (fb) res += i; } cout << res; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
85
N = int(input()) ans = 0 for i in range(N): if i % 15 == 0: ans += 0 elif i % 3 == 0: ans += 0 elif i % 5 == 0: ans += 0 else: ans += i print(ans)
N = int(input()) ans = 0 for i in range(N+1): if i % 15 == 0: ans += 0 elif i % 3 == 0: ans += 0 elif i % 5 == 0: ans += 0 else: ans += i print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
58
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n, ans = 0; cin >> n; for (int i = 1; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n, ans = 0; cin >> n; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } cout << ans << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
69
N = int(input()) a = [] for i in range(N): if i % 3 and i % 5: a.append(i) print(sum(a))
N = int(input()) a = [] for i in range(N+1): if i % 3 and i % 5: a.append(i) print(sum(a))
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
42
print(sum([i for i in range(int(input()+1)) if (i % 3 != 0 and i % 5 != 0)]))
print(sum([i for i in range(int(input())+1) if (i % 3 != 0 and i % 5 != 0)]))
[["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 25], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
37
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); // List<String> NList = new ArrayList<String>(); // int[] Narray = new int[N]; int sum = 0; for (int i = 0; i <= N; i++) { if (i % 3 == ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long N = scan.nextInt(); // List<String> NList = new ArrayList<String>(); // int[] Narray = new int[N]; long sum = 0; for (long i = 0; i <= N; i++) { if (i % 3 ...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 8, 196, 0, 7, 502, 503, 39, 506, 0, 507], ["+", 8, 196, 0, 7, 502, 503, 39, 506, 0, 96]]
3
98
n=int(input()) sum=0 for i in range(1,n): if (i%3 == 0) or (i%5 == 0): continue else: sum=sum+i; print(sum)
n=int(input()) sum=0 for i in range(1,n+1): if (i%3 == 0) or (i%5 == 0): continue else: sum=sum+i; print(sum)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
51
x = int(input()) sum = 0 for i in range(x+1): if i % 3 or i % 5: pass else: sum += i print(sum)
x = int(input()) sum = 0 for i in range(x+1): if i % 3 == 0 or i % 5 == 0: pass else: sum += i print(sum)
[["+", 8, 196, 0, 57, 15, 679, 31, 666, 667, 60], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 0, 612], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 0, 612]]
5
40
#include <bits/stdc++.h> using namespace std; using lint = long long int; int main() { lint num; lint sum = 0; cin >> num; for (lint i = 1; i < num; i++) { if (i % 3 != 0 && i % 5 != 0) sum = sum + i; } cout << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using lint = long long int; int main() { lint num; lint sum = 0; cin >> num; for (lint i = 1; i <= num; i++) { if (i % 3 != 0 && i % 5 != 0) sum = sum + i; } cout << sum << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
76
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define repr(i, x, n) for (int i = x; i < (n); i++) #define ALL(x) (x).begin(), (x).end() #define INF 1e9 typedef long long ll; using VI = vector<int>; using VS = vector<string>; using graph = vector<vector<int>>; int main() ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define repr(i, x, n) for (int i = x; i < (n); i++) #define ALL(x) (x).begin(), (x).end() #define INF 1e9 typedef long long ll; using VI = vector<int>; using VS = vector<string>; using graph = vector<vector<int>>; int main() ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
135
#include <bits/stdc++.h> using namespace std; int main() { uint64_t N; cin >> N; uint64_t sum = 0; for (uint64_t i = 0; i < N; i++) { if ((i % 3 != 0) && (i % 5 != 0)) { sum += i; } } cout << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { uint64_t N; cin >> N; uint64_t sum = 0; for (uint64_t i = 1; i < N + 1; i++) { if ((i % 3 != 0) && (i % 5 != 0)) { sum += i; } } cout << sum << endl; return 0; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
73
#include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { long long input, ans = 0; cin >> input; for (long long i = 1; i <= input; i++) { if (i % 3 == 0 || i % 5 == 0) ans += i; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { long long input, ans = 0; cin >> input; for (long long i = 1; i <= input; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } cout << ans << endl; return 0; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 79], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79]]
1
71
#include <stdio.h> int main(void) { int n, s, a, b, c, d, e, f, g; scanf("%d", &n); s = (n * (n + 1)) / 2; a = 3 * (n / 3); b = 5 * (n / 5); c = 15 * (n / 15); d = ((3 + a) * (n / 3)) / 2; e = ((5 + b) * (n / 5)) / 2; f = ((15 + c) * (n / 15)) / 2; g = s + f - d - e; printf("%d", g); return 0; }
#include <stdio.h> int main(void) { long int n, s, a, b, c, d, e, f, g; scanf("%ld", &n); s = (n * (n + 1)) / 2; a = 3 * (n / 3); b = 5 * (n / 5); c = 15 * (n / 15); d = ((3 + a) * (n / 3)) / 2; e = ((5 + b) * (n / 5)) / 2; f = ((15 + c) * (n / 15)) / 2; g = s + f - d - e; printf("%ld", g); retu...
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
158
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; int sum = 0; for (int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; return 0; }
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; long sum = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 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
73
#include <iostream> #include <stdio.h> using namespace std; int main() { long N; long sum; cin >> N; sum = ((1 + N) * N + ((N / 3) * 3) * (N / 3 + 1) + ((N / 5) * 5) * (N / 5 + 1) + ((N / 15) * 15) * (N / 15 + 1)) / 2; cout << sum << endl; return 0; }
#include <iostream> #include <stdio.h> using namespace std; int main() { long N; long sum; cin >> N; sum = ((1 + N) * N - ((N / 3) * 3) * (N / 3 + 1) - ((N / 5) * 5) * (N / 5 + 1) + ((N / 15) * 15) * (N / 15 + 1)) / 2; cout << sum << endl; return 0; }
[["-", 31, 23, 0, 16, 31, 16, 31, 16, 17, 72], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 17, 33], ["-", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 33]]
1
101
import sys, os if __name__ == '__main__': N = input() s = 0 for i in range(1, N+1): if i % 3 ==0 or i % 5 ==0: continue else: s += i print(s)
import sys, os if __name__ == '__main__': N = int(input()) s = 0 for i in range(1, N+1): if i % 3 ==0 or i % 5 ==0: continue else: s += i print(s)
[["+", 64, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
54
#include <iostream> using namespace std; typedef unsigned long long ll; int main(void) { ll N, sum; cin >> N; sum = 0; for (ll i = 1; i < N; i++) { if ((i % 3) != 0 && (i % 5) != 0) { sum += i; } } cout << sum << endl; return 0; }
#include <iostream> using namespace std; typedef unsigned long long ll; int main(void) { ll N, sum; cin >> N; sum = 0; for (ll i = 1; i <= N; i++) { if ((i % 3) != 0 && (i % 5) != 0) { sum += i; } } cout << sum << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
81
#include <iostream> using namespace std; int main() { long long sum = 0, n; cin >> n; for (int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; }
#include <iostream> using namespace std; int main() { long long sum = 0, n; cin >> n; for (int i = 0; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
66
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int main() { int N; cin >> N; int s = 0; for (int i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { } else { s += i; } } cout << s << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int main() { ll N; cin >> N; ll s = 0; for (ll i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { } else { s = s + i; } } cout << s << 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], ["-", 75, 76, 0, 9, 0, 1, 0, 11, 17, 107], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 0, 9, 0, 1, 0, 11,...
1
82
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int sum = 0; for (int i = 1; i <= N; i++) { if (i % 3 == 0) { sum = sum + 0; } else if (i % 5 == 0) { sum = sum + 0; } else { sum = sum + i; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long sum = 0; for (int i = 1; i <= N; i++) { if (i % 3 == 0) { sum = sum + 0; } else if (i % 5 == 0) { sum = sum + 0; } else { sum = sum + i; } } cout << sum << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
88
#include <bits/stdc++.h> using namespace std; int main() { int N; long int sum = 0; cin >> N; for (int i = 0; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; long int sum = 0; cin >> N; for (int i = 1; i < N + 1; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
67
N = int(input()) s = 0 for i in range(N): if i % 3 == 0 and i % 5 == 0: continue elif i % 3 == 0: continue elif i % 5 == 0: continue else: s += i print(s)
N = int(input()) s = 0 for ii in range(N): i = ii + 1 if i % 3 == 0 and i % 5 == 0: continue elif i % 3 == 0: continue elif i % 5 == 0: continue else: s += i print(s)
[["-", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
58
#include <iostream> using namespace std; int main() { long long int n, sum = 0; cin >> n; for (long long int i = 1; i < n; i++) { if (i % 5 == 0 || i % 3 == 0) continue; else sum += i; } cout << sum; }
#include <iostream> using namespace std; int main() { long long int n, sum = 0; cin >> n; for (long long int i = 1; i <= n; i++) { if (i % 5 == 0 || i % 3 == 0) continue; else sum += i; } cout << sum; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
68
#include <bits/stdc++.h> using namespace std; int main() { long long n, ba = 3; cin >> n; for (long long t = 4; t <= n; t++) { if (t % 3 != 0 && t % 5 != 0) { ba += t; } } cout << ba; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long n, ba = 0; cin >> n; for (long long t = 1; t <= n; t++) { if (t % 3 != 0 && t % 5 != 0) { ba += t; } } cout << ba; return 0; }
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
68
#include <bits/stdc++.h> using namespace std; int main() { long N; long ans; ans = 0; cin >> N; for (int i = 0; i < N; i++) if ((i % 3 != 0) || (i % 5 != 0)) { ans += i; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long N; long ans; ans = 0; cin >> N; for (int i = 1; i < N + 1; i++) if ((i % 3 != 0) && (i % 5 != 0)) { ans += i; // cout << i << endl; } 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], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 98]]
1
73
#include <bits/stdc++.h> using namespace std; int main() { int n, result = 0; cin >> n; for (int i = 1; i <= n; i++) { if (i % 3 == 0 && i % 5 == 0) { continue; } if (i % 3 == 0) { continue; } if (i % 5 == 0) { continue; } result += i; } cout << result << e...
#include <bits/stdc++.h> using namespace std; int main() { long n, result = 0; cin >> n; for (long i = 1; i <= n; i++) { if (i % 3 == 0 && i % 5 == 0) { continue; } if (i % 3 == 0) { continue; } if (i % 5 == 0) { continue; } result += i; } cout << result <<...
[["-", 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]]
1
91
#include <iostream> using namespace std; int main(void) { // Your code here! long x = 0; long sum = 0; cin >> x; for (long i = 1; i < x; i++) { if (i % 3 > 0 && i % 5 > 0) { sum += i; } } cout << sum << endl; }
#include <iostream> using namespace std; int main(void) { // Your code here! long x = 0; long sum = 0; cin >> x; for (long i = 1; i <= x; i++) { if (i % 3 > 0 && i % 5 > 0) { sum += i; } } cout << sum << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
70
def main(): N = int(input()) ans = 0 for i in range(1, N): if i % 3 == 0 or i % 5 == 0: continue else: ans += i print(ans) if __name__ == "__main__": main()
def main(): N = int(input()) ans = 0 for i in range(1, N + 1): if i % 3 == 0 or i % 5 == 0: continue else: ans += i print(ans) 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
59
a = int(input()) x = [] for i in range(a - 1): if (i + 1) % 3 == 0: if (i + 1) % 5 == 0: continue else: continue elif (i + 1) % 5 == 0: continue else: x.append(i + 1) print(sum(x))
a = int(input()) x = [] for i in range(a): if (i + 1) % 3 == 0: if (i + 1) % 5 == 0: continue else: continue elif (i + 1) % 5 == 0: continue else: x.append(i + 1) print(sum(x))
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
77