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; int main() { int N; double S = 0; cin >> N; for (int i = 1; i < N + 1; i++) { if (i % 3 != 0 && i % 5 != 0) { S += i; } } cout << S << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; long S = 0; cin >> N; for (int i = 1; i < N + 1; i++) { if (i % 3 != 0 && i % 5 != 0) { S += i; } } cout << S << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
68
#include <algorithm> #include <cmath> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <vector> using namespace std; #define LOCAL 1 #define UPLOAD 2 #define ll long long const long long INF = 1LL << 60; template <class T = long long> T input() { T x; cin >> x;...
#include <algorithm> #include <cmath> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <vector> using namespace std; #define LOCAL 1 #define UPLOAD 2 #define ll long long const long long INF = 1LL << 60; template <class T = long long> T input() { T x; cin >> x;...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
287
#include <iostream> using namespace std; int main() { int N, sum; sum = 0; cin >> N; for (int i = 1; i < N + 1; i++) { if (i % 3 == 0 || i % 5 == 0) continue; else sum += i; } cout << sum << endl; }
#include <iostream> using namespace std; int main() { long long N, sum; sum = 0; cin >> N; for (int i = 1; i < N + 1; 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]]
1
70
#include <bits/stdc++.h> #define lli long long int #define inf 2147483647 #define infll LLONG_MAX #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define endl "\n" #define Yes() cout << "Yes" << endl #define No() cout << "No" << endl #define YES() cout << "YES" << endl #define NO(...
#include <bits/stdc++.h> #define lli long long int #define inf 2147483647 #define infll LLONG_MAX #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define endl "\n" #define Yes() cout << "Yes" << endl #define No() cout << "No" << endl #define YES() cout << "YES" << endl #define NO(...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
124
#include <cstdio> int main() { int n; scanf("%d", &n); int i; unsigned long sum; sum = 0; for (i = 0; i < n; i++) { if (i % 3 == 0 || i % 5 == 0) continue; else sum += i; } printf("%lu\n", sum); return 0; }
#include <cstdio> int main() { int n; scanf("%d", &n); int i; unsigned long sum; sum = 0; for (i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) continue; else sum += i; } printf("%lu\n", 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]]
1
81
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define INF 1LL << 60; #define LLINF 1e12 #define PI 3.14159265359 int dy[] = {1, 0, -1, 0}; int dx[] = {0, 1, 0, -1}; int ...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define INF 1LL << 60; #define LLINF 1e12 #define PI 3.14159265359 int dy[] = {1, 0, -1, 0}; int dx[] = {0, 1, 0, -1}; int ...
[["-", 0, 14, 8, 9, 0, 14, 49, 53, 49, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 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
424
#include <iostream> using namespace std; int main() { long long int a = 0LL; long long int n; cin >> n; for (long long int i = 0LL; i < n; i++) { if (i % 3 != 0 and i % 5 != 0) { a += i; } } cout << a << endl; }
#include <iostream> using namespace std; int main() { long long int a = 0LL; long long int n; cin >> n; for (long long int i = 0LL; i <= n; i++) { if (i % 3 != 0 and i % 5 != 0) { a += i; } } cout << a << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
72
def main(): n = int(input()) ans = 0 for i in range(n): if((i%3!=0)and(i%5!=0)): ans = ans + i print(ans) main()
def main(): n = int(input()) ans = 0 for i in range(1,n+1): if((i%3!=0)and(i%5!=0)): ans = ans + i print(ans) main()
[["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 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
55
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < b; i++) #define rrep(i, a, b) for (int i = a; i >= b; i--) // #define fore(i,a) for(auto &i:a) // #define all(x) (x).begin(),(x).end() // #pragma GCC optimize ("-O3") // using namespace std; void _main(); int main() { cin.tie(0); // ios::sync_with_stdio(...
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < b; i++) #define rrep(i, a, b) for (int i = a; i >= b; i--) // #define fore(i,a) for(auto &i:a) // #define all(x) (x).begin(),(x).end() // #pragma GCC optimize ("-O3") // using namespace std; void _main(); int main() { cin.tie(0); // ios::sync_with_stdio(...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
125
import java.math.BigInteger; import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); BigInteger a = BigInteger.ZERO; for (int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) {...
import java.math.BigInteger; import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); BigInteger a = BigInteger.ZERO; for (int i = 0; i < n + 1; i++) { if (i % 3 != 0 && i % 5 != ...
[["+", 8, 196, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
126
#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; int ans = 0; for (int i = 1; i <= n; ++i) { if (i % 3 == 0) continue; else if (i % 5 == 0) continue; ans += i; ...
#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 ans = 0; for (int i = 1; i <= n; ++i) { if (i % 3 == 0) continue; if (i % 5 == 0) continue; ans += i; } c...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]]
1
98
#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) continue; if (i % 5 == 0) continue; sum += i; } cout << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long long int sum = 0; for (int i = 1; i <= N; i++) { if (i % 3 == 0) continue; if (i % 5 == 0) continue; sum += i; } cout << sum << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
73
N = int(input()) a = 0 for i in range(N+1): if not i % 3==0 or not i % 5 == 0: a += i print(a)
N = int(input()) a = 0 for i in range(N+1): if i % 3 != 0 and i % 5 != 0: a += i print(a)
[["-", 8, 196, 0, 57, 15, 679, 31, 681, 0, 372], ["-", 0, 57, 15, 679, 31, 681, 28, 666, 667, 60], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 667, 79], ["-", 0, 7, 8, 196, 0, 57, 15, 679, 17, 354], ["-", 8, 196, 0, 57, 15, 679, 12, 681, 0, 372], ["+", 0, 7, 8, 196, 0, 57, 15, 679, 17, 355], ["-", 0, 57, 15, 679, 12, 681, 2...
5
43
/* Author - thiolhub */ #include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define db double #define pi 3.1415926535897932384626 #define PI acos(-1.0) #define endl "\n" #define mod 1000000007 #define mk make_pair #define pb push_back #define pii pair<int, int> #define vi ve...
/* Author - thiolhub */ #include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define db double #define pi 3.1415926535897932384626 #define PI acos(-1.0) #define endl "\n" #define mod 1000000007 #define mk make_pair #define pb push_back #define pii pair<int, int> #define vi ve...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
169
/* B - FizzBuzz Sum */ #include <stdio.h> int main(void) { int N, i, sum = 0; scanf("%d", &N); for (i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%d\n", sum); return 0; }
/* B - FizzBuzz Sum */ #include <stdio.h> int main(void) { int N, i; long long sum = 0; scanf("%d", &N); for (i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%lld\n", sum); 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], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
77
/* B - FizzBuzz Sum */ #include <stdio.h> int main(void) { int N, i, sum = 0; scanf("%d", &N); for (i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%d\n", sum); return 0; }
/* B - FizzBuzz Sum */ #include <stdio.h> int main(void) { long int N, i, sum = 0; scanf("%ld", &N); for (i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; // printf("%d ", i); } } printf("%ld\n", sum); 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
N = int(input()) sum = 0 for i in range(N): if (i+1) % 5 != 0 and (i+1) % 3 != 0: sum += i print(sum)
N = int(input()) sum = 0 for i in range(N): if (i+1) % 5 != 0 and (i+1) % 3 != 0: sum += i+1 print(sum)
[["+", 64, 196, 0, 1, 0, 677, 12, 657, 17, 72], ["+", 64, 196, 0, 1, 0, 677, 12, 657, 12, 612]]
5
47
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int ans = 0; for (int number = 1; number < N + 1; number++) { if (number % 3 != 0 && number % 5 != 0) { ans += number; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; long long ans = 0; for (long long number = 1; number < N + 1; number++) { if (number % 3 != 0 && number % 5 != 0) { ans += number; } } cout << ans << 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, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96]]
1
68
n = int(input()) e = [] m = [] for i in range(n): if i % 15 == 0: e.append(i) elif i % 3 == 0: e.append(i) elif i % 5 == 0: e.append(i) else: m.append(i) print(sum(m))
n = int(input()) e = [] m = [] for i in range(n+1): if i % 15 == 0: e.append(i) elif i % 3 == 0: e.append(i) elif i % 5 == 0: e.append(i) else: m.append(i) print(sum(m))
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
78
#include <bits/stdc++.h> using namespace std; #define rep(i, x) for (long long i = 0; i < x; i++) typedef long long ll; int main() { ll N, ans = 0; cin >> N; rep(i, N + 1) { if (i % 3 || i % 5) { } else { ans += i; } } cout << ans; }
#include <bits/stdc++.h> using namespace std; #define rep(i, x) for (long long i = 0; i < x; i++) typedef long long ll; int main() { ll N, ans = 0; cin >> N; rep(i, N + 1) { if (i % 3 == 0 || i % 5 == 0) { } else { ans += i; } } cout << ans; }
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
70
#include <bits/stdc++.h> #define rep(i, x) for (long long i = 0; i < x; i++) #define INF 1000100 typedef long long ll; using namespace std; int main() { ll N, ans = 0; cin >> N; for (ll i = 1; i < N; i++) { if (!(i % 3 == 0 || i % 5 == 0)) { ans += i; } } cout << ans; }
#include <bits/stdc++.h> #define rep(i, x) for (long long i = 0; i < x; i++) #define INF 1000100 typedef long long ll; using namespace std; int main() { ll N, ans = 0; cin >> N; for (ll i = 1; i < N + 1; i++) { if (!(i % 3 == 0 || i % 5 == 0)) { ans += i; } } cout << ans; }
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
82
#include <bits/stdc++.h> #define rep(i, x) for (long long i = 1; i < x; i++) typedef long long ll; using namespace std; int main() { ll ans = 0, N = 0; cin >> N; rep(i, N) { if (i % 3 == 0 || i % 5 == 0) { } else { ans += i; } } if (N == 1) { cout << 1; } else { cout << ans; }...
#include <bits/stdc++.h> #define rep(i, x) for (long long i = 1; i <= x; i++) typedef long long ll; using namespace std; int main() { ll ans = 0, N = 0; cin >> N; rep(i, N) { if (i % 3 == 0 || i % 5 == 0) { } else { ans += i; } } if (N == 1) { cout << 1; } else { cout << ans; ...
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59]]
1
88
N = int(input()) ans = 0 for i in range(1, N+1): if not (i%3==0 or i%5==0 or i%15==0): ans += i print(i)
N = int(input()) ans = 0 for i in range(1, N+1): if not (i%3==0 or i%5==0 or i%15==0): ans += i print(ans)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
52
n = int(input()) ans = 0 for i in range(n): if not (i % 3 == 0 or i % 5 == 0): ans += i print(ans)
n = int(input()) ans = 0 for i in range(1, n + 1): if not (i % 3 == 0 or i % 5 == 0): 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
42
/* START BY THE NAME OF ALMIGHTY ALLAH THIS WONT BE ACCEPTED STOP_GIVING_UP */ #include <bits/stdc++.h> #define l(i, a, n) for (int i = a; i < n; i++) #define PB push_back #define IN insert #define MP make_pair #define LW(v) sort(v.begin(), v.end()); #define HI(v) sort(v.begin(), v.end(), greater<long long>()); using ...
/* START BY THE NAME OF ALMIGHTY ALLAH THIS WONT BE ACCEPTED STOP_GIVING_UP */ #include <bits/stdc++.h> #define l(i, a, n) for (int i = a; i < n; i++) #define PB push_back #define IN insert #define MP make_pair #define LW(v) sort(v.begin(), v.end()); #define HI(v) sort(v.begin(), v.end(), greater<long long>()); using ...
[["+", 8, 9, 0, 9, 0, 57, 64, 9, 0, 46], ["+", 8, 9, 0, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 9, 0, 57, 75, 76, 0, 9, 0, 45]]
1
122
#ABC162B_FizzBuzzSum.rb n = gets.to_i sum = 0 for i in 1 .. n if i%3==0 || i%5==0 sum += i end end p sum
#ABC162B_FizzBuzzSum.rb n = gets.to_i sum = 0 for i in 1 .. n unless i%3==0 || i%5==0 sum += i end end p sum
[["-", 0, 493, 0, 88, 8, 170, 0, 121, 0, 121], ["+", 0, 493, 0, 88, 8, 170, 0, 747, 0, 747]]
4
34
N = int(input()) print(sum(filter(lambda x : (x%3 != 0) and (x%5 !=0), range(N))))
N = int(input()) print(sum(filter(lambda x : (x%3 != 0) and (x%5 !=0), range(N+1))))
[["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
40
#include <stdio.h> int main() { int N; //入力 int i; // counter long long sum = 0; scanf("%d", &N); for (i = 1; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%d\n", sum); return 0; }
#include <stdio.h> int main() { int N; //入力 int i; // counter unsigned long long sum = 0; //出力 scanf("%d", &N); for (i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { // 3でも5でもないなら足す sum += i; } } printf("%lld\n", sum); return 0; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
80
#include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; long long int i, sum; sum = 0; for (i = 1; i <= n; i++) { if (i % 5 == 0 || i % 3 == 0) { i++; } sum = sum + i; } cout << sum; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; long long int i, sum; sum = 0; for (i = 1; i <= n; i++) { if (i % 5 == 0 || i % 3 == 0) { continue; } sum = sum + i; } cout << sum; return 0; }
[["-", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 57, 64, 9, 0, 116, 0, 117]]
1
79
n = int(input()) sum = 0 for i in range(n): if not i%3==0 and not i%5==0 and not i%15==0: sum += i print(sum)
n = int(input()) sum = 0 for i in range(n+1): if not i%3==0 and not i%5==0 and not i%15==0: 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
48
# coding: utf-8 # Your code here! N = int(input()) ans = 0 for i in range(N): if i % 3 == 0 or i % 5 == 0: pass else: ans += i print(ans)
# coding: utf-8 # Your code here! N = int(input()) ans = 0 for i in range(N + 1): if i % 3 == 0 or i % 5 == 0: pass 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
44
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() int main() { int n; cin >> n; int sum = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum <...
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() int main() { int n; cin >> n; LL sum = 0; 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, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
85
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); long s = 0; for (int i = 0; i < N; i++) { if (i % 3 == 0 && i % 5 == 0) continue; if (i % 3 == 0) continue; ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); long s = 0; for (int i = 1; i <= N; i++) { if (i % 3 == 0 && i % 5 == 0) continue; if (i % 3 == 0) continue; ...
[["-", 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
120
N=int(input()) count=0 for i in range(1,N): if(i%3==0 and i%5==0): a=1 elif(i%3==0): a=1 elif(i%5==0): a=1 else: count=count+i print(count)
N=int(input()) count=0 for i in range(1,N+1): if(i%3==0 and i%5==0): a=1 elif(i%3==0): a=1 elif(i%5==0): a=1 else: count=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
74
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define endl '\n' int main() { // make input and output more efficient ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n; // stops reading at the first non-numeric character, which is the newline cin...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define endl '\n' int main() { // make input and output more efficient ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n; // stops reading at the first non-numeric character, which is the newline cin...
[["-", 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
100
n = input() kei = 0 for i in range(int(n)): if i%3 != 0 and i%5 != 0: kei += i print(kei)
n = input() kei = 0 for i in range(int(n)+1): if i%3 != 0 and i%5 != 0: kei += i print(kei)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
39
#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 += i; } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long int N, sum; sum = 0; cin >> N; for (long long int i = 1; i <= N; i++) { if ((i % 3 != 0 && i % 5 != 0)) sum += i; } cout << sum << endl; }
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 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, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["-", 0, 57, 15, 339,...
1
71
package main import "fmt" func main() { var N uint64 fmt.Scan(&N) var sum uint64 sum = 0 var i uint64 for i = 0; i < N; i++{ if i % 3 !=0 && i % 5 != 0 { sum += i } } fmt.Println(sum) }
package main import "fmt" func main() { var N uint64 fmt.Scan(&N) var sum uint64 sum = 0 var i uint64 for i = 1; i <= N; i++{ if i % 3 !=0 && i % 5 != 0 { sum += i } } fmt.Println(sum) }
[["-", 0, 7, 0, 430, 10, 436, 12, 432, 0, 433], ["+", 0, 7, 0, 430, 10, 436, 12, 432, 0, 433], ["-", 8, 196, 0, 7, 0, 430, 15, 16, 17, 18], ["+", 8, 196, 0, 7, 0, 430, 15, 16, 17, 19]]
7
79
N = int(input()) def judge(x): if x % 15 == 0: return 0 elif x % 3 == 0: return 0 elif x % 5 == 0: return 0 else: return x l =[] for i in range(1,N+1): l.append(i) print(sum(l))
N = int(input()) def judge(x): if x % 15 == 0: return 0 elif x % 3 == 0: return 0 elif x % 5 == 0: return 0 else: return x l =[] for i in range(1,N+1): l.append(judge(i)) print(sum(l))
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
74
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; cin >> n; ll cnt = 0; rep(i, n) { if (!(i % 3 == 0) && !(i % 5 == 0)) cnt += i; } cout << cnt << endl; return 0; }
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; cin >> n; ll cnt = 0; rep(i, n + 1) { if (!(i % 3 == 0) && !(i % 5 == 0)) cnt += i; } cout << cnt << endl; return 0; }
[["+", 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
81
def judge(x): y = 0 if x%3==0 or x%5==0: y = 1 return y n = int(input()) ans = 0 for i in range(n): num = i+1 if judge(num)==1: ans += num print(ans)
def judge(x): y = 0 if x%3==0 or x%5==0: y = 1 return y n = int(input()) ans = 0 for i in range(n): num = i+1 if judge(num)==0: ans += num print(ans)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612]]
5
66
x = int(input()) sum = 0 for num in range(1,x): sum = sum + num if num%3 == 0 or num%5 == 0: sum = sum - num print(sum)
x = int(input()) sum = 0 for num in range(1,x+1): sum = sum + num if num%3 == 0 or num%5 == 0: sum = sum - num print(sum)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
48
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int N; cin >> N; int ans = 0; for (int i = 1; i <= N; ++i) { if (i % 3 != 0 && i % 5 != 0) ans += i; } cout << ans << endl; }
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { 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; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
70
#include <fstream> #include <iostream> #include <math.h> #include <string> using namespace std; int main() { int N, sum = 0, tmp; cin >> N; for (int i = 0; i < N + 1; i++) { tmp = 1; if (i % 3 == 0) tmp = 0; if (i % 5 == 0) tmp = 0; sum += i * tmp; } cout << sum; }
#include <fstream> #include <iostream> #include <math.h> #include <string> using namespace std; int main() { long long N, sum = 0, tmp; cin >> N; for (int i = 0; i < N + 1; i++) { tmp = 1; if (i % 3 == 0) tmp = 0; if (i % 5 == 0) tmp = 0; sum += i * tmp; } cout << sum; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
87
#include <stdio.h> int main(void) { int n, i, w3, w5; long int total = 0; scanf("%d", &n); for (i = 1; i < n; i++) { w3 = 0; w5 = 0; if (i % 3 == 0) w3 = 1; if (i % 5 == 0) w5 = 1; if (w3 + w5 == 0) total += i; } printf("%ld\n", total); return 0; }
#include <stdio.h> int main(void) { int n, i, w3, w5; long int total = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { w3 = 0; w5 = 0; if (i % 3 == 0) w3 = 1; if (i % 5 == 0) w5 = 1; if (w3 + w5 == 0) total += i; } printf("%ld\n", total); return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
0
106
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; long long ans = 0; for (long long i = 0; i < n; i++) { if (i % 3 == 0) continue; if (i % 5 == 0) continue; ans += i; // if (can) std::cout << i; } // std::cout << endl; cout << ans << endl; r...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long ans = 0; for (int i = 0; i <= n; i++) { if (i % 3 == 0) continue; if (i % 5 == 0) continue; ans += i; } cout << ans << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
78
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long int s = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) continue; s += i; } printf("%d", s); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long s = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) continue; s += i; } printf("%lld", s); return 0; }
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 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]]
1
73
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #pragma GCC optimize("O3") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") //(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS) #pragma...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #pragma GCC optimize("O3") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") //(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS) #pragma...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 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
188
N = int(input()) F =list(range(1,N)) B =[i for i in F if i%3 != 0 and i%5 != 0] print(sum(B))
N = int(input()) F =list(range(1,N+1)) B =[i for i in F if i%3 != 0 and i%5 != 0] print(sum(B))
[["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
47
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n; cin >> n; ll ans = 0; 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() { int n; cin >> n; ll ans = 0; 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
72
#include <iostream> using namespace std; int main() { int n; cin >> n; int sum = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << "\n"; }
#include <iostream> using namespace std; #define ll long long int main() { int n; cin >> n; ll sum = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << "\n"; }
[["+", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
68
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() const long long mod = 1e9 + 7; const int dx[4] = {0, 1, 0, -1}; const int dy[4] = {1, 0, -1, 0}; const int ddx[4] = {1, 1, -1, -1}; const int ddy[4] = {1, -1, -1, 1}; ////////////////////////////////// int main() { int n; cin >> n;...
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() const long long mod = 1e9 + 7; const int dx[4] = {0, 1, 0, -1}; const int dy[4] = {1, 0, -1, 0}; const int ddx[4] = {1, 1, -1, -1}; const int ddy[4] = {1, -1, -1, 1}; ////////////////////////////////// int main() { int n; cin >> n;...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
155
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int sum = 0; //合計用 for (int i = 1; i < N + 1; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long sum = 0; //合計用 for (long i = 1; i < N + 1; i++) { if (i % 3 != 0 && i % 5 != 0) { 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, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96]]
1
69
#include <bits/stdc++.h> using namespace std; int main() { int N, sum = 0; cin >> N; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long N, sum = 0; cin >> N; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) 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, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
65
n=int(input()) N=0 for i in range(1,n): if not i%3==0 and not i%5==0: N+=i print(N)
n=int(input()) N=0 for i in range(1,n+1): if not i%3==0 and not i%5==0: N+=i print(N)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
43
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265359 int main() { int N, 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 <bits/stdc++.h> using namespace std; #define PI 3.14159265359 int main() { int N; long long 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; }
[["-", 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
71
#include <stdio.h> int main(void) { int i, n; scanf("%d", &n); long long ans = 0; for (i = 1; i <= n; i++) { if ((i % 3 != 0) && (i % 5 != 0)) ans += i; } printf("%d", ans); return 0; }
#include <stdio.h> int main(void) { int i, n; scanf("%d", &n); long long ans = 0; for (i = 1; i <= n; i++) { if ((i % 3 != 0) && (i % 5 != 0)) ans += i; } printf("%lld\n", ans); return 0; }
[["-", 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, 5, 0, 44]]
0
79
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long total = 0; for (int i = 0; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) { total += i; } } System.out.println(total); } }
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long total = 0; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) total += i; } System.out.println(total); } }
[["-", 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], ["-", 0, 7, 8, 196, 0, 57, 64, 196, 0, 45], ["-", 0, 7, 8, 196, 0, 57, 64, 196, 0, 46]]
3
93
a = int(input()) ans = 0 for i in range(a+1): if(i % 3 == 0 or i % 5 == 0): ans += i print(ans)
a = int(input()) ans = 0 for i in range(a+1): if(i % 3 != 0 and i % 5 != 0): ans += i print(ans)
[["-", 0, 57, 15, 23, 0, 679, 31, 666, 667, 60], ["+", 0, 57, 15, 23, 0, 679, 31, 666, 667, 79], ["-", 8, 196, 0, 57, 15, 23, 0, 679, 17, 354], ["+", 8, 196, 0, 57, 15, 23, 0, 679, 17, 355], ["-", 0, 57, 15, 23, 0, 679, 12, 666, 667, 60], ["+", 0, 57, 15, 23, 0, 679, 12, 666, 667, 79]]
5
43
#include <stdio.h> int main(void) { int a; scanf("%d", &a); int sum = 0; for (int i = 1; i <= a; i++) { if ((i % 3 != 0) && (i % 5 != 0)) { sum += i; } } printf("%d", sum); }
#include <stdio.h> int main(void) { int a; scanf("%d", &a); long sum = 0; for (int i = 1; i <= a; i++) { if ((i % 3 != 0) && (i % 5 != 0)) { sum += i; } } printf("%ld", sum); }
[["-", 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
76
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #define LL long long using namespace std; int n, sum, i; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; for (i = 1; i <= n; i++) if (i % 3 && i % 5) sum += i; cout << sum; return 0; }
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #define LL long long using namespace std; int n, i; LL sum; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; for (i = 1; i <= n; i++) if (i % 3 && i % 5) sum += i; cout << sum; return 0; }
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 49, 22], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 49, 22]]
1
87
#include <bits/stdc++.h> using namespace std; int main() { int n; unsigned long int sum = 0; cin >> n; for (int i = 1; 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; unsigned long int sum = 0; cin >> n; for (int i = 1; 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
68
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) { } else { sum += i; } } System.out.println(s...
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) { } else { sum += i; } } System.out.println(...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
3
97
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> P; #define INF 10000000000000 #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n); i++) #define repN_1(i, n) for (int i = 0; i < (int)(n - 1); i++) #define repM(i, n) for (int ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> P; #define INF 10000000000000 #define rep(i, n) for (ll i = 0; i <= (ll)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n); i++) #define repN_1(i, n) for (int i = 0; i < (int)(n - 1); i++) #define repM(i, n) for (int...
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59]]
1
192
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> int main() { unsigned long long n, ans = 0; std::cin >> n; for (unsigned long long i = 0; i < n; ++i) { if (i % 3 != 0 && i % 5 != 0) { ans += i; } } std::cout << ans << std::endl; return 0; }
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> int main() { unsigned long long n, ans = 0; std::cin >> n; for (unsigned long long i = 0; i <= n; ++i) { if (i % 3 != 0 && i % 5 != 0) { ans += i; } } std::cout << ans << std::endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
82
#include <stdio.h> int main() { int n, i, sum; scanf("%d", &n); sum = 0; for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%d\n", sum); return 0; }
#include <stdio.h> int main() { int n, i; scanf("%d", &n); long long sum = 0; for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%lld\n", sum); return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 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
N=int(input()) FizzBuzz=0 for i in range(N): if ((i+1)%3 == 0) or ((i+1)%5 == 0): FizzBuzz += i+1 print(FizzBuzz)
N=int(input()) FizzBuzz=0 for i in range(N): if ((i+1)%3 != 0) and ((i+1)%5 != 0): FizzBuzz += i+1 print(FizzBuzz)
[["-", 0, 57, 15, 679, 31, 23, 0, 666, 667, 60], ["+", 0, 57, 15, 679, 31, 23, 0, 666, 667, 79], ["-", 0, 7, 8, 196, 0, 57, 15, 679, 17, 354], ["+", 0, 7, 8, 196, 0, 57, 15, 679, 17, 355], ["-", 0, 57, 15, 679, 12, 23, 0, 666, 667, 60], ["+", 0, 57, 15, 679, 12, 23, 0, 666, 667, 79]]
5
53
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int N; cin >> N; long long sum = 0; for (int i = 1; i <= N; i++) { string s = ""; if (i % 3 != 0 && i % 5 != 0) { s = "FizzBuzz"; } else if (i % 3 == 0) { s = "Fizz"; } else if (i % 5 == 0) { ...
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int N; cin >> N; long long sum = 0; for (int i = 1; i <= N; i++) { string s = ""; if (i % 3 == 0 && i % 5 == 0) { s = "FizzBuzz"; } else if (i % 3 == 0) { s = "Fizz"; } else if (i % 5 == 0) { ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60]]
1
123
#include <iostream> using namespace std; int main() { int n; cin >> n; long long int cnt = 0; for (int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) cnt += i; } cout << cnt << endl; return 0; }
#include <iostream> using namespace std; int main() { long long int n; cin >> n; long long int cnt = 0; for (long long int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) cnt += i; } cout << cnt << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 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
69
N=int(input()) B=0 for i in range(N): if (i+1)%3!=0 and (i+1)%5!=0: B=i+B print(B)
N=int(input()) B=0 for i in range(N): if (i+1)%3!=0 and (i+1)%5!=0: B=i+1+B print(B)
[["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 72]]
5
49
#include <bits/stdc++.h> using namespace std; int main() { int S = 0; int N = 0; cin >> N; for (int i = 1; i < N + 1; i++) { if (i % 5 != 0 && i % 3 != 0) { S += i; } } cout << S << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long int S = 0; int N = 0; cin >> N; for (int i = 1; i < N + 1; i++) { if (i % 5 != 0 && i % 3 != 0) { S += i; } } cout << S << endl; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
70
N =int(input()) S = 0 for i in range(N): if (i%3)!=0 and (i%5)!=0: S = S +i print(S)
N =int(input()) S = 0 for i in range(1,N+1): if (i % 3) != 0 and (i % 5) != 0: S = S + i print(S)
[["+", 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
45
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { int n; cin >> n; ll s = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) s += i; } cout << s; }
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { int n; cin >> n; ll s = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) s += i; } cout << s; }
[["-", 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
65
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { int n; cin >> n; ll s = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) s += i; } cout << s; }
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { int n; cin >> n; ll s = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) ; else s += i; } cout << s; }
[["+", 0, 7, 8, 9, 0, 57, 64, 1, 0, 35], ["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]]
1
65
#include <bits/stdc++.h> using namespace std; #define lli long long int #define rep(i, s, e) for (int i = s; i < e; i++) int main() { lli N; cin >> N; lli res = 0; for (lli i = 0LL; i < N; i++) { if (i % 3 != 0 and i % 5 != 0) res += i; } cout << res << endl; }
#include <bits/stdc++.h> using namespace std; #define lli long long int #define rep(i, s, e) for (int i = s; i < e; i++) int main() { lli N; cin >> N; lli res = 0; for (lli i = 1LL; i <= N; i++) { if (i % 3 != 0 and i % 5 != 0) res += i; } cout << res << 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
77
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int64_t ans = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 || i % 5 != 0) continue; ans += i; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int64_t ans = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) continue; ans += i; } cout << ans << endl; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60]]
1
66
n = int(input()) #n = 15 a = [] for x in range(n): if x % 5 != 0 and x % 3 != 0: a.append(x) print(sum(a))
n = int(input()) #n = 1000000 a = [] #sum = 0 for x in range(1,n+1): if x % 5 != 0 and x % 3 != 0: a.append(x) print(sum(a))
[["+", 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
47
#include <iostream> using namespace std; int main() { int n, sum = 0; cin >> n; for (int i = 1; i <= n; i++) { if (i % 5 != 0 && i % 3 != 0) sum = sum + i; } cout << sum << endl; }
#include <iostream> using namespace std; int main() { int n; long long sum = 0; cin >> n; for (int i = 1; i <= n; i++) { if (i % 5 != 0 && i % 3 != 0) sum += i; } cout << sum << endl; } //なぜWA?
[["-", 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], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["-", 0, 57, 64, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 107]]
1
65
i = int(input()) fizz=[] for x in range(i): if x % 3 ==0 and x%5==0: continue elif x % 3==0: continue elif x%5==0: continue else: fizz.append(x) print(sum(fizz))
i = int(input()) fizz=[] for x in range(1, i+1): if x % 3 ==0 and x%5==0: continue elif x % 3==0: continue elif x%5==0: continue else: fizz.append(x) print(sum(fizz))
[["+", 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
65
/* Author: Wasi Ur Rahman From RMSTU */ #include <algorithm> #include <array> #include <chrono> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <list> #include <map> #include <set> #include <vector> #define gcd(a, b) __gcd(a, b) #define lcm(a, b) (a * b) / gcd(a, b) #define PI...
/* Author: Wasi Ur Rahman From RMSTU */ #include <algorithm> #include <array> #include <chrono> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <list> #include <map> #include <set> #include <vector> #define gcd(a, b) __gcd(a, b) #define lcm(a, b) (a * b) / gcd(a, b) #define PI...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
166
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; signed main(void) { int n; long long ans; 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> #define rep(i, n) for (int i = 1; i <= (n); i++) using namespace std; signed main(void) { int n; long long ans; cin >> 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]]
1
71
// Catchharsh #include <bits/stdc++.h> #define ll long long int #define ld long double #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
// Catchharsh #include <bits/stdc++.h> #define ll long long int #define ld long double #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
229
#include <bits/stdc++.h> #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl "\n" #define rep(i, n) ...
#include <bits/stdc++.h> #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl "\n" #define rep(i, n) ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
228
n = int(input()) l = [i for i in range(n) if i % 3 != 0 and i % 5 != 0] print(sum(l))
n = int(input()) l = [i for i in range(n+1) if i % 3 != 0 and i % 5 != 0] print(sum(l))
[["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]]
5
39
import sys sys.setrecursionlimit(2147483647) INF=float("inf") MOD=10**9+7 # 998244353 input=lambda:sys.stdin.readline().rstrip() def resolve(): n = int(input()) res = 0 for i in range(1, n): if i % 3 and i % 5: res += i print(res) resolve()
import sys sys.setrecursionlimit(2147483647) INF=float("inf") MOD=10**9+7 # 998244353 input=lambda:sys.stdin.readline().rstrip() def resolve(): n = int(input()) res = 0 for i in range(1, n + 1): if i % 3 and i % 5: res += i print(res) resolve()
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
84
/* _ooOoo_ o8888888o 88" . "88 (| -_- |) O\ = /O ____/`---'\____ .' \\| |// `. / \\||| : |||// \ / _||||| -:- |||||- \ | | \\\ - /// | | ...
/* _ooOoo_ o8888888o 88" . "88 (| -_- |) O\ = /O ____/`---'\____ .' \\| |// `. / \\||| : |||// \ / _||||| -:- |||||- \ | | \\\ - /// | | ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
194
#include <iostream> 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) sum += i; } cout << sum << endl; }
#include <iostream> 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) 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
65
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int ans = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) continue; else ans += i; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long int ans = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) { } else ans += i; } cout << ans << endl; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 7, 8, 9, 0, 57, 64, 116, 0, 117], ["-", 0, 7, 8, 9, 0, 57, 64, 116, 0, 35], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
67
#include <iostream> using namespace std; using ll = long long; int main() { ll a, res = 0; cin >> a; for (ll i = 1; i <= a; i++) { if (i % 3 || i % 5) res += i; } cout << res << endl; return 0; }
#include <iostream> using namespace std; using ll = long long; int main() { ll a, res = 0; cin >> a; for (ll i = 1; i <= a; i++) { if (i % 3 && i % 5) res += i; } cout << res << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
68
#include <bits/stdc++.h> using namespace std; signed main() { int n; cin >> n; unsigned long long sum = 0; for (int i = 0; i < n; i++) { if (i % 3 == 0) continue; if (i % 5 == 0) continue; if (i % 3 == 0 && i % 5 == 0) continue; sum += i; } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; signed main() { int n; cin >> n; unsigned long long sum = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0) continue; if (i % 5 == 0) continue; if (i % 3 == 0 && i % 5 == 0) continue; 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, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
88
#include <bits/stdc++.h> using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; long long sum = 0; for (int i = 1; i < n; ++i) { if (i % 3 && i % 5) sum += i; } cout << sum << "\n"; }
#include <bits/stdc++.h> using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; long long sum = 0; for (int i = 1; i <= n; ++i) { if (i % 3 && i % 5) sum += i; } cout << sum << "\n"; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
84
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int sum = 0, i; for (i = 1; 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; cin >> N; int64_t sum = 0; int i; for (i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35]]
1
67
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long sum = 0; for (int 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() { int n; cin >> n; long long sum = 0; 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, 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
72
#include <bits/stdc++.h> using namespace std; int main() { long long sum = 0; long long N; cin >> N; for (long long i = 1; i < N; i++) { if ((i % 3 == 0) || (i % 5 == 0)) { continue; } sum += i; } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long sum = 0; long long N; cin >> N; for (long long i = 1; i < N + 1; i++) { if ((i % 3 == 0) || (i % 5 == 0)) { continue; } sum += i; } cout << sum << endl; }
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
75
#include <stdio.h> int main() { int s; scanf("%d", &s); int t = 0; for (int i = 1; i <= s; i++) { if (i % 3 == 0 || i % 5 == 0) { t += 0; } else { t += i; } } printf("%d\n", t); }
#include <stdio.h> int main() { int s; scanf("%d", &s); long long t = 0; for (int i = 1; i <= s; i++) { if (i % 3 == 0 || i % 5 == 0) { t += 0; } else { t += i; } } printf("%lld\n", t); }
[["-", 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
79
#include <stdio.h> int main(void) { unsigned int i; unsigned long int sum = 0; unsigned int input; printf("%u", input); for (i = 1; i <= input; i++) { if ((i % 3 != 0) && (i % 5 != 0)) { sum += i; } } printf("%lu", sum); }
#include <stdio.h> int main(void) { unsigned int i; unsigned long int sum = 0; unsigned int input; scanf("%u", &input); for (i = 1; i <= input; i++) { if ((i % 3 != 0) && (i % 5 != 0)) { sum += i; } } printf("%lu", sum); }
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
81
#include <bits/stdc++.h> using namespace std; int main() { unsigned long int n, i = 0; unsigned long int sum = 0; cin >> n; while (n != 0) { i++; if (i % 3 != 0 || i % 5 != 0) sum += i; n--; } cout << sum; }
#include <bits/stdc++.h> using namespace std; int main() { unsigned long int n, i = 0; unsigned long int sum = 0; cin >> n; while (n != 0) { i++; if (i % 3 != 0 && i % 5 != 0) sum += i; n--; } cout << sum; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
68
import java.util.*; public class Main { public static void main(String args[]) { Scanner s = new Scanner(System.in); int n = s.nextInt(); long sum = 0; for (int i = 1; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } System.out.println(sum); } }
import java.util.*; public class Main { public static void main(String args[]) { Scanner s = new Scanner(System.in); int n = s.nextInt(); long sum = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } System.out.println(sum); } }
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
3
94
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long int main() { ios::sync_with_stdio(0); cin.tie(0); ll ans = 0; int n; cin >> n; for (int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } cout << ans << '\n'; }
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long int main() { ios::sync_with_stdio(0); cin.tie(0); ll ans = 0; int n; cin >> n; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } cout << ans << '\n'; }
[["-", 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
86
#include <bits/stdc++.h> using namespace std; bool warenai3(int n) { if (n % 3 != 0) return true; else return false; } bool warenai5(int n) { if (n % 5 != 0) return true; else return false; } int main() { int N; cin >> N; int sum = 0; for (int i = 1; i <= N; i++) { if (warenai3(...
#include <bits/stdc++.h> using namespace std; bool warenai3(int n) { if (n % 3 != 0) return true; else return false; } bool warenai5(int n) { if (n % 5 != 0) return true; else return false; } int main() { int N; cin >> N; long long sum = 0; for (int i = 1; i <= N; i++) { if (war...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
111