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
#coding:utf-8 N=int(input()) fizz_buzz=list() for i in range(1,N): if i%3==0 and i%5==0: fizz_buzz.append(0) elif i%3==0: fizz_buzz.append(0) elif i%5==0: fizz_buzz.append(0) else: fizz_buzz.append(i) print(sum(fizz_buzz))
#coding:utf-8 N=int(input()) fizz_buzz=list() for i in range(1,N+1): if i%3==0 and i%5==0: fizz_buzz.append(0) elif i%3==0: fizz_buzz.append(0) elif i%5==0: fizz_buzz.append(0) else: fizz_buzz.append(i) print(sum(fizz_buzz))
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
84
#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 = sum + i; } } cout << sum; }
#include <bits/stdc++.h> using namespace std; 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 = sum + i; } } cout << sum; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
65
n = int(input()) lst = list(range(n)) ans = 0 for i in range(len(lst)): if lst[i] % 3 != 0 and lst[i] % 5 != 0: ans += lst[i] print(ans)
n = int(input()) lst = list(range(n+1)) ans = 0 for i in range(len(lst)): if lst[i] % 3 != 0 and lst[i] % 5 != 0: ans += lst[i] print(ans)
[["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
60
<?php fscanf(STDIN, "%d", $N); $ans = 0; for($i=0; $i<$N ;$i++){ if($i % 3 == 0 || $i % 5 == 0){ continue; }else{ $ans += $i; } } echo $ans; ?>
<?php fscanf(STDIN, "%d", $N); $ans = 0; for($i=1; $i<=$N ;$i++){ if($i % 3 == 0 || $i % 5 == 0){ continue; }else{ $ans += $i; } } echo $ans; ?>
[["-", 36, 36, 0, 493, 0, 7, 0, 11, 12, 612], ["+", 36, 36, 0, 493, 0, 7, 0, 11, 12, 612], ["-", 36, 36, 0, 493, 0, 7, 0, 16, 17, 18], ["+", 36, 36, 0, 493, 0, 7, 0, 16, 17, 19]]
6
71
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); List<Integer> list = new ArrayList<>(); for (int i = 0; i < n; i++) { if (i % 3 == 0) { ...
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); List<Integer> list = new ArrayList<>(); for (int i = 1; i <= n; i++) { if (i % 3 == 0) { ...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
3
149
n = input() ans = 0 for i in range(0, int(n)): r3 = i % 3 r5 = i % 5 if not (((r3 == 0) and (r5 == 0)) or (r3 == 0) or (r5 == 0)): ans += i print(ans)
n = input() ans = 0 for i in range(0, int(n) + 1): r3 = i % 3 r5 = i % 5 if not (((r3 == 0) and (r5 == 0)) or (r3 == 0) or (r5 == 0)): 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
68
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin >> n; int64_t ans = 0; for (int i = 0; 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() { int64_t 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; }
[["-", 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
66
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int csum = 0; for (int i = 0; i < N;) { i++; int wari; wari = 0; wari = (i % 3) * (i % 5); if (wari > 0) { csum = csum + i; } } cout << csum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long int csum = 0; for (int i = 0; i < N;) { i++; int wari; wari = 0; wari = (i % 3) * (i % 5); if (wari > 0) { csum = csum + i; } } cout << csum << endl; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
82
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; using vec = vector<ll>; using vect = vector<double>; using Graph = vector<vector<ll>>; #define loop(i, n) for (ll i = 0; i < n; i++) #define Loop(i, m, n) for (ll i = m; i < n; i++) #define pool(i, n) for (ll i = n; i >= 0; i--) ...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; using vec = vector<ll>; using vect = vector<double>; using Graph = vector<vector<ll>>; #define loop(i, n) for (ll i = 0; i < n; i++) #define Loop(i, m, n) for (ll i = m; i < n; i++) #define pool(i, n) for (ll i = n; i >= 0; i--) ...
[["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 21], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 3, 4, 0, 69, 341, 342, 0, 16, 17, 33], ["-", 3, 4, 0, 69, 341, 342, 0, 16, 12, 13]]
1
759
N = input() N = int(N) num = 0 for i in range(N): if i % 5 != 0 and i % 3 != 0 and i % 15 != 0: num += i #f = i #print(f) print(num)
N = input() N = int(N) num = 0 for i in range(1,N+1): if i % 5 != 0 and i % 3 != 0 and i % 15 != 0: num += i #f = i #print(f) 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
50
N=int(input()) sum=0 for i in range(N): if(i%3==0 or i%5==0): continue else: sum+=i print(sum)
N=int(input())+1 sum=0 for i in range(1,N): if(i%3==0 or i%5==0): continue else: sum+=i print(sum)
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
44
#include <iostream> #include <stdlib.h> using namespace std; int main(void) { long long int n, sum; cin >> n; sum = 0; for (long long int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; return 0; }
#include <iostream> #include <stdlib.h> using namespace std; int main(void) { long long int n, sum; cin >> n; sum = 0; for (long long int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; return 0; }
[["-", 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 <stdio.h> int main() { int N, i; scanf("%d", &N); unsigned int S; S = 0; for (i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { S = S; } else { S = S + i; } } printf("%u", S); return 0; }
#include <stdio.h> int main() { int N, i; scanf("%d", &N); long int S; S = 0; for (i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { S = S; } else { S = S + i; } } printf("%ld", S); return 0; }
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["+", 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
87
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<long long> vll; typedef vector<pair<int, int>> vp; typedef pair<int, int> pii; #define INF (int)(1e9) #define MAXX 1.1529215e+18 #define inf 999999 #define EPS (1e-7) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, n)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<long long> vll; typedef vector<pair<int, int>> vp; typedef pair<int, int> pii; #define INF (int)(1e9) #define MAXX 1.1529215e+18 #define inf 999999 #define EPS (1e-7) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, n)...
[["-", 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
310
#include <bits/stdc++.h> using namespace std; int main() { long N, i, result; result = 0; cin >> N; for (i = 0; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) { result += i; } } cout << result << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long N, i, result; result = 0; cin >> N; for (i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { result += i; } } cout << result << endl; }
[["-", 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
68
N = int(input()) a = list() for i in range(1,N): if i % 3 == 0: continue if i % 5 == 0: continue else: a.append(i) # print(a) print(sum(a))
N = int(input()) a = list() for i in range(1,N+1): # print(i) if i % 3 == 0: continue if i % 5 == 0: continue else: a.append(i) # print(a) print(sum(a))
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
55
#include <iostream> using namespace std; int main() { int64_t N; cin >> N; int64_t sum; for (int64_t i = 0; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } else { continue; } } cout << sum << endl; }
#include <iostream> using namespace std; int main() { int64_t N; cin >> N; int64_t sum = 0; for (int64_t i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } else { continue; } } cout << sum << endl; }
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
69
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; void ABC162B() { int N; cin >> N; ll sum = 0; for (int i = 0; i < N; ++i) { if (i % 5 != 0 && i % 3 != 0) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; void ABC162B() { int N; cin >> N; ll sum = 0; for (int i = 1; i <= N; ++i) { if (i % 5 != 0 && i % 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], ["+", 64, 9, 0, 1, 0, 11, 12, 74, 0, 24], ["+", 0, 1, 0, 11, 12, 74, 39, 77, 39, 78], ["+", 64, 9, 0, 1, 0, 11, 12, 74, 0, 25]]
1
124
#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) ans += i; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long int N; cin >> N; long long int 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, 43, 39, 86, 0, 96]]
1
64
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ll n, s = 0; cin >> n; for (ll i = 1; i < n; i++) { if (!(i % 3 == 0 || i % 5 == 0)) s += i; } cout << s << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ll n, s = 0; cin >> n; for (ll i = 1; i <= n; i++) { if (!(i % 3 == 0 || i % 5 == 0)) s += i; } cout << s << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
75
package main import "fmt" func main() { var N int fmt.Scan(&N) var res int64 for i := 0; i < N; i++ { if i%3 == 0 || i%5 == 0 { continue } res = res + int64(i) } fmt.Println(res) }
package main import "fmt" func main() { var N int fmt.Scan(&N) var res int64 for i := 1; i <= N; i++ { if i%3 == 0 || i%5 == 0 { continue } res = res + int64(i) } fmt.Println(res) }
[["-", 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
78
N = int(input()) n_list = [0 if (n % 15 == 0 or n % 3 == 0 or n % 5 == 0) else n for n in range(1,N)] print(sum(n_list))
N = int(input()) n_list = [0 if (n % 15 == 0 or n % 3 == 0 or n % 5 == 0) else n for n in range(1,N+1)] print(sum(n_list))
[["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]]
5
51
#include <iostream> using namespace std; int main() { long long int N, i; cin >> N; int sum = 0; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum = sum + i; } } cout << sum; return 0; }
#include <iostream> using namespace std; int main() { long long int N, i; cin >> N; long long int sum = 0; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { sum = sum + i; } } cout << sum; return 0; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
73
#include <iostream> using namespace std; int main(void) { int N; cin >> N; int ans = 0; for (int i = 1; i <= N; i++) { // 3かつ5で割り切れる if ((i % 3) && (i % 5)) { ans += i; } } cout << ans << endl; }
#include <iostream> using namespace std; int main(void) { int N; cin >> N; long ans = 0; for (int i = 1; i <= N; i++) { // 3かつ5で割り切れない if ((i % 3) && (i % 5)) { 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
68
//============================================================================ // Name : template.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <...
//============================================================================ // Name : template.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <...
[["-", 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, 25, 0, 35]]
1
215
def main(): N = int(input()) sum = 0 for i in range(N): if i % 3 == 0: continue if i % 5 == 0: continue else: sum += i print(sum) main()
def main(): N = int(input()) sum = 0 for i in range(N+1): if i % 3 == 0: continue if i % 5 == 0: continue else: sum += i print(sum) main()
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
52
#include <algorithm> #include <iostream> #include <string> #include <vector> using ll = long long; using namespace std; int main() { int n; cin >> n; ll total = 0; for (int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) total += i; } cout << total << endl; return 0; }
#include <algorithm> #include <iostream> #include <string> #include <vector> using ll = long long; using namespace std; int main() { int n; cin >> n; ll total = 0; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) total += i; } cout << total << 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
#include <bits/stdc++.h> using namespace std; int main() { long long N, ans = 0; cin >> N; for (int i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { ans += i; // cout<<i<<endl; } } cout << ans; }
#include <bits/stdc++.h> using namespace std; int main() { long long N, ans = 0; cin >> N; for (int i = 1; i <= N; i++) { if (!(i % 3 == 0 || i % 5 == 0)) { ans += i; // cout<<i<<endl; } } cout << ans; }
[["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 0, 57, 15, 339, 51, 91, 28, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 91, 28, 23, 0, 25]]
1
65
#include <stdio.h> int main() { long long int n, a, b, c, d; scanf("%lld", &n); a = n * (n + 1) / 2; c = n / 3 * (1 + n / 3) * 3 / 2; d = n / 5 * (1 + n / 5) * 5 / 2; b = n / 15 * (1 + n / 15) * 5 / 2; printf("%lld\n", a + b - c - d); return 0; }
#include <stdio.h> int main() { long long int n, a, b, c, d; scanf("%lld", &n); a = n * (n + 1) / 2; c = n / 3 * (1 + n / 3) * 3 / 2; d = n / 5 * (1 + n / 5) * 5 / 2; b = n / 15 * (1 + n / 15) * 15 / 2; printf("%lld\n", a + b - c - d); return 0; }
[["-", 0, 1, 0, 11, 12, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 13]]
0
116
#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; } if (i % 3 == 0) { continue; } if (i % 5 == 0) { continue; } ans += i; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; long long ans = 0; for (long long i = 1; i <= N; i++) { if (i % 3 == 0 && i % 5 == 0) { continue; } if (i % 3 == 0) { continue; } if (i % 5 == 0) { continue; } ans += i; } cout <...
[["-", 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
92
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, a, b, c; cin >> n; a = n / 3, b = n / 5; c = n / 15; cout << n * (n + 1) / 2 - a * (a + 1) / 2 * 3 - b * (b + 1) / 2 * 5 + c * (c + 1) / 2 * 15; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); cin.tie(0); ll n, a, b, c; cin >> n; a = n / 3, b = n / 5; c = n / 15; cout << n * (n + 1) / 2 - a * (a + 1) / 2 * 3 - b * (b + 1) / 2 * 5 + c * (c + 1) / 2 * 15; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
113
#include <algorithm> #include <bits/stdc++.h> #include <ctype.h> #include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; #define pb push_back #define S second #define F first #define f(i, n) for (ll i = 0; i < n; i++) #define fast ...
#include <algorithm> #include <bits/stdc++.h> #include <ctype.h> #include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; #define pb push_back #define S second #define F first #define f(i, n) for (ll i = 0; i < n; i++) #define fast ...
[["-", 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
126
#include <bits/stdc++.h> using namespace std; int main() { unsigned long long N; cin >> N; unsigned long long amount = 0; unsigned long long i = 0; while (i < N) { if (i % 3 == 0 || i % 5 == 0) amount += 0; else amount += i; i++; } cout << amount << endl; }
#include <bits/stdc++.h> using namespace std; int main() { unsigned long long N; cin >> N; unsigned long long amount = 0; unsigned long long i = 0; while (i <= N) { if (i % 3 == 0 || i % 5 == 0) amount += 0; else amount += i; i++; } cout << amount << endl; }
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19]]
1
75
n = int(input()) a = 0 for i in range(n): if not (i%3==0 or i%5==0): a = a + i print(a)
n = int(input()) a = 0 for i in range(n): i = i + 1 if not (i%3==0 or i%5==0): a = a + i print(a)
[["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
44
#define ll long long #define rep(i, n) for (ll i = 0; i < n; i++) #define rep2(i, a, b) for (ll i = a; i <= b; ++i) #define rep3(i, a, b) for (ll i = a; i >= b; i--) #include <bits/stdc++.h> using namespace std; int main(void) { ll n, sum = 0; cin >> n; rep(i, n) { if (i % 3 != 0 && i % 5 != 0) { sum ...
#define ll long long #define rep(i, n) for (ll i = 0; i < n; i++) #define rep2(i, a, b) for (ll i = a; i <= b; ++i) #define rep3(i, a, b) for (ll i = a; i >= b; i--) #include <bits/stdc++.h> using namespace std; int main(void) { ll n, sum = 0; cin >> n; rep(i, n + 1) { if (i % 3 != 0 && i % 5 != 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
92
#include <bits/stdc++.h> using namespace std; int main() { long N; cin >> N; long long ans = 0; for (long i = 0; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) { ans += i; } } cout << ans; }
#include <bits/stdc++.h> using namespace std; int main() { long N; cin >> N; long long ans = 0; for (long i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { ans += i; } } cout << ans; }
[["-", 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
65
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define ll long long int main(void) { ll n; cin >> n; ll ans = 0; for (int i = 1; i < n; i++) { if (i % 3 && i % 5) ans += i; } cout << ans << endl; return (0); }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define ll long long int main(void) { ll n; cin >> n; ll ans = 0; for (int i = 1; i <= n; i++) { if (i % 3 && i % 5) ans += i; } cout << ans << endl; return (0); }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
77
/* RAone00 Rohit sharma */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef vector<vector<ll>> matrix; typedef vector<ll> vll; #define pb push_back #define debug(x) cout << (#x) << " is " << (x) << endl #define fast_io() ...
/* RAone00 Rohit sharma */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef vector<vector<ll>> matrix; typedef vector<ll> vll; #define pb push_back #define debug(x) cout << (#x) << " is " << (x) << endl #define fast_io() ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
154
#include <bits/stdc++.h> using namespace std; int main() { long long n, i, sum = 0; cin >> n; for (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 n, i, sum = 0; cin >> n; for (i = 0; i <= n; i++) { if ((i % 3 != 0) && (i % 5 != 0)) { sum += i; // cout << i << endl; } } cout << sum << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
71
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int ans = 0; for (int i = 0; i < N; i++) { if (!((i + 1) % 3 == 0 || (i + 1) % 5 == 0)) { ans += (i + 1); } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int64_t ans = 0; for (int i = 0; i < N; i++) { if (!((i + 1) % 3 == 0 || (i + 1) % 5 == 0)) { ans += (i + 1); } } cout << ans << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
81
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int sum = 0; for (int i = 0; i < N; i++) { int num = i + 1; if (num % 3 == 0 || num % 5 == 0) { sum += num; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long long int sum = 0; for (int i = 0; i < N; i++) { int num = i + 1; if (num % 3 != 0 && num % 5 != 0) { sum += num; } } cout << sum << endl; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 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
73
#include <cstdio> using namespace std; int main(int argc, char **argv) { int n; long long sum = 0; scanf("%d", &n); for (int i = 0; i < n; i++) if (i % 3 != 0 && i % 5 != 0) sum += i; printf("%lld\n", sum); return 0; }
#include <cstdio> using namespace std; int main(int argc, char **argv) { int n; long long sum = 0; scanf("%d", &n); for (int i = 1; i <= n; i++) if (i % 3 != 0 && i % 5 != 0) sum += i; printf("%lld\n", 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]]
1
83
ans = 0 n = int(input()) for i in range(1,n): if i % 15 == 0: continue elif i % 3 == 0: continue elif i % 5 == 0: continue else: ans += i print(ans)
ans = 0 n = int(input()) for i in range(1,n+1): if i % 15 == 0: continue elif i % 3 == 0: continue elif i % 5 == 0: continue 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
54
#include <iostream> using namespace std; int main() { long long int n, sum = 0; cin >> n; for (int i = 1; i < n; i++) { if (i % 3 == 0 || i % 5 == 0) continue; else sum += i; } cout << sum; }
#include <iostream> using namespace std; int main() { long long int n, sum = 0, reminder; cin >> n; // if (n%3==0 || n%5==0) // reminder=0; // else // reminder=n%3; // n-=reminder; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) continue; else sum += i; } cout << su...
[["+", 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, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
66
import sys # S = input() # N, M = map(int, input().split()) # nums = list(map(int, input().split())) # nums_2d = [list(map(int, input().split())) for _ in range(N)] def main(): N = int(input()) total = 0 for i in range(N): if i % 3==0 or i % 5 == 0: continue total += i ...
import sys # S = input() # N, M = map(int, input().split()) # nums = list(map(int, input().split())) # nums_2d = [list(map(int, input().split())) for _ in range(N)] def main(): N = int(input()) total = 0 for i in range(1, N+1): if i % 3 == 0 or i % 5 == 0: continue total +=...
[["+", 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
61
n = int(input()) cnt = 0 for i in range(n): if i % 3 == 0 or i % 5 == 0: pass else: cnt = cnt + i print(cnt)
n = int(input()) cnt = 0 for i in range(1, n + 1, 1): if i % 3 == 0 or i % 5 == 0: pass else: cnt = cnt + i print(cnt)
[["+", 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
44
#include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; int ans = 0; for (long long 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() { long long N; cin >> N; long long ans = 0; for (long long i = 1; i <= N; ++i) { if (i % 3 == 0 || i % 5 == 0) continue; 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
68
#pragma GCC optimize("Ofast", "unroll-loops") #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double int main() { int N; cin >> N; ll res = 0; for (int i = 0; i < N; ++i) { if ((i % 3) && (i % 5)) { res += i; } } cout << res << endl; return 0; }
#pragma GCC optimize("Ofast", "unroll-loops") #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double int main() { int N; cin >> N; ll res = 0; for (int i = 1; i <= N; ++i) { if ((i % 3) && (i % 5)) { 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
77
'use strict'; const p = s => console.log(s); // inputに入力データ全体が入る function Main(input) { // 1行目がinput[0], 2行目がinput[1], …に入る input = input.split("\n"); let N = input[0].split(" ")[0]; let sum = 0; for (let i = 1; i < N; i++) { if (Math.floor(i % 3) === 0 && Math.floor(i % 5) === 0) { continue; ...
'use strict'; const p = s => console.log(s); // inputに入力データ全体が入る function Main(input) { // 1行目がinput[0], 2行目がinput[1], …に入る input = input.split("\n"); let N = input[0].split(" ")[0]; let sum = 0; for (let i = 1; i <= N; i++) { if (Math.floor(i % 3) === 0 && Math.floor(i % 5) === 0) { continue; ...
[["-", 8, 556, 0, 7, 15, 1, 0, 16, 17, 18], ["+", 8, 556, 0, 7, 15, 1, 0, 16, 17, 19]]
2
173
<?php $input_line = trim(fgets(STDIN)); $input_line = (int)$input_line; $sum = 0; for ($i = 0; $i < $input_line; $i++) { if ($i % 3 != 0 && $i % 5 != 0){ $sum += $i; } } echo $sum; ?>
<?php $input_line = trim(fgets(STDIN)); $input_line = (int)$input_line; $sum = 0; for ($i = 0; $i <= $input_line; $i++) { if ($i % 3 != 0 && $i % 5 != 0){ $sum += $i; } } echo $sum; ?>
[["-", 36, 36, 0, 493, 0, 7, 0, 16, 17, 18], ["+", 36, 36, 0, 493, 0, 7, 0, 16, 17, 19]]
6
74
n = int(input()) total = 0 for i in range(0, n): if i % 3 != 0 and i % 5 != 0 : total = total + i print(total)
n = int(input()) total = 0 for i in range(1, n + 1): if i % 3 != 0 and i % 5 != 0 : total = total + i print(total)
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
43
var N = parseInt(require('fs').readFileSync('/dev/stdin', 'utf8')), ans = 0 for (var i = 1; i < N; i++) if (i % 3 != 0 && i % 5 != 0) ans += i console.log(ans)
var N = parseInt(require('fs').readFileSync('/dev/stdin', 'utf8')), ans = 0 for (var i = 1; i <= N; i++) if (i % 3 != 0 && i % 5 != 0) ans += i console.log(ans)
[["-", 0, 493, 0, 7, 15, 1, 0, 16, 17, 18], ["+", 0, 493, 0, 7, 15, 1, 0, 16, 17, 19]]
2
64
#include <stdio.h> int main() { int n, i, sum = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if ((i % 3 != 0) && (i % 5 != 0)) sum = sum + i; } printf("%d", sum); return 0; }
#include <stdio.h> int main() { int n, i; long long int sum = 0; scanf("%d", &n); for (i = 1; i <= n; i++) { if ((i % 3 != 0) && (i % 5 != 0)) sum = sum + i; } printf("%lld", 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
78
#include <bits/stdc++.h> using namespace std; #define io() \ ios_base::sync_with_stdio(false); \ cin.tie(nullptr) #define ll long long #define ull unsigned long long #define ui unsigned int #define us unsign...
#include <bits/stdc++.h> using namespace std; #define io() \ ios_base::sync_with_stdio(false); \ cin.tie(nullptr) #define ll long long #define ull unsigned long long #define ui unsigned int #define us unsign...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
489
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ll n; cin >> n; ll sum = 0; for (int i = 1; i < n; i++) { if (i % 3 == 0 || i % 5 == 0) { continue; } else { sum += i; } } cout << sum << "\n"; }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ll n; cin >> n; ll sum = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) { continue; } else { 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
79
#include <stdio.h> int main() { int N; scanf("%d", &N); int i; unsigned long int count = 0; for (i = 0; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) { count = count + i; } } printf("%lu", count); }
#include <stdio.h> int main() { int N; scanf("%d", &N); int i; unsigned long int count = 0; for (i = 0; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { count = count + i; } } printf("%lu", count); }
[["-", 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() { double x; cin >> x; double result = 0; for (int i = 1; i < x + 1; i++) { if (i % 3 != 0 && i % 5 != 0) { result += i; } } cout << result << endl; }
#include <iostream> using namespace std; int main() { long x; cin >> x; long result = 0; for (int i = 1; i < x + 1; i++) { if (i % 3 != 0 && i % 5 != 0) { result += i; } } cout << result << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
68
# coding: utf-8 N = int(input()) sum = 0 for i in range(N): if ( i % 3 != 0 or i % 5 != 0): sum += i print(sum)
#coding: utf-8 N = int(input()) sum = 0 for i in range(N+1): if ( i % 3 != 0): if (i % 5 != 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], ["-", 8, 196, 0, 57, 15, 23, 0, 679, 17, 354], ["+", 0, 7, 8, 196, 0, 57, 15, 23, 0, 25], ["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 102], ["+", 8, 196, 0, 57, 64, 196, 0, 57, 0, 121], ["+", 0, 57, 64, 196, 0, 57, 15, 23, 0, 24]]
5
42
#include <bits/stdc++.h> #define nl '\n' #define F fisrt #define S second #define pb push_back #define mp make_pair #define REP(i, a, b) for (int i = a; i < b; i++) #define Fizz -1 #define Buzz -2 #define FizzBuzz -3 using namespace std; typedef long long ll; typedef vector<int> vi; typedef stack<int> si; typedef d...
#include <bits/stdc++.h> #define nl '\n' #define F fisrt #define S second #define pb push_back #define mp make_pair #define REP(i, a, b) for (int i = a; i < b; i++) #define Fizz -1 #define Buzz -2 #define FizzBuzz -3 using namespace std; typedef long long ll; typedef vector<int> vi; typedef stack<int> si; typedef d...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
139
import java.math.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long num = sc.nextLong(); List<Long> list = new ArrayList<>(); for (long i = 0; i < num; i++) { if (i % 3 == 0) continue; if (i % 5 == 0) ...
import java.math.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long num = sc.nextLong(); List<Long> list = new ArrayList<>(); for (long i = 1; i <= num; i++) { if (i % 3 == 0) continue; if (i % 5 == 0) ...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
3
146
n = int(input()) fizzbuzz = [i for i in range(1, n) if not(i % 5 == 0 or i % 3 == 0)] print(sum(fizzbuzz))
n = int(input()) fizzbuzz = [i for i in range(1, n+1) if not(i % 5 == 0 or i % 3 == 0)] print(sum(fizzbuzz))
[["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]]
5
44
#include <bits/stdc++.h> using namespace std; int main() { long long int n, sum = 0; cin >> n; for (long long int i = 1; i <= n; i++) { if ((i % 3 == 0) || (i % 5 == 0)) { sum += i; } } cout << sum; }
#include <bits/stdc++.h> using namespace std; int main() { long long int n, sum = 0; cin >> n; for (long long int i = 1; i <= n; i++) { if ((i % 3 == 0) || (i % 5 == 0)) { continue; } else { sum += i; } } cout << sum; }
[["+", 8, 9, 0, 57, 64, 9, 0, 116, 0, 117], ["+", 8, 9, 0, 57, 64, 9, 0, 116, 0, 35], ["+", 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
71
#include <bits/stdc++.h> using namespace std; int main() { int N; long long int A = 0; cin >> N; for (int i = 0; i < N; i++) { if (i % 3 == 0) { A = A; } else { if (i % 5 == 0) { A = A; } else { A = A + i; } } } cout << A; }
#include <bits/stdc++.h> using namespace std; int main() { int N; long long int A = 0; cin >> N; for (int i = 0; i <= N; i++) { if (i % 3 == 0) { A = A; } else { if (i % 5 == 0) { A = A; } else { A = A + i; } } } cout << A; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
86
n = int(input()) total = 0 for i in range(n): if (i % 3 != 0) and (i % 5 != 0): total += i print(total)
n = int(input()) total = 0 for j in range(n): i = j+1 if (i % 3 != 0) and (i % 5 != 0): total += i print(total)
[["-", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
43
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) using namespace std; using ll = long long; using p = pair<int, int>; int n; int main() { cin >> n; vector<ll> a(n); rep(i, n) { a[i] = i + 1; } rep(i, n) { if ((a[i] % 3) == 0) a[i] = 0; if ((a[i] % 5) == 0) a[i] = 0; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using p = pair<int, int>; int n; int main() { cin >> n; vector<ll> a(n); rep(i, n) { a[i] = i + 1; } rep(i, n) { if ((a[i] % 3) == 0) a[i] = 0; if ((a[i] % 5) == 0) a[i] = 0; ...
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
170
#include <stdio.h> int main() { int i, n, count; scanf("%d", &n); count = 0; for (i = 1; i <= n; i++) { count = count + i; if (i % 3 == 0 || i % 5 == 0) count = count - i; } printf("%d\n", count); }
#include <stdio.h> int main() { long long int i, n, count; scanf("%lld", &n); count = 0; for (i = 1; i <= n; i++) { count = count + i; if (i % 3 == 0 || i % 5 == 0) count = count - i; } printf("%lld\n", count); }
[["+", 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
80
import sys sys.setrecursionlimit(1000000) n = int(input()) a = 0 for i in range(n): if (i % 3 !=0) and (i % 5 !=0): a += i else: continue print(a)
import sys sys.setrecursionlimit(1000000) n = int(input()) a = 0 for i in range(n+1): if (i % 3 !=0) and (i % 5 !=0): a += i else: continue print(a)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
54
#include <cstdio> #define ll long long using namespace std; int main() { ll k = 0; ll ans = 0; scanf("%lld", &k); for (ll i = 1; i < k; i++) { if (i % 5 != 0 && i % 3 != 0) { ans = ans + i; } } printf("%lld", ans); return 0; }
#include <cstdio> #define ll long long using namespace std; int main() { ll k = 0; ll ans = 0; scanf("%lld", &k); for (ll i = 1; i <= k; i++) { if (i % 5 != 0 && i % 3 != 0) { ans = ans + i; } } printf("%lld", ans); return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
85
import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); long sum = 0; for (int i = 0; i < n; i++) { if (!(i % 3 == 0 || i % 5 == 0)) { // System.out.print(i+"\t"); sum += i; } ...
import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); long sum = 0; for (int i = 0; i <= n; i++) { if (!(i % 3 == 0 || i % 5 == 0)) { // System.out.print(i+"\t"); sum += i; }...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
3
99
#include <stdio.h> int main() { unsigned long long int n, sum = 0; scanf("%lld", &n); for (int i = 1; i < n; i++) { if (i % 15 != 0 && i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%lld", sum); }
#include <stdio.h> int main() { unsigned long long int n, sum = 0; scanf("%lld", &n); for (int i = 1; i <= n; i++) { if (i % 15 != 0 && i % 3 != 0 && i % 5 != 0) { sum += i; } } printf("%lld", sum); }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
0
79
n=int(input()) result=0 for i in range(n): if i % 3 == 0 and i % 5 == 0: result=result elif i % 3 == 0: result=result elif i % 5 == 0: result=result else: result=result+i print(result)
n=int(input()) result=0 for i in range(n+1): if i % 3 == 0 and i % 5 == 0: result=result elif i % 3 == 0: result=result elif i % 5 == 0: result=result else: result=result+i print(result)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
66
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long x = sc.nextLong(); long y = 0; for (int i = 1; i <= x; i++) { if (i % 3 != 0 || i % 5 != 0) { y += i; } } System.out.print(y); } }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long x = sc.nextLong(); long y = 0; for (int i = 1; i <= x; i++) { if (i % 3 != 0 && i % 5 != 0) { y += i; } } System.out.print(y); } }
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 106], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 98]]
3
94
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); unsigned long sum = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 && i % 5 == 0) { // printf(",FIZZBUZZ,"); } else if (i % 3 == 0) { // printf(",FIZZ,"); } else if (i % 5 == 0) { // printf(",BU...
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); unsigned long sum = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 && i % 5 == 0) { // printf(",FIZZBUZZ,"); } else if (i % 3 == 0) { // printf(",FIZZ,"); } else if (i % 5 == 0) { // printf(",BU...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
110
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int ans = 0; for (int n = 1; n <= N; n++) { int a = n % 3; int b = n % 5; if (a != 0 && b != 0) { ans = ans + n; } } System.ou...
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long ans = 0; for (int n = 1; n <= N; n++) { int a = n % 3; int b = n % 5; if (a != 0 && b != 0) { ans = ans + n; } } System.o...
[["-", 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() { long n; cin >> n; int s = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) { continue; } else { s += i; } } cout << s << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long n; cin >> n; long s = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) { continue; } else { 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
71
#include <iostream> #include <string> using namespace std; int main() { int n; long long sum = 0; cin >> n; for (int i = 0; i < n; i++) { if (i % 3) { if (i % 5) { sum += i; } } } cout << sum << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { int n; long long sum = 0; cin >> n; for (int i = 1; i <= n; i++) { if (i % 3) { if (i % 5) { 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() { int n; long long sum{}; cin >> n; if (n == 1) { sum = 1; } else { for (int i = 1; i < n; i++) { if (!(i % 3 == 0 || i % 5 == 0)) sum += i; } } cout << sum << "\n"; }
#include <bits/stdc++.h> using namespace std; int main() { int n; long long sum{}; cin >> n; if (n == 1) { sum = 1; } else { for (int i = 1; i <= n; i++) { if (!(i % 3 == 0 || i % 5 == 0)) { sum += i; } } } cout << sum << "\n"; }
[["-", 75, 76, 0, 9, 0, 7, 15, 16, 17, 18], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
85
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) void sort2array(double *a, long *b, long n) { for (int i = 0; i < n; i++) { b[i] = i; } sort(b, b + n, [a](long i, long j) -> bool { return a[i] < a[j]; }); } int wtover(int a, int b) { if (a % b > 0) re...
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) void sort2array(double *a, long *b, long n) { for (int i = 0; i < n; i++) { b[i] = i; } sort(b, b + n, [a](long i, long j) -> bool { return a[i] < a[j]; }); } int wtover(int a, int b) { if (a % b > 0) re...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
191
x = int(input()) N = 0 for i in range(x): if i%3==0 and i%5==0: pass elif i%3==0: pass elif i%5==0: pass else: N = i + N print(N)
x = int(input()) N = 0 for i in range(1,x+1): if i%3==0 and i%5==0: pass elif i%3==0: pass elif i%5==0: pass else: N = i + N print(N)
[["+", 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
60
S=int(input()) sum = 0 for i in range(0,S): remainder3 = i % 3 remainder5 = i % 5 if remainder3 >0 and remainder5>0: sum += i print(sum)
S=int(input()) sum = 0 for i in range(1,S+1): remainder3 = i % 3 remainder5 = i % 5 if remainder3 >0 and remainder5>0: sum += i print(sum)
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
47
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int N; cin >> N; ll 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; typedef long long ll; 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 << 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
74
n = int(input()) sum = n*(n-1)/2 for i in range(n): if i%3 == 0 or i%5 == 0: sum-=i print(int(sum))
n = int(input()) sum = n*(n+1)/2 for i in range(1,n+1): if i%3 == 0 or i%5 == 0: sum-=i print(int(sum))
[["-", 12, 657, 31, 657, 12, 23, 0, 657, 17, 33], ["+", 12, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 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
50
N = int(input()) answer = 0 for i in range(1,N): if i % 3 != 0: if i % 5 != 0: answer += i continue if i % 5 != 0: if i % 3 != 0: answer += i continue print(answer)
N = int(input()) answer = 0 for i in range(1,N+1): if i % 3 != 0: if i % 5 != 0: answer += i continue if i % 5 != 0: if i % 3 != 0: answer += i continue print(answer)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
61
K=int(input()) fiz=[0] for i in range(K): if i%3==0 or i%5==0: k=1 else: fiz.append(i) print(sum(fiz))
K=int(input()) fiz=[0] for i in range(K+1): if i%3==0 or i%5==0: k=1 else: fiz.append(i) print(sum(fiz))
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
52
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long long po = 0; for (int i = 0; i < N; i++) { if ((i % 3) != 0 && (i % 5) != 0) { po = po + i; } } cout << po; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long long po = 0; for (int i = 1; i <= N; i++) { if ((i % 3) != 0 && (i % 5) != 0) { po = po + i; } } cout << po; }
[["-", 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
def extract(seq): arr = [] for i in seq: if i % 3 == 0 or i % 5 == 0: continue else: arr.append(i) return sum(arr) n = int(input()) print(extract(range(n)))
def extract(seq): arr = [] for i in seq: if i % 3 == 0 or i % 5 == 0: continue else: arr.append(i) return sum(arr) n = int(input()) print(extract(range(1, n + 1)))
[["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 612], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
60
#include <bits/stdc++.h> using namespace std; int main() { long long n; long long cnt = 0; cin >> n; for (int i = 0; i < n; i++) { if ((i % 3 != 0) && (i % 5 != 0)) cnt += i; } cout << cnt << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long n; long long cnt = 0; cin >> n; for (int i = 1; i <= n; i++) { if ((i % 3 != 0) && (i % 5 != 0)) cnt += i; } cout << cnt << 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
70
n=int(input()) sum1=0 for i in range(n): if not(i%3==0 or i%5==0): sum1=sum1+i print(sum1)
n=int(input()) sum1=0 for i in range(1,n+1): if not(i%3==0 or i%5==0): sum1=sum1+i print(sum1)
[["+", 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
44
#include <algorithm> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <vector> // #include <fstream> template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } ret...
#include <algorithm> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <vector> // #include <fstream> template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } ret...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
193
N = int(input()) cnt = 0 for i in range(N-1): i +=1 if i % 3 !=0 and i % 5 !=0: cnt += i print(cnt)
N = int(input()) cnt = 0 for i in range(N): i +=1 if i % 3 !=0 and i % 5 !=0: cnt += i print(cnt)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
44
#include <iostream> using namespace std; #define lli long long int int main() { lli n, sum = 0; cin >> n; for (lli i = 1; i <= n; i++) { if (i % 3 != 0 && 1 % 5 != 0) { sum += i; } } cout << sum << endl; }
#include <iostream> using namespace std; #define lli long long int int main() { lli n, sum = 0; cin >> n; for (lli i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; }
[["-", 15, 339, 51, 16, 12, 16, 31, 16, 31, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22]]
1
68
#include <iostream> #include <stdio.h> #include <stdlib.h> using namespace std; int main() { unsigned long long int input; unsigned long long int sum = 0; cin >> input; if (input == 1ull) { cout << input << endl; } else { for (unsigned long long int i = 1ull; i < input; i++) { if (i % 3ull != ...
#include <iostream> #include <stdio.h> #include <stdlib.h> using namespace std; int main() { unsigned long long int input; unsigned long long int sum = 0; cin >> input; if (input == 1ull) { cout << input << endl; } else { for (unsigned long long int i = 1ull; i <= input; i++) { if (i % 3ull !=...
[["-", 75, 76, 0, 9, 0, 7, 15, 16, 17, 18], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 17, 19]]
1
99
N = int(input()) s = 0 for i in range(N + 1): n = i + 1 if n % 3 != 0 and n % 5 != 0: s += n print(s)
N = int(input()) s = 0 for i in range(N): n = i + 1 if n % 3 != 0 and n % 5 != 0: s += n print(s)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
46
def resolve(): N = int(input()) temp = 0 for count in range(N): if count % 3 == 0 and count % 5 == 0: pass elif count % 3 == 0: pass elif count % 5 == 0: pass else: temp += count print(temp) resolve()
def resolve(): N = int(input()) temp = 0 for count in range(N + 1): if count % 3 == 0 and count % 5 == 0: pass elif count % 3 == 0: pass elif count % 5 == 0: pass else: temp += count print(temp) resolve()
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
66
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int number = scanner.nextInt(); int answer = 0; for (int i = 1; i <= number; i++) { if (!(i % 3 == 0 || i % 5 == 0)) { answer = answer + i; } else { con...
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int number = scanner.nextInt(); long answer = 0; for (int i = 1; i <= number; i++) { if (!(i % 3 == 0 || i % 5 == 0)) { answer = answer + i; } else { co...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
3
103
n = int(input()) s = (n//15)*60 + (n//15)*(n//15 - 1)*60 for i in range(n-(n%15), n): if i % 5 != 0 and i % 3 != 0: s += i print(s)
n = int(input()) s = (n//15)*60 + (n//15)*(n//15 - 1)*60 for i in range(n-(n%15), n+1): if i % 5 != 0 and i % 3 != 0: 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
69
#include <stdio.h> int main(void) { int N = 0; unsigned int count = 0; scanf("%d", &N); for (int i = 0; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) count = count + i; } printf("%d", count); return 0; }
#include <stdio.h> int main(void) { int N = 0, i; long count = 0; scanf("%d", &N); for (i = 0; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) count = count + i; } printf("%ld", count); 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, 87], ["-", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, ...
0
78
n = int(input()) result = 0 for i in range(1,n): if i % 5 == 0: result = result elif i % 3 == 0: result = result else: result += i print(result)
n = int(input()) result = 0 for i in range(1,n+1): if i % 5 == 0: result = result elif i % 3 == 0: result = result else: result += i print(result)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
50
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long long int sum = 0; for (int i = 0; i < N; i++) { if (i % 15 == 0) { continue; } else if (i % 3 == 0) { continue; } else if (i % 5 == 0) { continue; } sum += i; } cout << sum <<...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long long int sum = 0; for (int i = 1; i < N + 1; i++) { if (i % 15 == 0) { continue; } if (i % 3 == 0) { continue; } if (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], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["-", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]]
1
90
n = 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, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
39