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 <iostream> #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) { } else { sum += i; } } cout << sum << endl; }
#include <iostream> #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) { } else { sum += i; } } cout << sum << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
72
print(sum([i for i in range(int(input())) if i%5!=0 and i%3!=0]))
print(sum([i for i in range(int(input())+1) if i%5!=0 and i%3!=0]))
[["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]]
5
33
#include <bits/stdc++.h> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // math //--------...
#include <bits/stdc++.h> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // math //--------...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
1,308
x = int(input()) count = 0 for i in range(x): if i % 3 == 0: pass elif i % 5 == 0: pass else: count += i print(count)
x = int(input()) + 1 count = 0 for i in range(x): if i % 3 == 0: pass elif i % 5 == 0: pass else: count += i print(count)
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
44
// +build ignore package main import ( "bufio" "fmt" "io" "os" "strconv" ) // I/O type Scanner struct { sc *bufio.Scanner } func NewScanner() *Scanner { sc := bufio.NewScanner(os.Stdin) sc.Split(bufio.ScanWords) sc.Buffer(make([]byte, 1024), int(1e+9)) return &Scanner{sc} } func (s *Scanner) nextStr() str...
// +build ignore package main import ( "bufio" "fmt" "io" "os" "strconv" ) // I/O type Scanner struct { sc *bufio.Scanner } func NewScanner() *Scanner { sc := bufio.NewScanner(os.Stdin) sc.Split(bufio.ScanWords) sc.Buffer(make([]byte, 1024), int(1e+9)) return &Scanner{sc} } func (s *Scanner) nextStr() str...
[["-", 8, 196, 0, 7, 0, 430, 15, 16, 17, 18], ["+", 8, 196, 0, 7, 0, 430, 15, 16, 17, 19]]
7
456
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; // for loop #define F(i, L, R) for (int i = L; i < R; i++) #define FE(i, L, R) for (int i = L; i <= R; i++) ...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; // for loop #define F(i, L, R) for (int i = L; i < R; i++) #define FE(i, L, R) for (int i = L; i <= R; i++) ...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]]
1
250
#include <iostream> using namespace std; int main() { long long N; cin >> N; long long sum = 0; for (long long i = 0; i < N; i++) { if (i % 3 == 0 || i % 5 == 0) { continue; } else { sum += i; } } cout << sum << endl; }
#include <iostream> using namespace std; int main() { long long N; cin >> N; long long sum = 0; for (long long i = 1; i <= N; i++) { if (i % 3 == 0 || i % 5 == 0) { continue; } else { 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
74
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define INF (int)9e18 #define HELL (int)(1e9 + 7) #define int long long #define double long double #define uint unsigned long long #define deb(x) cerr << #x << " => " << x << "\n" #define deba(x) ...
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define INF (int)9e18 #define HELL (int)(1e9 + 7) #define int long long #define double long double #define uint unsigned long long #define deb(x) cerr << #x << " => " << x << "\n" #define deba(x) ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
204
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, s, n) for (int i = s; i < (n); i++) #define ALL(a) a.begin(), a.end() #define RALL(a) a.rbegin(), a.rend() template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class ...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, s, n) for (int i = s; i < (n); i++) #define ALL(a) a.begin(), a.end() #define RALL(a) a.rbegin(), a.rend() template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class ...
[["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]]
1
268
K=int(input()) #関数定義(最大公約数) def gcd(*numbers): return reduce(math.gcd, numbers) sum=0 for a in range(1,K+1): for b in range(1,K+1): for c in range(1,K+1): sum+=(gcd(a, b, c)) print(sum)
import math from functools import reduce K=int(input()) #関数定義(最大公約数) def gcd(*numbers): return reduce(math.gcd, numbers) sum=0 for a in range(1,K+1): for b in range(1,K+1): for c in range(1,K+1): sum+=(gcd(a, b, c)) print(sum)
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 314], ["+", 36, 36, 0, 656, 0, 686, 687, 673, 0, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 487], ["+", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22]]
5
80
from itertools import combinations_with_replacement def euclidean(num_list: list): a, b = sorted(num_list) while b % a != 0: redi = b % a b = a a = redi return a K = int(input()) k_range = list(range(1, K+1)) result = 0 for comb in combinations_with_replacement(k_range, 3): ...
from itertools import combinations_with_replacement def euclidean(num_list: list): a, b = sorted(num_list) while b % a != 0: redi = b % a b = a a = redi return a K = int(input()) k_range = list(range(1, K+1)) result = 0 for comb in combinations_with_replacement(k_range, 3): ...
[["-", 8, 196, 0, 1, 0, 677, 12, 657, 31, 22], ["+", 8, 196, 0, 1, 0, 677, 12, 657, 31, 22]]
5
178
#include <algorithm> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; #define ll long long int int gcd(int m, int n) { // 引数に0がある場合は0を返す if ((0 == m) || (0 == n)...
#include <algorithm> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; #define ll long long int int gcd(int m, int n) { // 引数に0がある場合は0を返す if ((0 == m) || (0 == n)...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22]]
1
198
import math, itertools from functools import reduce def gcd_list(numbers): return(reduce(math.gcd,numbers)) k=int(input()) ans=0 for numbers in itertools.combinations_with_replacement(range(1,k+1),3): a,b,c=numbers if a==b==c: ans+=gcd_list(numbers) elif a!=b and a!=c: ans+=6*gcd_list(nu...
import math, itertools from functools import reduce def gcd_list(numbers): return(reduce(math.gcd,numbers)) k=int(input()) ans=0 for numbers in itertools.combinations_with_replacement(range(1,k+1),3): a,b,c=numbers if a==b==c: ans+=gcd_list(numbers) elif a!=b and a!=c and b!=c: ans+=6*gc...
[["+", 8, 196, 0, 57, 75, 665, 15, 679, 17, 355], ["+", 0, 57, 75, 665, 15, 679, 12, 666, 0, 22], ["+", 0, 57, 75, 665, 15, 679, 12, 666, 667, 79]]
5
106
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int k = scan.nextInt(); int sum = 0; for (int i = 0; i <= k; i++) { for (int j = 0; j <= k; j++) { for (int l = 0; l <= k; l++) { sum += Euqlid(i, ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int k = scan.nextInt(); int sum = 0; for (int i = 1; i <= k; i++) { for (int j = 1; j <= k; j++) { for (int l = 1; l <= k; l++) { sum += Euqlid(i, E...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 498, 0, 195, 8, 196, 0, 57, 0, 95]]
3
160
#include <bits/stdc++.h> using namespace std; main() { int n; cin >> n; long long ans = 0; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= n; ++j) { for (int k = 0; k <= n; ++k) { ans += gcd(i, gcd(j, k)); } } } cout << ans << "\n"; }
#include <bits/stdc++.h> using namespace std; main() { int n; cin >> n; long long ans = 0; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= n; ++j) { for (int k = 1; k <= n; ++k) { ans += gcd(i, gcd(j, k)); } } } cout << ans << "\n"; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
94
from math import gcd sum = 0 K = int(input()) for k in range(1,K+1): for j in range(1,K+1): t = gcd(k,j) for i in range(1,K+1): sum += gcd(t,i+1) print(sum)
from math import gcd sum = 0 K = int(input()) for k in range(1,K+1): for j in range(1,K+1): t = gcd(k,j) for i in range(1,K+1): sum += gcd(t,i) print(sum)
[["-", 0, 677, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 677, 12, 652, 3, 4, 0, 657, 12, 612]]
5
73
import math n=int(input()) for i in range(1,n+1): for j in range(1,n+1): for k in range(1,n+1): ans+=math.gcd(i,math.gcd(j,k)) print(ans)
import math n=int(input()) ans=0 for i in range(1,n+1): for j in range(1,n+1): for k in range(1,n+1): ans+=math.gcd(i,math.gcd(j,k)) print(ans)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
67
#include <bits/stdc++.h> using namespace std; int gcd(int a, int b) { if (a % b == 0) { return (b); } else { return (gcd(b, a % b)); } } int main() { int k; cin >> k; int ans = 0; for (int i = 1; i < k; i++) { for (int j = 1; j < k; j++) { for (int l = 1; l < k; l++) { int num =...
#include <bits/stdc++.h> using namespace std; int gcd(int a, int b) { if (a % b == 0) { return (b); } else { return (gcd(b, a % b)); } } int main() { int k; cin >> k; int ans = 0; for (int i = 1; i <= k; i++) { for (int j = 1; j <= k; j++) { for (int l = 1; l <= k; l++) { int nu...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19]]
1
138
from math import gcd k = int(input()) ans = 0 for i in range(1,k+1): for j in range(1,k+1): v = gcd(i,j) for m in range(1,k+1): ans += math.gcd(v,m) print(ans)
import math k = int(input()) ans = 0 for i in range(1,k+1): for j in range(1,k+1): v = math.gcd(i,j) for m in range(1,k+1): ans += math.gcd(v,m) print(ans)
[["-", 36, 36, 36, 36, 0, 656, 0, 686, 0, 314], ["-", 36, 36, 0, 656, 0, 686, 687, 673, 0, 22], ["-", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 500, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 0, 131]]
5
73
from math import gcd k = int(input()) ans = 0 for i in range(1,k+1): for j in range(1,k+1): v = gcd(i,j) for m in range(1,k+1): ans += math.gcd(v,m) print(ans)
from math import gcd k = int(input()) ans = 0 for i in range(1,k+1): for j in range(1,k+1): v = gcd(i,j) for m in range(1,k+1): ans += gcd(v,m) print(ans)
[["-", 0, 1, 0, 677, 12, 652, 63, 319, 500, 22], ["-", 0, 1, 0, 677, 12, 652, 63, 319, 0, 131]]
5
73
import math import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines k = int(read()) ans = 0 for a in range(1, n+1): for b in range(1, n + 1): n = math.gcd(a, b) for c in range(1, n+1): ans += math.gcd(n, c) print(ans)
import math import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines k = int(read()) ans = 0 for a in range(1, k + 1): for b in range(1, k + 1): n = math.gcd(a, b) for c in range(1, k + 1): ans += math.gcd(n, c) print(ans)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22]]
5
102
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep2(i, s, n) for (ll i = s; i < (n); i++) #define repr(i, n) for (int i = n; i >= 0; i--) #define pb push_back #define COUT(x) cout << (x) << endl #define COUTF(x) cout << setprecision(15) << (x) << endl #define ENDL cout << endl #define D...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep2(i, s, n) for (ll i = s; i < (n); i++) #define repr(i, n) for (int i = n; i >= 0; i--) #define pb push_back #define COUT(x) cout << (x) << endl #define COUTF(x) cout << setprecision(15) << (x) << endl #define ENDL cout << endl #define D...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]]
1
203
import math k=int(input()) ans=0 for i in range(k): for j in range(k): q=math.gcd(i,j) for l in range(k): ans+=math.gcd(q,l+1) print(ans)
import math k=int(input()) ans=0 for i in range(k): for j in range(k): q=math.gcd(i+1,j+1) for l in range(k): ans+=math.gcd(q,l+1) print(ans)
[["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]]
5
63
#include <bits/stdc++.h> using namespace std; #define int long long int #define fi first #define se second #define pb push_back #define soo(v) sort(v.rbegin(), v.rend()) #define so(v) sort(v.begin(), v.end()) #define lb(v, x) lower_bound(v.begin(), v.end(), x) #define ub(v, x) upper_bound(v.begin(), v.end(), x) //#defi...
#include <bits/stdc++.h> using namespace std; #define int long long int #define fi first #define se second #define pb push_back #define soo(v) sort(v.rbegin(), v.rend()) #define so(v) sort(v.begin(), v.end()) #define lb(v, x) lower_bound(v.begin(), v.end(), x) #define ub(v, x) upper_bound(v.begin(), v.end(), x) //#defi...
[["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 12, 2, 3, 4, 0, 2, 3, 4, 0, 22]]
1
323
k = int(input()) def gcd1 (a, b): while True: if (a < b): a, b = b, a c = a%b if (c == 0): return (b) else: a = b b = c def gcd2 (a, b, c): tmp = gcd1(a, b) ans = gcd1(tmp, c) return (ans) count = 0 for i in range(k): ...
k = int(input()) def gcd1 (a, b): while True: if (a < b): a, b = b, a c = a%b if (c == 0): return (b) else: a = b b = c def gcd2 (a, b, c): tmp = gcd1(a, b) ans = gcd1(tmp, c) return (ans) count = 0 for i in range(k): ...
[["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22]]
5
179
def main(): k = int(input()) r = 0 for ia in range(1, k + 1): for ib in range(1, k + 1): for ic in range(1, k + 1): t1 = gcd(ib, ic) r += gcd(t1,ia) print(r) if __name__ == '__main__': main()
from math import gcd def main(): k = int(input()) r = 0 for ia in range(1, k + 1): for ib in range(1, k + 1): for ic in range(1, k + 1): t1 = gcd(ib, ic) r += gcd(t1,ia) print(r) if __name__ == '__main__': main()
[["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 314], ["+", 36, 36, 0, 656, 0, 686, 687, 673, 0, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 487], ["+", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22]]
5
82
from math import gcd as g k = int(input()) ans = 0 for a in range(1, k+1): for b in range(k+1): temp = g(a, b) for c in range(k+1): ans += g(temp, c) print(ans)
from math import gcd as g k = int(input()) ans = 0 for a in range(1, k+1): for b in range(1, k+1): temp = g(a, b) for c in range(1, k+1): ans += g(temp, c) print(ans)
[["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21]]
5
69
#include <iostream> #include <numeric> using namespace std; int main() { int n; cin >> n; int ans = 0; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= n; ++j) { for (int k = 1; k <= n; ++k) { ans += gcd(i / gcd(i, j), k); } } } cout << ans << endl; }
#include <iostream> #include <numeric> using namespace std; int main() { int n; cin >> n; int ans = 0; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= n; ++j) { for (int k = 1; k <= n; ++k) { ans += gcd(gcd(i, j), k); } } } cout << ans << endl; }
[["-", 0, 11, 12, 2, 3, 4, 0, 16, 31, 22], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 85]]
1
96
#include <algorithm> #include <iostream> using namespace std; int main() { int n; cin >> n; int count = 0; for (int i = 0; i < n + 1; i++) { for (int j = 0; j < n + 1; j++) { for (int k = 0; k < n + 1; k++) { count += __gcd(__gcd(i, j), __gcd(j, k)); } } } cout << count << endl...
#include <algorithm> #include <iostream> using namespace std; int main() { int n; cin >> n; int count = 0; for (int i = 1; i < n + 1; i++) { for (int j = 1; j < n + 1; j++) { for (int k = 1; k < n + 1; k++) { count += __gcd(__gcd(i, j), __gcd(j, k)); } } } cout << count << endl...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
105
import math n = int(input()) ans = [gcd(i+1, gcd(j+1, k+1)) for i in range(n) for j in range(n) for k in range(n)] print(sum(ans))
import math n = int(input()) ans = [math.gcd(i+1, math.gcd(j+1, k+1)) for i in range(n) for j in range(n) for k in range(n)] print(sum(ans))
[["+", 0, 662, 12, 658, 8, 652, 63, 319, 500, 22], ["+", 0, 662, 12, 658, 8, 652, 63, 319, 0, 131], ["+", 8, 652, 3, 4, 0, 652, 63, 319, 500, 22], ["+", 8, 652, 3, 4, 0, 652, 63, 319, 0, 131]]
5
59
#!/usr/bin/env python import sys from collections import Counter from itertools import permutations, combinations from math import gcd from math import ceil, floor sys.setrecursionlimit(10 ** 6) def input(): return sys.stdin.readline()[:-1] def main(): n = int(input()) ans = 0 for i in range(n): ...
#!/usr/bin/env python import sys from collections import Counter from itertools import permutations, combinations from math import gcd from math import ceil, floor sys.setrecursionlimit(10 ** 6) def input(): return sys.stdin.readline()[:-1] def main(): n = int(input()) ans = 0 for i in range(1, n+1...
[["+", 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
103
#include <iostream> #include <math.h> using namespace std; int main() { double n; cin >> n; double total = 0; for (double i = 1; i <= n; i++) { if (fmod(i, 3) == 0) continue; if (fmod(i, 5) == 0) continue; total += i; } cout << total << endl; return 0; }
#include <iostream> #include <math.h> using namespace std; int main() { long n; cin >> n; long total = 0; for (long i = 1; i <= n; i++) { if (fmod(i, 3) == 0) continue; if (fmod(i, 5) == 0) continue; total += i; } cout << total << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96]]
1
81
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(void) { ll n; cin >> n; ll ans = 0; for (ll i = 1; i < n + 1; i++) { if (i % 3 != 0 && i % 5 != 0) ans += 1; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(void) { ll n; cin >> n; ll ans = 0; for (ll i = 1; i < n + 1; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } cout << ans << endl; }
[["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 12, 22]]
1
72
/** * Title: * Url: */ #include <iostream> using namespace std; #define ll long long 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; }
/** * Title: * Url: */ #include <iostream> using namespace std; #define ll long long int main() { int n; cin >> n; ll sum = 0; for (int i = 1; i <= n; i++) { if (!(i % 3 == 0 || i % 5 == 0)) { sum += i; } } cout << sum << 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
76
#include <bits/stdc++.h> using namespace std; int main() { int n; long long int ans = 0; cin >> n; for (long long int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 == 0) ans += i; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; long long int ans = 0; cin >> n; for (long long int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } cout << ans << endl; return 0; }
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79]]
1
71
#include <algorithm> //next_permutation #include <iostream> #include <set> #include <stdio.h> //printf("%.*f\n",*********); #include <string> //char('a'=32+'A') #include <vector> //s.erase(n),vector // to_string,string,substr #include <cmath> //min,max #include <complex> #include <iomanip> #include <locale> #include ...
#include <algorithm> //next_permutation #include <iostream> #include <set> #include <stdio.h> //printf("%.*f\n",*********); #include <string> //char('a'=32+'A') #include <vector> //s.erase(n),vector // to_string,string,substr #include <cmath> //min,max #include <complex> #include <iomanip> #include <locale> #include ...
[["-", 0, 14, 8, 9, 0, 14, 49, 53, 49, 22], ["+", 0, 14, 8, 9, 0, 14, 49, 53, 49, 22]]
1
661
s = int(input()) count = 0 for i in range(s): if i%3 == 0: continue elif i % 5 == 0: continue else: count += i print(count)
s = int(input()) count = 0 for i in range(s+1): if i%3 == 0: continue elif i % 5 == 0: continue else: 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
44
N = int(input()) ans = 0 for i in range(N): if(i%3 == 0 or i%5 == 0): continue else: ans += i print(ans)
N = int(input()) ans = 0 for i in range(N+1): if(i%3 == 0 or 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
44
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int N, cou = 0; cin >> N; for (int i = 1; i <= N; i++) { if ((i % 3 != 0) && (i % 5 != 0)) { cou += i; } } cout << cou << endl; }
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { int64_t N, cou = 0; cin >> N; for (int i = 1; i <= N; i++) { if ((i % 3 != 0) && (i % 5 != 0)) { cou += i; } } cout << cou << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
83
n = int(input()) import numpy as np narray=np.array(range(n)) tempsum=[] for i in narray: if i%3!=0 and i%5!=0: tempsum.append(i) #print(i) print(np.sum(tempsum))
n = int(input()) import numpy as np narray=np.array(range(n+1)) tempsum=[] for i in narray: if i%3!=0 and i%5!=0: tempsum.append(i) #print(i) print(np.sum(tempsum))
[["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
61
#define _CRT_SECURE_NO_WARNINGS #pragma region include #include <algorithm> #include <bitset> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <map> #include <set> #include <stdio.h> #include <string> #include <tuple> #include <vector> #pragma endregion using namespace std; #pragma r...
#define _CRT_SECURE_NO_WARNINGS #pragma region include #include <algorithm> #include <bitset> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <map> #include <set> #include <stdio.h> #include <string> #include <tuple> #include <vector> #pragma endregion using namespace std; #pragma r...
[["+", 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
596
#include <iostream> using namespace std; int main() { int N; int total = 0; cin >> N; for (int i = 1; i <= N; ++i) { if (i % 3 != 0 && i % 5 != 0) { total += i; } } cout << total << endl; return 0; }
#include <iostream> using namespace std; int main() { int N; long int total = 0; cin >> N; for (int i = 1; i <= N; ++i) { if (i % 3 != 0 && i % 5 != 0) { total += i; } } cout << total << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
69
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long long int sum = 0; for (int i = 1; i <= N; i++) { if (i % 3 != 0 || i % 5 != 0 || i % 15 != 0) sum += i; } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long long int sum = 0; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0 && i % 15 != 0) sum += i; } cout << sum << endl; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
72
// Created by abhay #include <bits/stdc++.h> #define sz(a) int((a).size()) #define pb push_back #define allc c.begin(), c.end() #define tr(c, i) for (typeof(c).begin() i = c.begin(); i != c.end(); i++) #define present(c, x) (c.find(x) != c.end()) #define cpresent(c, x) (find(allc, x) != c.end()) #define rep(i, n) for (...
// Created by abhay #include <bits/stdc++.h> #define sz(a) int((a).size()) #define pb push_back #define allc c.begin(), c.end() #define tr(c, i) for (typeof(c).begin() i = c.begin(); i != c.end(); i++) #define present(c, x) (c.find(x) != c.end()) #define cpresent(c, x) (find(allc, x) != c.end()) #define rep(i, n) for (...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
199
def main(): N = input() sum = 0 for i in range(N): i = i+1 if i%3 ==0 or i%5 ==0 or i%15 ==0: continue else: sum = sum + i print(sum) if __name__ == "__main__": main()
def main(): N = int(input()) sum = 0 for i in range(N): i = i+1 if i%3 == 0 or i%5 == 0 or i%15 == 0: continue else: sum = sum + i print(sum) if __name__ == "__main__": main()
[["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
67
from sys import stdin n = int(stdin.readline().rstrip()) sum = 0 for i in range(n): if i%5==0: continue if i%3==0: continue sum += i print(sum)
from sys import stdin n = int(stdin.readline().rstrip()) sum = 0 for i in range(1,n+1): if i%5==0: continue if i%3==0: continue sum += i print(sum)
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
52
#include <bits/stdc++.h> using namespace std; int main() { int N, c = 0; cin >> N; for (int i = 1; i < N + 1; i++) { if (i % 3 == 0 || i % 5 == 0) { continue; } else { c += i; } } cout << c << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long N, c = 0; cin >> N; for (int i = 1; i < N + 1; i++) { if (i % 3 == 0 || i % 5 == 0) { continue; } else { c += i; } } cout << c << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
72
#include <cmath> #include <cstdlib> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { ll n = 0; cin >> n; ll sum = 0; for (ll i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) sum += i; } cout << sum << endl; retur...
#include <cmath> #include <cstdlib> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { ll n = 0; cin >> n; ll sum = 0; for (ll i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) sum += i; } cout << sum << endl; retu...
[["-", 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
84
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int x = 0; for (int i = 1; i < N + 1; i++) { if (i % 3 == 0) { continue; } if (i % 5 == 0) { continue; } x = x + i; ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long x = 0; for (int i = 1; i < N + 1; i++) { if (i % 3 == 0) { continue; } if (i % 5 == 0) { continue; } x = x + i;...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96]]
3
106
n = int(input()) cnt=0 for i in range(n): if(i%3==0 or i%5==0): continue else: cnt+=i print(cnt)
n = int(input()) cnt=0 for i in range(1,n+1): if(i%3==0 or i%5==0): continue else: 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; typedef long long ll; #define reps(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) reps(i, 0, n) #define print(x) \ cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ <...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define reps(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) reps(i, 0, n) #define print(x) \ cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ <...
[["+", 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
94
// include // ------------------------------------------------ #include <algorithm> #include <bits/stdc++.h> #include <math.h> #include <vector> using namespace std; // func // ------------------------------------------------ int CalcSumOfDigit(int n); // 各桁の和を計算する。 string upper(string str); // 英字を大文字に変換する。 string l...
// include // ------------------------------------------------ #include <algorithm> #include <bits/stdc++.h> #include <math.h> #include <vector> using namespace std; // func // ------------------------------------------------ int CalcSumOfDigit(int n); // 各桁の和を計算する。 string upper(string str); // 英字を大文字に変換する。 string l...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
332
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { long int sum = 0; int n; cin >> n; for (int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) sum += i; } cout << sum << endl; return 0; }
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { long int sum = 0; int n; 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
72
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cout << fixed << setprecision(10); ll N; cin >> N; ll sum = 0; for (int i = 1; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) sum += i; } cout << sum; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cout << fixed << setprecision(10); ll N; cin >> N; ll sum = 0; for (int i = 1; i < N + 1; i++) { if (i % 3 != 0 && i % 5 != 0) sum += i; } cout << sum; }
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
77
num = int(input()) result = 0 for fizzbuzz in range(num): if fizzbuzz % 3 == 0 and fizzbuzz % 5 == 0: continue elif fizzbuzz % 3 == 0: continue elif fizzbuzz % 5 == 0: continue result += fizzbuzz print(result)
num = int(input()) result = 0 for fizzbuzz in range(1, num+1): if fizzbuzz % 3 == 0 and fizzbuzz % 5 == 0: continue elif fizzbuzz % 3 == 0: continue elif fizzbuzz % 5 == 0: continue result += fizzbuzz print(result)
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
56
#include <bits/stdc++.h> #define ll long long int #define p 1000000007 using namespace std; int main(void) { ll n; scanf("%lld", &n); ll sum = 0; for (ll i = 1; i <= n; i++) { if ((i % 15) != 0 && (i % 3) != 0 && (i % 5) != 0) sum = sum + i; } printf("%lld\n", sum % p); }
#include <bits/stdc++.h> #define ll long long int #define p 100000000007 using namespace std; int main(void) { ll n; scanf("%lld", &n); ll sum = 0; for (ll i = 1; i <= n; i++) { if ((i % 15) != 0 && (i % 3) != 0 && (i % 5) != 0) sum = sum + i; } printf("%lld\n", sum); }
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 109], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
1
97
#include <bits/stdc++.h> using namespace std; #define ll long long #define inf 0x3f3f3f3f #define infll 0x3f3f3f3f3f3f3f3f #define all(x) (x).begin(), (x).end() #define f(i, a, b) for (int i = a; i < (signed)(b); ++i) #define pc __builtin_popcount // counts number of 1's in bin(num) #define pb push_back const double ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define inf 0x3f3f3f3f #define infll 0x3f3f3f3f3f3f3f3f #define all(x) (x).begin(), (x).end() #define f(i, a, b) for (int i = a; i < (signed)(b); ++i) #define pc __builtin_popcount // counts number of 1's in bin(num) #define pb push_back const double ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
144
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> using namespace std; int N; int sum; int main() { cin >> N; for (int i = 0; i < N; i++) { if ((i + 1) % 3 != 0 && (i + 1) % 5 != 0) { sum += i + 1; } } cout << sum << endl; }
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> using namespace std; int N; long long sum; int main() { cin >> N; for (int i = 0; i < N; i++) { if ((i + 1) % 3 != 0 && (i + 1) % 5 != 0) { sum += i + 1; } } cout << sum << endl; }
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96]]
1
80
#include <stdio.h> typedef long long ll; int main() { ll N; scanf("%lld", &N); ll sum = 0; for (int i = 0; i < N; i++) { if (!(i % 5 == 0 || i % 3 == 0)) sum += i; } printf("%lld", sum); }
#include <stdio.h> typedef long long ll; int main() { ll N; scanf("%lld", &N); ll sum = 0; for (int i = 1; i <= N; i++) { if (!(i % 5 == 0 || i % 3 == 0)) sum += i; } printf("%lld", sum); }
[["-", 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 <bits/stdc++.h> using namespace std; int main() { long long int a, i, sum = 0; cin >> a; for (i = 0; i < a; i++) { if (i % 3 == 0 || i % 5 == 0) continue; else sum = sum + i; } cout << sum; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long int a, i, sum = 0; cin >> a; for (i = 1; i <= a; i++) { if (i % 3 == 0 || i % 5 == 0) continue; else sum = sum + i; } cout << sum; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
72
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N; cin >> N; long long ans = 0; rep(i, N) { if (i % 3 == 0 or i % 5 == 0) continue; ans += i; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N; cin >> N; long long ans = 0; rep(i, N + 1) { if (i % 3 == 0 or i % 5 == 0) continue; ans += i; } cout << ans << endl; }
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
67
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <vector> typedef long long int ll; using namespace std; #define P 1000000007 #define rep(i, n) for (i = 0; i < n; ++i) #define repp(i, a, n) for (i = a; i < n; ++i) #define repr(i, a, n) for (i = a; i >= n; --i) #define pb push_back #define mp m...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <vector> typedef long long int ll; using namespace std; #define P 1000000007 #define rep(i, n) for (i = 0; i < n; ++i) #define repp(i, a, n) for (i = a; i < n; ++i) #define repr(i, a, n) for (i = a; i >= n; --i) #define pb push_back #define mp m...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
284
n = int(input()) s = 0 for i in range(n): if i % 3 != 0: if i % 5 != 0: s = s + i print(s)
n = int(input()) s = 0 for i in range(1,n+1): if i % 3 != 0: if i % 5 != 0: s = s + i print(s)
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
42
n = int(input()) a = 0 for i in range(n): if (i+1)%3!=0 and (i+1)%5!=0: a = a + (i+1) print(n)
n = int(input()) a = 0 for i in range(n): if (i+1)%3!=0 and (i+1)%5!=0: a = a + (i+1) print(a)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
53
#include <bits/stdc++.h> using namespace std; #define ll = long long int #define REP(i, n) for (int i = 0; i < (n); i++) #define REP2(i, x, n) for (int i = x; i < (n); i++) #define REP3(i, x, n) for (int i = x; i > (n); i--) #define ALL(n) begin(n), end(n) struct cww { cww() { ios::sync_with_stdio(false); cin...
#include <bits/stdc++.h> using namespace std; #define ll = long long int #define REP(i, n) for (int i = 0; i < (n); i++) #define REP2(i, x, n) for (int i = x; i < (n); i++) #define REP3(i, x, n) for (int i = x; i > (n); i--) #define ALL(n) begin(n), end(n) struct cww { cww() { ios::sync_with_stdio(false); cin...
[["+", 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
145
x = int(input()) ans = 0 for i in range(x+1): if (i%3 != 0) and (i%5 != 0): a += i print(a)
x = int(input()) ans = 0 for i in range(x+1): if (i%3 != 0) and (i%5 != 0): ans += i print(ans)
[["-", 0, 57, 64, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 31, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
45
#include <bits/stdc++.h> #define select(_1, _2, x, ...) x #define repn(i, n) for (int i = 0; i < (n); i++) #define repr(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, ...) select(__VA_ARGS__, repr, repn)(i, __VA_ARGS__) #define rrepn(i, n) for (int i = (n - 1); i >= 0; i--) #define rrepr(i, a, b) for (int i...
#include <bits/stdc++.h> #define select(_1, _2, x, ...) x #define repn(i, n) for (int i = 0; i < (n); i++) #define repr(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, ...) select(__VA_ARGS__, repr, repn)(i, __VA_ARGS__) #define rrepn(i, n) for (int i = (n - 1); i >= 0; i--) #define rrepr(i, a, b) for (int i...
[["+", 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
292
#include <bits/stdc++.h> using namespace std; using ll = long long; #define ALL(obj) (obj).begin(), (obj).end() #define SPEED \ cin.tie(0); \ ios::sync_with_stdio(false); template <cla...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define ALL(obj) (obj).begin(), (obj).end() #define SPEED \ cin.tie(0); \ ios::sync_with_stdio(false); template <cla...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
938
n=gets.to_i r = (0..n).select{|x| x % 3==0 || x%5==0}.sum print r
n=gets.to_i r = (0..n).select{|x| x % 3!=0 && x%5!=0}.sum print r
[["-", 196, 196, 8, 734, 0, 738, 31, 738, 17, 60], ["+", 196, 196, 8, 734, 0, 738, 31, 738, 17, 79], ["-", 486, 652, 196, 196, 8, 734, 0, 738, 17, 106], ["+", 486, 652, 196, 196, 8, 734, 0, 738, 17, 98], ["-", 196, 196, 8, 734, 0, 738, 12, 738, 17, 60], ["+", 196, 196, 8, 734, 0, 738, 12, 738, 17, 79]]
4
34
N = int(input()) c = 0 for i in range(1, N+1): if i % 3 != 0 and i%5 != 0: c += i print(i)
N = int(input()) c = 0 for i in range(1, N+1): if i % 3 != 0 and i%5 != 0: c += i print(c)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
43
N = int(input()) def FizzBuzz(n): if n % 3 == 0 or n % 5 == 0: return 0 else: return n ans = sum(list(map(FizzBuzz, range(N)))) print(ans)
N = int(input()) def FizzBuzz(n): if n % 3 == 0 or n % 5 == 0: return 0 else: return n ans = sum(list(map(FizzBuzz, range(1, N+1)))) print(ans)
[["+", 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
54
n = int(input()) list = [i for i in range(1, n) if i % 3 != 0] list_2 = [i for i in list if i % 5 != 0] print(sum(list_2))
n = int(input()) list = [i for i in range(1, n + 1) if i % 3 != 0] list_2 = [i for i in list if i % 5 != 0] print(sum(list_2))
[["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]]
5
50
N = int(input()) fizzbuzz = [] for i in range(1,N): if i % 5 != 0 and i % 3 != 0: fizzbuzz.append(i) print(sum(fizzbuzz))
N = int(input()) fizzbuzz = [] for i in range(1,N+1): if i % 5 != 0 and i % 3 != 0: fizzbuzz.append(i) print(sum(fizzbuzz))
[["+", 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; typedef unsigned long long ULL; typedef long long LL; #define FOR(i, a, b) for (LL i = (LL)(a); i < (LL)(b); i++) #define REP(i, x) for (LL i = 0; i < (LL)(x); i++) int main() { ios::sync_with_stdio(false); cin.tie(NULL); // cout << fixed << setprecision(10); LL n ...
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ULL; typedef long long LL; #define FOR(i, a, b) for (LL i = (LL)(a); i < (LL)(b); i++) #define REP(i, x) for (LL i = 0; i < (LL)(x); i++) int main() { ios::sync_with_stdio(false); cin.tie(NULL); // cout << fixed << setprecision(10); LL n ...
[["+", 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
110
#include <iostream> #include <string> #include <vector> using namespace std; int main(void) { int n; cin >> n; vector<int> a; for (int i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) { a.push_back(i); } } long long int ans = 0; for (int i = 0; i < a.size(); i++) { ans += a[i]; }...
#include <iostream> #include <string> #include <vector> using namespace std; int main(void) { int n; cin >> n; vector<int> a; for (int i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) { a.push_back(i); } } unsigned long long int ans = 0; for (int i = 0; i < a.size(); i++) { 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], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
110
n = int(input()) l = [] for i in range (1, n+1): if i % 3 == 0 or i % 5 == 0: l.append(i) print(sum(l))
n = int(input()) l = [] for i in range (1, n+1): if i % 3 != 0 and i % 5 != 0: l.append(i) print(sum(l))
[["-", 8, 196, 0, 57, 15, 679, 31, 666, 667, 60], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 667, 79], ["-", 0, 7, 8, 196, 0, 57, 15, 679, 17, 354], ["+", 0, 7, 8, 196, 0, 57, 15, 679, 17, 355], ["-", 8, 196, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 667, 79]]
5
50
#include <algorithm> #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(a) (a).begin(), (a).end() using namespace std; using Graph = vector<vector<int>>; typedef long long ll; const int mod = 1e+9 + 7; int main() { ll N; cin >> N; ll sum = 0; for (int i = 1; i < N; i++) { ...
#include <algorithm> #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(a) (a).begin(), (a).end() using namespace std; using Graph = vector<vector<int>>; typedef long long ll; const int mod = 1e+9 + 7; int main() { ll N; cin >> N; ll sum = 0; for (int i = 1; i <= N; i++) { ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
106
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int sum = 0; for (int i = 1; i <= n; i++) { if ((i % 3 != 0) && (i % 5 != 0)) sum += i; } cout << sum; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; long long int sum = 0; for (long long int i = 1; i <= n; i++) { if ((i % 3 != 0) && (i % 5 != 0)) sum += i; } cout << sum; return 0; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96]]
1
69
N = int(input()) s = 0 for i in range(1,N): if (i % 15 != 0)&(i % 3 != 0)&(i % 5 != 0): s += i print(s)
N = int(input()) s = 0 for i in range(1,N+1): if (i % 15 != 0)&(i % 3 != 0)&(i % 5 != 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
53
N=int(input()) Sum=0 for i in range(N): if i%3==0 or i%5==0: Sum+=0 continue else: Sum+=i print(Sum)
N=int(input()) Sum=0 for i in range(N+1): if i%3==0 or i%5==0: Sum+=0 continue 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
45
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int sum = 0; for (int i = 1; i <= N; i++) { if (i % 5 != 0 && i % 3 != 0) { sum = sum + i; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long int N; cin >> N; long int sum = 0; for (int i = 1; i <= N; i++) { if (i % 5 != 0 && i % 3 != 0) { sum = sum + i; } } cout << sum << endl; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
68
#include <stdio.h> int main() { long long n; scanf("%lld", &n); int i; long long ans = 0; for (i = 0; i < n; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } printf("%lld", ans); return 0; }
#include <stdio.h> int main() { long long n; scanf("%lld", &n); int i; long long ans = 0; for (i = 1; i <= n; i++) { if (i % 3 != 0 && i % 5 != 0) ans += i; } printf("%lld\n", ans); return 0; }
[["-", 0, 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, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
76
//#include <bits/stdc++.h> #include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; typedef vector<int> VI; typedef vector<VI> VVI; //例: VVI dp(10, vector<int>(10, INF); typedef priority_queue<int, vector<int>, less<int>> QUE_int; cons...
//#include <bits/stdc++.h> #include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; typedef vector<int> VI; typedef vector<VI> VVI; //例: VVI dp(10, vector<int>(10, INF); typedef priority_queue<int, vector<int>, less<int>> QUE_int; cons...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
780
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(0); cin.tie(0); ll n, sum = 0; cin >> n; for (ll i = 1; i < n; i++) { if (i % 5 != 0 && i % 3 != 0) sum += i; } cout << sum; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(0); cin.tie(0); ll n, sum = 0; cin >> n; for (ll i = 1; i <= n; i++) { if (i % 5 != 0 && i % 3 != 0) 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
83
a = int(input()) n = 0 for i in range(1, a): if i % 15 == 0: continue if i % 5 == 0: continue if i % 3 == 0: continue n += i print(n)
a = int(input()) n = 0 for i in range(1, a+1): if i % 15 == 0: continue if i % 5 == 0: continue if i % 3 == 0: continue n += i print(n)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
52
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; typedef pair<int, int> P; int main() { ll N; cin >> N; ll sum = 0; rep(i, N) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; typedef pair<int, int> P; int main() { ll N; cin >> N; ll sum = 0; rep(i, N + 1) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } cout << sum << endl; }
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
80
import java.util.*; class Main { Scanner sc = new Scanner(System.in); public static void main(String[] args) { Main m = new Main(); m.run(); } private void run() { int n = sc.nextInt(); long sum = 0; for (int i = 0; i < n; i++) { if (i % 3 == 0 || i % 5 == 0) continue; ...
import java.util.*; class Main { Scanner sc = new Scanner(System.in); public static void main(String[] args) { Main m = new Main(); m.run(); } private void run() { int n = sc.nextInt(); long sum = 0; for (int i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) continue; ...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
3
114
#include <bits/stdc++.h> using namespace std; int main(void) { int n; cin >> n; unsigned long long sum = 0; for (int i = 0; i < n; i++) { if (!(i % 3 == 0 || i % 5 == 0)) sum += i; } cout << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { int n; cin >> n; unsigned long long sum = 0; for (int i = 0; i <= n; i++) { if (!(i % 3 == 0 || i % 5 == 0)) sum += i; } cout << sum << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
73
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int sum = 0; for (int i = 1; i < n + 1; i++) { if (i % 15 == 0) continue; else if (i % 3 == 0) continue; else if (i % 5 == 0) continue; else { sum += i; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long sum = 0; for (int i = 1; i < n + 1; i++) { if (i % 15 == 0) continue; else if (i % 3 == 0) continue; else if (i % 5 == 0) continue; else { sum += i; } } cout << sum << endl; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13]]
1
87
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; int ans = 0; for (int i = 1; i <= n; i++) { if (i % 5 != 0 && i % 3 != 0) { 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 % 5 != 0 && i % 3 != 0) { ans += i; } } cout << ans << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96]]
1
67
#include <iostream> int main(int argc, char **argv) { int num, sum = 0; std::cin >> num; for (int i = 0; i <= num; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } std::cout << sum << std::endl; return 0; }
#include <iostream> int main(int argc, char **argv) { long long num, sum = 0; std::cin >> num; for (long long i = 0; i <= num; i++) { if (i % 3 != 0 && i % 5 != 0) { sum += i; } } std::cout << sum << std::endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 39, 86, 0, 96]]
1
77
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define MOD 1000000007 #define test \ int t; \ cin >> t; ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define MOD 1000000007 #define test \ int t; \ cin >> t; ...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
856
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { // 入力 long int N; cin >> N; long int result = 0; for (long int i = 0; i < N; i++) { if (i % 3 != 0 && i % 5 != 0) { result += i; } } cout << result << endl; r...
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { // 入力 long int N; cin >> N; long int result = 0; for (long int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { result += i; } } cout << result << 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
81
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) 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, const T &b) { if (b < a) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) 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, const T &b) { if (b < a) { ...
[["+", 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
165
#include "bits/stdc++.h" using namespace std; using ll = long long; constexpr char endl('\n'); #define FOR(i, l, r) for (size_t i = (l); i < (r); ++i) #define REP(i, n) FOR(i, 0, n) #define INF 100000000000ULL int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); size_t n, sum; cin >> n; ...
#include "bits/stdc++.h" using namespace std; using ll = long long; constexpr char endl('\n'); #define FOR(i, l, r) for (size_t i = (l); i < (r); ++i) #define REP(i, n) FOR(i, 0, n) #define INF 100000000000ULL int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); // size_t n; // cin >> 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
119
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(void) { int N; cin >> N; vector<int> numbers; for (int i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { numbers.push_back(i); } } cout << accumulate(numbers.begin(), numbers.end(), 0) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(void) { ll N; cin >> N; vector<ll> numbers; for (ll i = 1; i <= N; i++) { if (i % 3 != 0 && i % 5 != 0) { numbers.push_back(i); } } cout << accumulate(numbers.begin(), numbers.end(), 0LL) << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 16, 31, ...
1
94
#include <algorithm> #include <bitset> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <vector> using namespace std; // #define for(i,a,b) for (int i=(a);i<(b);++i) typedef long long ll; typedef pair<ll, ll> P; #defin...
#include <algorithm> #include <bitset> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <vector> using namespace std; // #define for(i,a,b) for (int i=(a);i<(b);++i) typedef long long ll; typedef pair<ll, ll> P; #defin...
[["+", 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
125
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(void) { ll n; ll ans = 0; cin >> n; for (ll i = 1; i < n; i++) if (i % 3 != 0 && i % 5 != 0) ans += i; cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(void) { ll n; ll ans = 0; cin >> n; for (ll i = 1; i <= n; i++) if (i % 3 != 0 && i % 5 != 0) 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
72
#include <bits/stdc++.h> #define ll long long int #define li long int #define ull unsigned long long int #define rep(i, a, b) for (i = a; i < b; i++) #define db double #define MOD 1000000007 #define MAX 1000001 #define pb push_back #define mp make_pair #define nl "\n" using namespace std; int main(int argc, char const ...
#include <bits/stdc++.h> #define ll long long int #define li long int #define ull unsigned long long int #define rep(i, a, b) for (i = a; i < b; i++) #define db double #define MOD 1000000007 #define MAX 1000001 #define pb push_back #define mp make_pair #define nl "\n" using namespace std; int main(int argc, char const ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
109
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() using ll = long long; int main() { ll n, i, ans = 0; cin >> n; for (i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) { } else { ans++; } } cout << ans; return 0; }
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() using ll = long long; int main() { ll n, i, ans = 0; cin >> n; for (i = 1; i <= n; i++) { if (i % 3 == 0 || i % 5 == 0) { } else { ans += i; } } cout << ans; return 0; }
[["-", 75, 76, 0, 9, 0, 1, 0, 27, 17, 29], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 107], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 22]]
1
81