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 <stdio.h> int main() { int n, sum = 0; scanf("%d", &n); for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%d", sum); }
#include <stdio.h> int main() { long int n, sum = 0; scanf("%d", &n); for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%ld", sum); }
[["+", 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
70
#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 || i % 5 != 0) ans += i; } cout << ans << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { 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; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
88
#include <bits/stdc++.h> using namespace std; using ll = long long; #define fr(i, n) for (int i = 0; i < (n); ++i) #define Fr(i, n) for (int i = 1; i <= (n); ++i) #define ifr(i, n) for (int i = (n)-1; i >= 0; --i) #define iFr(i, n) for (int i = (n); i > 0; --i) int main(void) { int x; cin >> x; int ans = 0; Fr...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define fr(i, n) for (int i = 0; i < (n); ++i) #define Fr(i, n) for (int i = 1; i <= (n); ++i) #define ifr(i, n) for (int i = (n)-1; i >= 0; --i) #define iFr(i, n) for (int i = (n); i > 0; --i) int main(void) { ll x; cin >> x; ll ans = 0; Fr(i...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
97
#include <iostream> using namespace std; int main(void) { int N; cin >> N; long long sum = 0; for (int i = 0; i < N; i++) { if (((i % 3) == 0) || ((i % 5) == 0)) { ; } else { sum += i; } } cout << sum << endl; return 0; }
#include <iostream> using namespace std; int main(void) { int N; cin >> N; long long sum = 0; for (int i = 1; i <= N; i++) { if (((i % 3) == 0) || ((i % 5) == 0)) { ; } else { 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
83
#include <bits/stdc++.h> using namespace std; int main() { int n; long ans = 0; cin >> n; for (size_t i = 1; i <= n; i++) { if (i % 3 == 0 && i % 5 == 0) ans += i; } cout << ans; }
#include <bits/stdc++.h> using namespace std; int main() { int n; long ans = 0; cin >> n; for (size_t i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } cout << ans; }
[["-", 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
62
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < int(N); ++i) int main() { int64_t N; cin >> N; int64_t sum = 0; rep(i, N) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < int(N); ++i) int main() { int64_t N; cin >> N; int64_t sum = 0; rep(i, N + 1) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << 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
69
N = int(input()) x=0 for i in range(1,1+N): if (N % 3) != 0 and (N % 5) !=0: x = x + i print(x)
N = int(input()) x = 0 for i in range(1, N+1): if (i % 3) != 0 and (i % 5) != 0: x = x+i print(x)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 612], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 15, 679, 31, 666, 0, 23, 0, 657, 31, 22], ["+", 15, 679, 31, 666, 0, 23, 0, 657, 31, 22], ["-", 15, 679, 12, 666, 0, 23, 0, 657, 31, 22...
5
49
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int Sum = 0; for (int i = 1; i <= N; i++) { if (!(i % 3 == 0 || i % 5 == 0 || i % 15 == 0)) { Sum += i; } } ...
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); long Sum = 0; for (int i = 1; i <= N; i++) { if (!(i % 3 == 0 || i % 5 == 0 || i % 15 == 0)) { Sum += i; } }...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
3
105
#include <stdio.h> int main(void) { int n, i; long int a = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (((i % 3) != 0) && ((i % 5) != 0)) a = a + i; } printf("%d", a); return 0; }
#include <stdio.h> int main(void) { int n, i; long int a = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (((i % 3) != 0) && ((i % 5) != 0)) a = a + i; } printf("%ld\n", a); 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
85
#include <bits/stdc++.h> using namespace std; mt19937_64 rng(58); int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; int ans = 0; cin >> n; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) continue; ans += i; } cout << ans << "\n"; }
#include <bits/stdc++.h> using namespace std; mt19937_64 rng(58); int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long n; long long ans = 0; cin >> n; for (long long i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) continue; ans += i; } cout << ans...
[["-", 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
95
#include <stdio.h> int main(void) { int n, i; long int x = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if ((i % 3) != 0 && (i % 5) != 0) x++; } printf("%ld\n", x); return 0; }
#include <stdio.h> int main(void) { int n = 0, i; long int x = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if ((i % 3) != 0 && (i % 5) != 0) x += i; } printf("%ld\n", x); return 0; }
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 57, 64, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 107], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 12, 22]]
0
79
#include <bits/stdc++.h> using namespace std; int main() { long int j; cin >> j; long int ans = 0; for (long int i = 0; i < j; i++) { if (i % 3 != 0 && i % 5 != 0) { ans += i; } else { int unko = 0; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long int j; cin >> j; long int ans = 0; for (long int i = 0; i <= j; i++) { if (i % 3 != 0 && i % 5 != 0) { ans += i; } else { int unko = 0; } } cout << ans << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
77
FizzBizz = int(input()) Sum = [] for i in range(1, FizzBizz): if i % 3 != 0 and i % 5 != 0: Sum.append(i) else: Sum.append(0) print(sum(Sum))
FizzBizz = int(input()) Sum = [] for i in range(1, FizzBizz+1): if i % 3 != 0 and i % 5 != 0: Sum.append(i) else: Sum.append(0) print(sum(Sum))
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
56
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <math.h> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { long long n; cin >> n; long long ans = 0; rep(i, n) { if (i % 3 != 0 && i % 5 != 0) { ans += i; } } cout << a...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <math.h> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { long long n; cin >> n; long long ans = 0; rep(i, n + 1) { if (i % 3 != 0 && i % 5 != 0) { ans += i; } } cout ...
[["+", 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
76
N = int(input()) ans = 0 for i in range(N): if i % 3 == 0 or i % 5 != 0: ans += i print(ans)
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], ["-", 8, 196, 0, 57, 15, 679, 12, 666, 667, 79], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 102], ["+", 8, 196, 0, 57, 64, 196, 0, 674, 0, 675], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95]...
5
39
#include <bits/stdc++.h> using namespace std; void fizzbuzz(int a[], int n) { int i; for (i = 0; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { a[i] = i; } else a[i] = 0; } } int sum(int a[], int n) { int s = 0, i; for (i = 0; i <= n; i++) { s += a[i]; } return s; } int main() ...
#include <bits/stdc++.h> using namespace std; void fizzbuzz(int a[], int n) { int i; for (i = 0; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { a[i] = i; } else a[i] = 0; } } long long int sum(int a[], int n) { long long int s = 0, i; for (i = 0; i <= n; i++) { s += a[i]; } retu...
[["+", 36, 36, 0, 30, 0, 14, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
155
#include <stdio.h> int main(void) { int a; int k = 0; scanf("%d", &a); for (int i = 1; i <= a; i++) { if (i % 3 != 0 || i % 5 != 0) { k += i; } } printf("%d", k); return 0; }
#include <stdio.h> int main(void) { int a; long int k = 0; scanf("%d", &a); for (int i = 1; i <= a; i++) { if (i % 3 != 0 && i % 5 != 0) { k += i; } } printf("%ld", k); return 0; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 98], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
75
# -*- coding: <encoding name> -*- n = int(input()) total = 0 for i in range(1, n + 1): if (i % 3) != 0 and (i % 5) != 0: total = total + 1 print(total)
# -*- coding: <encoding name> -*- 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, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 17, 107], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 12, 22]]
5
50
def main(): N = int(input()) record = [] for i in range(1,N): if i%3==0 or i%5==0: record.append(0) else: record.append(i) print(sum(record)) if __name__=="__main__": main()
def main(): N = int(input()) record = [] for i in range(1,N+1): if i%3==0 or i%5==0: record.append(0) else: record.append(i) print(sum(record)) 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
71
#include <bits/stdc++.h> using namespace std; int main() { int N, S; cin >> N; S = 0; for (int i = 1; i < N + 1; i++) { if (i % 3 != 0 && i % 5 != 0) { S = S + i; } } cout << S << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long int N, S; cin >> N; S = 0; for (int i = 1; i < N + 1; i++) { if (i % 3 != 0 && i % 5 != 0) { S = S + i; } } cout << S << endl; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
71
#include <iostream> using namespace std; int main() { long N, sum = 0; cin >> N; for (long i = 0; i < N; i++) { if (i % 3 == 0 || i % 5 == 0) { } else { sum += i; } } cout << sum << endl; return 0; }
#include <iostream> using namespace std; int main() { long N, sum = 0; cin >> N; for (long i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { } else { 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
71
#include <bits/stdc++.h> using namespace std; int main() { int n, sum; cin >> n; sum = 0; 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; cin >> n; sum = 0; 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]]
1
67
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define REP1(i, n) for (int i = 1; i <= (int)(n); i++) #define all(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) using ll = long long; int main() { int n; cin >> n; ll ans = 0; REP(i, n) { if (i %...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define REP1(i, n) for (int i = 1; i <= (int)(n); i++) #define all(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) using ll = long long; int main() { int n; cin >> n; ll ans = 0; REP1(i, n) { if (i ...
[["-", 0, 14, 8, 9, 0, 14, 49, 53, 49, 22], ["+", 0, 14, 8, 9, 0, 14, 49, 53, 49, 22]]
1
91
#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>; const int INF = 1001001001; int main() { int N; cin >> N; int64_t ans = 0; for (int i = 0; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) { ans += i; } } c...
#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>; const int INF = 1001001001; int main() { int N; cin >> N; int64_t ans = 0; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { ans += 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]]
1
99
#include <iostream> int main() { std::size_t N; std::cin >> N; std::size_t a = 0; for (std::size_t i = 0; i < N; ++i) { if (i % 3 == 0 || i % 5 == 0) { continue; } a += i; } std::cout << a << std::endl; return 0; }
#include <iostream> int main() { std::size_t N; std::cin >> N; std::size_t a = 0; for (std::size_t i = 1; i <= N; ++i) { if (i % 3 == 0 || i % 5 == 0) { continue; } a += i; } std::cout << a << std::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
79
N = int(input()) sum = 0 for i in range(1, N): if i % 3 == 0: pass elif i % 5 == 0: pass else: sum += i print(sum)
N = int(input()) sum = 0 for i in range(1, N+1): #print(i) if i % 3 == 0: pass elif i % 5 == 0: pass else: 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()) a=[0 for i in range(n)] for i in range(n): #0,1, if i%3!=0 and i%5!=0: a[i]=int(i) print(sum(a))
n=int(input()) a=[0 for i in range(n+1)] for i in range(n+1): #0,1,2,3,…n-1,n+1-1:nが3でも5でも割り切れない場合range(n)ではダメ if i%3!=0 and i%5!=0: a[i]=int(i) print(sum(a))
[["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
58
N = int(input()) S =0 for i in range(N): if (i%3==0) and (i%5==0): S = S elif i%3==0: S = S elif i%5==0: S = S else: S = S + i print(S)
N = int(input()) S =0 for i in range(N+1): if (i%3==0) and (i%5==0): S = S elif i%3==0: S = S elif i%5==0: S = S else: S = S + i print(S)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
70
def solve(string): return str(sum(i for i in range(int(string) + 1) if i % 3 > 1 and i % 5 > 1)) if __name__ == '__main__': import sys print(solve(sys.stdin.read().strip()))
def solve(string): return str(sum(i for i in range(int(string) + 1) if i % 3 > 0 and i % 5 > 0)) if __name__ == '__main__': import sys print(solve(sys.stdin.read().strip()))
[["-", 3, 668, 0, 678, 0, 679, 31, 666, 0, 612], ["+", 3, 668, 0, 678, 0, 679, 31, 666, 0, 612], ["-", 3, 668, 0, 678, 0, 679, 12, 666, 0, 612], ["+", 3, 668, 0, 678, 0, 679, 12, 666, 0, 612]]
5
64
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long const int INF = 1000100010; int main() { int n; cin >> n; int ans = 0; rep(i, n) { if ((i +...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long const int INF = 1000100010; int main() { ll n; cin >> n; ll ans = 0; rep(i, n) { if ((i + 1...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
97
// ConsoleApplication1.cpp : Defines the entry point for the console // application. // #include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int input = 0; cin >> input; int sum = 0; for (int i = 1; i <= input; i++) { if (i % 3 == 0) continu...
// ConsoleApplication1.cpp : Defines the entry point for the console // application. // #include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int input = 0; cin >> input; long long sum = 0; for (int i = 1; i <= input; i++) { if (i % 3 == 0) c...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
84
#include <bits/stdc++.h> #include <climits> #include <cmath> using namespace std; int main(void) { long long N; cin >> N; long long ans = 0; for (long long i = 0; i < N; i++) { if (!(i % 5 == 0 || i % 3 == 0)) ans += i; } cout << ans << endl; }
#include <bits/stdc++.h> #include <climits> #include <cmath> using namespace std; int main(void) { long long N; cin >> N; long long ans = 0; for (long long i = 0; i <= N; i++) { if (i % 5 == 0 || i % 3 == 0) continue; ans += i; // cout << i <<endl; } cout << ans << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["-", 0, 57, 15, 339, 51, 91, 28, 23, 0, 24], ["-", 0, 7, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 7, 8, 9, 0, 57, 64, 116, 0, 117], ["+", 0, 7, 8, 9, 0, 57, 64, 116, 0, 35]]
1
75
c = 0 for i in range(int(input())): if (i%3!=0)&(i%5!=0): c += i print(c)
c = 0 for i in range(int(input())+1): if (i%3!=0)&(i%5!=0): c += i print(c)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
40
#include <iostream> #include <math.h> using namespace std; int main() { long long n; long long s = 0; cin >> n; for (long long i = 1; i <= n; i++) { if (n % 5 != 0 && n % 3 != 0) { s += i; } } cout << s; return 0; }
#include <iostream> #include <math.h> using namespace std; int main() { long long n; long long s = 0; cin >> n; for (long long i = 1; i <= n; i++) { if (i % 5 != 0 && i % 3 != 0) { s += i; } } cout << s; return 0; }
[["-", 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
72
N = int(input()) sum = 0 for i in range(1, N+1): if (i%3)*(i%5): sum += 1 print(sum)
N = int(input()) sum = 0 for i in range(1, N+1): if (i%3)*(i%5): sum += i print(sum)
[["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 12, 22]]
5
43
#include <iostream> int main() { int N; std::cin >> N; long long sum = 0; for (int i = 0; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } std::cout << sum << '\n'; return 0; }
#include <iostream> int main() { int N; std::cin >> N; long long sum = 0; for (int i = 0; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } std::cout << sum << '\n'; return 0; }
[["-", 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; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) int main(int argc, char const *argv[]) { int n; cin >> n; ll sum = 0; rep(i, n) { if (i % 3 == 0 && i % 5 == 0) { continue; } else if (i % 3 == 0 || i % 5 == 0) { continue; } el...
#include <iostream> using namespace std; using ll = long long; #define rep(i, n) for (int i = 1; i < (n); i++) int main(int argc, char const *argv[]) { int n; cin >> n; ll sum = 0; rep(i, n + 1) { if (i % 3 == 0 && i % 5 == 0) { continue; } else if (i % 3 == 0 || i % 5 == 0) { continue; ...
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 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
108
N = int(input()) ans = 0 for i in range(N): if((i%3 != 0) & (i%5 != 0)): ans += i print(ans)
N = int(input()) ans = 0 for i in range(1, N+1): if((i%3 != 0) & (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
45
import java.util.Scanner; public class Main { public static void main(String[] args) { final Scanner sc = new Scanner(System.in); final int n = sc.nextInt(); long ans = 0; for (int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } System.out.println(ans); } }...
import java.util.Scanner; public class Main { public static void main(String[] args) { final Scanner sc = new Scanner(System.in); final int n = sc.nextInt(); long ans = 0; for (int i = 0; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } System.out.println(ans); } ...
[["-", 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; using ll = long long; using ld = long double; using Vec = vector<int>; int main() { int n; cin >> n; int ans = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { ans = ans + i; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using Vec = vector<int>; int main() { int n; cin >> n; ll ans = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { ans = ans + i; } } cout << ans << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
88
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> #define CHMAX(a, b) a = std::max(a, b) #define CHMIN(a, b) a = std::min(a, b) #define MAXMIN(a, b, c) std::max(a, min(b, c)) #define ...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> #define CHMAX(a, b) a = std::max(a, b) #define CHMIN(a, b) a = std::min(a, b) #define MAXMIN(a, b, c) std::max(a, min(b, c)) #define ...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45]]
1
261
package main import "fmt" func main() { var n int fmt.Scan(&n) var sum int for i := 1; i <= n; i++{ if i % 3 == 0 || i % 5 == 0{ sum += i } } fmt.Println(sum) }
package main import "fmt" func main() { var n int fmt.Scan(&n) var sum int for i := 1; i <= n; i++{ if i % 3 == 0 || i % 5 == 0{ continue } sum += i } fmt.Println(sum) }
[["+", 8, 196, 0, 57, 64, 196, 0, 116, 0, 117], ["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 165], ["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 46], ["+", 0, 435, 8, 196, 0, 7, 8, 196, 0, 165], ["-", 0, 7, 8, 196, 0, 57, 64, 196, 0, 165], ["-", 0, 7, 8, 196, 0, 57, 64, 196, 0, 46]]
7
71
#include <bits/stdc++.h> using namespace std; int main() { long long n; long long i = 0; long long sum = 0; cin >> n; while (i < n) { if (i % 3 != 0 && i % 5 != 0) sum += i; i++; } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main(void) { long long n; long long i = 0; long long sum = 0; cin >> n; while (i <= n) { if (i % 3 != 0 && i % 5 != 0) sum += i; i++; } cout << sum << endl; }
[["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19]]
1
67
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int N; cin >> N; int sum = 0; rep(i, N + 1) { if ((i % 3 == 0) || (i % 5 == 0)) { continue; } else { sum += i; } } cout << sum; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int64_t N; cin >> N; int64_t sum = 0; rep(i, N + 1) { if ((i % 3 == 0) || (i % 5 == 0)) { continue; } else { sum += i; } } cout << sum; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
76
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long ans = 0; for (int i = 0; i < n; i++) { int x = i; if (x % 3 != 0 && x % 5 != 0) ans += x; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long ans = 0; for (int i = 0; i <= n; i++) { int x = i; if (x % 3 != 0 && x % 5 != 0) ans += x; } cout << ans << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
70
num = (int)(input()) fb = [] for i in range(num): if i % 3 != 0 and i % 5 != 0: fb.append(i) print(sum(fb))
num = (int)(input()) fb = [] for i in range(1, num + 1): if i % 3 != 0 and i % 5 != 0: fb.append(i) print(sum(fb))
[["+", 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
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; long long res = 0; for (int i = 0; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) { res += i; } } cout << res << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; long long res = 0; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { res += i; } } cout << res << 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
71
#include <iostream> using namespace std; int main() { long long N, sum = 0; cin >> N; for (int i = 0; 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, 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; }
[["-", 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 <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define EPS (1e-7) #define INF (1e...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define EPS (1e-7) #define INF (1e...
[["-", 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
277
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int c = sc.nextInt(); int sum = 0; int sum1 = 0; for (int i = 1; i <= c; i++) { sum += i; if (i % 3 == 0 || i % 5 == 0) { sum1 += i; } } System.o...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int c = sc.nextInt(); long sum = 0; long sum1 = 0; for (int i = 1; i <= c; i++) { sum += i; if (i % 3 == 0 || i % 5 == 0) { sum1 += i; } } System...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
3
105
#include <bits/stdc++.h> using namespace std; int main() { int64_t n, sum = 0; cin >> n; for (int64_t 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() { int64_t n, sum = 0; cin >> n; for (int64_t 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, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
61
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long n = scan.nextInt(); long out = 0; for (long i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) { out += i; } } System.out.println(out); } }
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long n = scan.nextInt(); long out = 0; for (long i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { out += i; } } System.out.println(out); } }
[["-", 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
94
N = int(input()) ans = 0 for i in range(1, N): if i % 3 == 0 or i % 5 == 0: continue ans += i print(ans)
N = int(input()) ans = 0 for i in range(1, N+1): if (i % 3 == 0) or (i % 5 == 0): continue ans += i print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 8, 196, 0, 57, 15, 679, 31, 23, 0, 24], ["+", 8, 196, 0, 57, 15, 679, 31, 23, 0, 25], ["+", 8, 196, 0, 57, 15, 679, 12, 23, 0, 24], ["+", 8, 196, 0, 57, 15, 679, 12, 23, 0, 25]]
5
42
#include <algorithm> #include <cmath> #include <iostream> #include <set> #include <string> #include <vector> 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) { // cout << "FizzBuzz" << endl; } else if (i % 3 == 0) { ...
#include <algorithm> #include <cmath> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; int main() { long long N; cin >> N; long long sum = 0; for (int i = 1; i <= N; i++) { if (i % 3 == 0 && i % 5 == 0) { // cout << "FizzBuzz" << endl; } else if (i % 3...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
104
#include <iostream> using namespace std; int main() { long long int N; cin >> N; int sum = 0; for (int i = 1; i <= N; i++) { if (i % 3 == 0 && i % 5 == 0) { // FizzBuzz } else if (i % 3 == 0) { // Fizz } else if (i % 5 == 0) { // Buzz } else { //そのほか sum = sum + ...
#include <iostream> using namespace std; int main() { long long N; cin >> N; long long sum = 0; for (int i = 1; i <= N; i++) { if (i % 3 == 0 && i % 5 == 0) { } else if (i % 3 == 0) { } else if (i % 5 == 0) { } else { sum = sum + i; } } cout << sum << endl; }
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
99
a=0 for i in range(int(input())): if i%15==0: continue elif i%3==0: continue elif i%5==0: continue else: a+=i print(a)
a=0 for i in range(int(input())+1): if i%15==0: continue elif i%3==0: continue elif i%5==0: continue else: a+=i print(a)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
49
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); i++) #define INF 1001001001 #define LLINF 1001001001001001001 #define MOD 1000000007 template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a,...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); i++) #define INF 1001001001 #define LLINF 1001001001001001001 #define MOD 1000000007 template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a,...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
165
#include <bits/stdc++.h> #define tt this-> #define ll long long using namespace std; int main() { long long x, sum = 0; cin >> x; for (int i = 0; i < x; i++) { if (i % 3 != 0 && i % 5 != 0) sum = sum + i; } cout << sum; return 0; } /* ▀█████████▄ ▄████████ ▄████████ ▄████████ ███ █...
#include <bits/stdc++.h> #define tt this-> #define ll long long using namespace std; int main() { long long x, sum = 0; cin >> x; for (int i = 0; i <= x; i++) { if (i % 3 != 0 && i % 5 != 0) sum = sum + i; } cout << sum; return 0; } /* ▀█████████▄ ▄████████ ▄████████ ▄████████ ███ ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
74
N = int(input().split()) print(sum([n + 1 for n in range(N) if (n + 1) % 3 != 0 and (n + 1) % 5 != 0]))
N = int(input()) print(sum([n + 1 for n in range(N) if (n + 1) % 3 != 0 and (n + 1) % 5 != 0]))
[["-", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["-", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
50
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long a = sc.nextLong(), x = 0; long b = a / 15; long c = a / 5; long d = a / 3; for (int i = 1; i < a; i++) { if (i % 3 == 0) continue; if (i % 5 == 0) ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long a = sc.nextLong(), x = 0; long b = a / 15; long c = a / 5; long d = a / 3; for (int i = 1; i <= a; i++) { if (i % 3 == 0) continue; if (i % 5 == 0) ...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
3
118
a=int(input()) ans=0 for i in range(a): if not i%3==0 and not i%5==0: ans+=i print(ans)
a=int(input()) ans=0 for i in range(1,a+1): if not i%3==0 and not 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
41
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; int s = 0; for (int i = 1; i <= a; i++) { if (i % 3 != 0) { if (i % 5 != 0) s += i; } } cout << s; }
#include <bits/stdc++.h> using namespace std; int main() { long long a; cin >> a; long long s = 0; for (int i = 1; i <= a; i++) { if (i % 3 != 0) { if (i % 5 != 0) s += i; } } cout << s; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
66
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = array<ll, 3>; template <class T> using p...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = array<ll, 3>; template <class T> using p...
[["+", 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
3,844
#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 (n % 3 == 0) continue; if (n % 5 == 0) continue; ans += i; } co...
#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; } co...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22]]
1
85
#include <stdio.h> int main(void) { int N, i, total = 0; scanf("%d", &N); for (i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { continue; } else { total += i; } } printf("%d\n", total); return 0; }
#include <stdio.h> int main(void) { long N, i, total = 0; scanf("%ld", &N); for (i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { continue; } else { total += i; } } printf("%ld\n", total); return 0; }
[["-", 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
81
#include <stdio.h> int main() { long long n, sum = 0; scanf("%lld", &n); for (int i = 1; i < n; i++) { if (i % 3 && i % 5) { sum += i; } } printf("%lld", sum); return 0; }
#include <stdio.h> int main() { long long n, sum = 0; scanf("%lld", &n); for (int i = 1; i <= n; i++) { if (i % 3 && i % 5) { sum += i; } } printf("%lld", sum); return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
0
70
n = int(input()) print(sum(i for i in range(i, n + 1) if i % 3 and i % 5))
n = int(input()) print(sum(i for i in range(1, n + 1) if i % 3 and i % 5))
[["-", 3, 668, 0, 659, 12, 652, 3, 4, 0, 22], ["+", 3, 668, 0, 659, 12, 652, 3, 4, 0, 612]]
5
34
import sys n = int(sys.stdin) print(sum(i for i in range(1, n + 1) if i % 3 and i % 5))
import sys n = int(sys.stdin.read()) print(sum(i for i in range(1, n + 1) if i % 3 and i % 5))
[["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
36
#include <stdio.h> int main() { int i, n; long long a = 0; scanf("%d", &n); for (i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) a = a + i; } printf("%lld\n", a); return 0; }
#include <stdio.h> int main() { int i, n; long long a = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) a = a + i; } printf("%lld\n", a); 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
77
#include <iostream> using namespace std; int main() { int n, i, cnt = 0; cin >> n; for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { cnt += i; } } cout << cnt << endl; }
#include <iostream> using namespace std; int main() { long long n, i, cnt = 0; cin >> n; for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { cnt += i; } } cout << cnt << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
66
n = int(input()) count = 0 for i in range(n): if i % 3 > 0 and i % 5 > 0: count += i print(count)
n = int(input()) count = 0 for i in range(n + 1): if i % 3 > 0 and 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
39
#include <stdio.h> int main() { int n; long long ans = 0; scanf("%d", &n); for (int i = 0; i <= n; i++) if ((!i % 3 == 0) && (!i % 5 == 0)) ans += i; printf("%ld\n", ans); }
#include <stdio.h> int main() { int n; long long ans = 0; scanf("%d", &n); for (int i = 0; i <= n; i++) if ((i % 3 != 0) && (i % 5 != 0)) ans += i; printf("%ld\n", ans); }
[["-", 31, 23, 0, 16, 31, 16, 31, 91, 17, 111], ["-", 15, 23, 0, 16, 31, 23, 0, 16, 17, 60], ["+", 15, 23, 0, 16, 31, 23, 0, 16, 17, 79], ["-", 12, 23, 0, 16, 31, 16, 31, 91, 17, 111], ["-", 15, 23, 0, 16, 12, 23, 0, 16, 17, 60], ["+", 15, 23, 0, 16, 12, 23, 0, 16, 17, 79]]
0
75
n=int(input()) num=0 for i in range(n): if (i%3!=0) and (i%5!=0): num+=i print(num)
n=int(input()) num=0 for i in range(1,n+1): if (i%3!=0) and (i%5!=0): num+=i print(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
43
import numpy as np N = int(input()) ans = 0 for i in range(N): if ((i % 3) != 0) & ((i % 5) != 0): ans += i print(ans)
import numpy as np N = int(input()) ans = 0 for i in range(1, N + 1): if ((i % 3) != 0) & ((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
51
#include <math.h> #include <stdio.h> #include <string.h> int n, ans = 0; int main(void) { scanf("%d", &n); for (int i = 1; i <= n; i++) { if (i % 5 != 0) { if (i % 3 != 0) { ans = ans + i; } } } printf("%d\n", ans); }
#include <math.h> #include <stdio.h> #include <string.h> long long n, ans = 0; int main(void) { scanf("%lld", &n); for (int i = 1; i <= n; i++) { if (i % 5 != 0) { if (i % 3 != 0) { ans = ans + i; } } } printf("%lld\n", ans); }
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 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
82
#include <bits/stdc++.h> using namespace std; int main() { long long a, ans = 0; cin >> a; for (int i = 1; i <= a; i++) { if (i % 3 != 0 || i % 5 != 0) { ans += i; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long a, ans = 0; cin >> a; for (int i = 1; i <= a; i++) { if (i % 3 != 0 && i % 5 != 0) { ans += i; } } cout << ans << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
66
n = int(input()) a=0 for i in range(1, n+1): if i%3!=0 and i%5!=0: a=a+i print(i)
n = int(input()) a=0 for i in range(1, n+1): if i%3!=0 and i%5!=0: a=a+i print(a)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
45
n=int(input()) a=[] for i in range(n): if i%3!=0 and i%5!=0: a.append(i) print(sum(a))
n=int(input()) a=[] for i in range(1,n+1): if i%3!=0 and i%5!=0: a.append(i) 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
46
package main import "fmt" func main() { var N int fmt.Scan(&N) answer := int64(0) for i := 0; i < N; i++ { if i%3 != 0 && i%5 != 0 { answer += int64(i) } } fmt.Println(answer) }
package main import "fmt" func main() { var N int fmt.Scan(&N) answer := int64(0) for i := 1; i <= N; i++ { if i%3 != 0 && i%5 != 0 { answer += int64(i) } } fmt.Println(answer) }
[["-", 0, 7, 0, 430, 10, 431, 12, 432, 0, 433], ["+", 0, 7, 0, 430, 10, 431, 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
77
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int result = 0; for (int i = 1; i <= x; i++) { if (x % 3 == 0 && x % 5 == 0) { continue; } if (x % 3 == 0) { continue; ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); long result = 0; for (int i = 1; i <= x; i++) { if (i % 3 == 0 && i % 5 == 0) { continue; } if (i % 3 == 0) { continue; ...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 15, 15, 0, 16, 31, 16, 31, 16, 31, 22], ["+", 15, 15, 0, 16, 31, 16, 31, 16, 31, 22], ["-", 15, 15, 0, 16, 12, 16, 31, 16, 31, 22], ["+", 15, 15, 0, 16, 12, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 15, 0, 16, 31, 16, 31, ...
3
120
#include <algorithm> #include <iostream> #include <string> #include <vector> 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) continue; sum += i; } cout << sum << endl; return 0; }
#include <algorithm> #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++) { if (i % 3 == 0 || i % 5 == 0) continue; 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]]
1
75
#include <stdio.h> int main() { int i, n; long long int sum = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) sum = sum + i; } printf("%ld", sum); return 0; }
#include <stdio.h> int main() { int i, n; long long int sum = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) sum = sum + i; } printf("%lld", sum); return 0; }
[["-", 0, 57, 15, 23, 0, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 17, 79], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 98], ["-", 0, 57, 15, 23, 0, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 79], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, ...
0
77
#include <stdio.h> int main(void) { int a, i; int count = 0; scanf("%d", &a); for (i = 0; i < a; i++) { if ((i + 1) % 3 == 0 || (i + 1) % 5 == 0) count += 0; else count += i + 1; } printf("%ld\n", count); return 0; }
#include <stdio.h> int main(void) { int a, i; long count = 0; scanf("%d", &a); for (i = 0; i < a; i++) { if ((i + 1) % 3 == 0 || (i + 1) % 5 == 0) count += 0; else count += i + 1; } printf("%ld\n", count); return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
0
90
#include <stdio.h> int main(void) { int N, i, sum = 0; scanf("%d", &N); for (i = 1; i < N + 1; i++) { if (i % 3 != 0 && i % 5 != 0) { sum = sum + i; } } printf("%d", sum); return 0; }
#include <stdio.h> int main(void) { int N, i; long sum = 0; scanf("%d", &N); for (i = 1; i < N + 1; i++) { if (i % 3 != 0 && i % 5 != 0) { sum = sum + i; } } printf("%ld", 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
79
#include <stdio.h> int main(void) { int n, i, sam = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) sam += i; } printf("%d", sam); return 0; }
#include <stdio.h> int main(void) { int n, i; long sam = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) sam += i; } printf("%ld", sam); 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
73
#include <stdio.h> int main(void) { int x, i; long int sum = 0; scanf("%d", &x); int num[x]; for (i = 0; i < x; i++) { num[i] = i + 1; } for (i = 0; i < x; i++) { if (num[i] % 3 == 0 || num[i] % 5 == 0) num[i] = 0; } for (i = 0; i < x; i++) { sum += num[i]; } printf("%10d", sum);...
#include <stdio.h> int main(void) { int x, i; long int sum = 0; scanf("%d", &x); int num[x]; for (i = 0; i < x; i++) { num[i] = i + 1; } for (i = 0; i < x; i++) { if (num[i] % 3 == 0 || num[i] % 5 == 0) num[i] = 0; } for (i = 0; i < x; i++) { sum += num[i]; } printf("%10ld", sum)...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
136
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(void) { int n; cin >> n; unsigned int cnt = 0; rep(i, n + 1) { if (i % 3 != 0 && i % 5 != 0) { cnt += i; } } cout << cnt << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(void) { int n; cin >> n; long cnt = 0; rep(i, n + 1) { if (i % 3 != 0 && i % 5 != 0) { cnt += i; } } cout << cnt << endl; }
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["-", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
71
#include <stdio.h> int main() { int n, i; int flag = 0; long int sum = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 == 0) flag = 1; else if (i % 5 == 0) flag = 1; if (flag == 0) sum = sum + i; flag = 0; } printf("%d", sum); return 0; }
#include <stdio.h> int main() { int n, i; int flag = 0; long int sum = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 == 0) flag = 1; else if (i % 5 == 0) flag = 1; if (flag == 0) sum = sum + i; flag = 0; } printf("%ld", sum); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
102
#include <stdio.h> int main(void) { int n; int i; long int sum = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum = sum + i; } } printf("%d\n", sum); return 0; }
#include <stdio.h> int main(void) { int n; int i; long sum = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum = sum + i; } } printf("%ld\n", sum); return 0; }
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
81
#include <stdio.h> void main(void) { int n, i, a, b, total; total = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { a = i % 3; b = i % 5; if (a != 0 || b != 0) { total = total + i; } } printf("%d", total); }
#include <stdio.h> void main(void) { int n, i, a, b; long int total; total = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { a = i % 3; b = i % 5; if (a != 0 && b != 0) { total = total + i; } } printf("%ld", total); }
[["-", 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, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 98], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5...
0
88
#include <stdio.h> int main() { int n, sum = 0; scanf("%d", &n); for (int i = 1; i <= n; i++) { if ((i % 3) != 0 && (i % 5) != 0) sum += i; } printf("%d", sum); return 0; }
#include <stdio.h> int main() { int n; long int sum = 0; scanf("%d", &n); for (int i = 1; i <= n; i++) { if ((i % 3) != 0 && (i % 5) != 0) sum += i; } printf("%ld", 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, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
75
#include <stdio.h> int main(void) { int n, i; int a = 0; scanf("%d", &n); for (i = 0; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) a += i; } printf("%d", a); return 0; }
#include <stdio.h> int main(void) { int n, i; long a = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) a += i; } printf("%ld\n", a); 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, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 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
74
#include <stdio.h> main(void) { int x; int i; long int total = 0; scanf("%d", &x); for (i = 1; i <= x; i++) { if (i % 3 != 0 && i % 5 != 0) total += i; } printf("%d", total); return 0; }
#include <stdio.h> main(void) { int x; int i; long int total = 0; scanf("%d", &x); for (i = 1; i <= x; i++) { if (i % 3 != 0 && i % 5 != 0) total += i; } printf("%ld", total); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
75
#include <stdio.h> int main(void) { long int N; long int sum = 0; scanf("%ld", &N); for (int i = 0; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%ld", sum); return 0; }
#include <stdio.h> int main(void) { long int N; long int sum = 0; scanf("%ld", &N); for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%ld", sum); 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]]
0
77
#include <stdio.h> int main(void) { long num = 0; int x; scanf("%d", &x); for (long i = 1; i <= x; i++) { if (i % 3 != 0 && i % 5 != 0) num = num + i; } printf("%u", num); return 0; }
#include <stdio.h> int main(void) { long num = 0; int x; scanf("%d", &x); for (long i = 1; i <= x; i++) { if (i % 3 != 0 && i % 5 != 0) num = num + i; } printf("%lu", num); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
75
#include <cstdio> #include <iostream> #include <vector> using namespace std; int main(void) { int N; scanf("%d", &N); int ans = 0; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } printf("%d", ans); return 0; }
#include <cstdio> #include <iostream> #include <vector> using namespace std; int main(void) { int N; scanf("%d", &N); long long ans = 0; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } printf("%lld", ans); return 0; }
[["-", 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]]
1
81
#include <bits/stdc++.h> using namespace std; typedef long long ll; const long long INF = 1LL << 60; ll GCD(ll x, ll y) { if (y == 0) return x; else return GCD(y, x % y); } ll LCM(ll a, ll b) { return a / GCD(a, b) * b; } const int MOD = 1000000007; int main() { int n; cin >> n; ll total = 0; fo...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const long long INF = 1LL << 60; ll GCD(ll x, ll y) { if (y == 0) return x; else return GCD(y, x % y); } ll LCM(ll a, ll b) { return a / GCD(a, b) * b; } const int MOD = 1000000007; int main() { int n; cin >> n; ll total = 0; fo...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
136
#include <bits/stdc++.h> #include <vector> using namespace std; int main() { int N; cin >> N; uint64_t out = 0; for (int i = 0; i < N; i++) { int no = i; if ((no % 3 == 0) && (no % 5 == 0)) { out += 0; } else if ((no % 3 == 0) && (no % 5 != 0)) { out += 0; } else if ((no % 3 != 0)...
#include <bits/stdc++.h> #include <vector> using namespace std; int main() { int N; cin >> N; uint64_t out = 0; for (int i = 1; i <= N; i++) { int no = i; if ((no % 3 == 0) && (no % 5 == 0)) { out += 0; } else if ((no % 3 == 0) && (no % 5 != 0)) { out += 0; } else if ((no % 3 != 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
138
#include <bits/stdc++.h> using namespace std; int main() { /* A int n; cin >> n; bool check = false; for(int i=0;i<3;i++){ if(n%10 == 7)check = true; n/=10; } cout << ((check)? "Yes": "No") << endl;*/ int n; cin >> n; int ans = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && ...
#include <bits/stdc++.h> using namespace std; int main() { /* A int n; cin >> n; bool check = false; for(int i=0;i<3;i++){ if(n%10 == 7)check = true; n/=10; } cout << ((check)? "Yes": "No") << endl;*/ int64_t n; cin >> n; int64_t ans = 0; for (int i = 1; i <= n; i++) { if (i % 3 ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
68
// #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; // for loop関係 #define rep(i, a, n) for (int i = (a); i < (n); ++i) #define repe(i, a, n) fo...
// #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; // for loop関係 #define rep(i, a, n) for (int i = (a); i < (n); ++i) #define repe(i, a, n) fo...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
336