problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p03048
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; for (int i = 0; i <= N / R; ++i) { for (int j = 0; j <= N / G; ++j) { for (int k = 0; k <= N / B; ++k) { if (R * i + G * j + B ...
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; for (int i = 0; i <= N / R; ++i) { for (int j = 0; j <= N / G; ++j) { if ((N - R * i - G * j) % B == 0 && (N - R * i - G * j) / B >= 0)...
replace
10
14
10
12
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; #define fastio() \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; #define fastio() \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
replace
64
69
64
66
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int RR = N / R + 1; int GG = N / G + 1; int BB = N / B + 1; int count = 0; for (int i = 0; i < RR; i++) { for (int j = 0; j < (N - R * i) / G + 1; j++) { for (int k = 0; k < (N - R ...
#include <iostream> #include <vector> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int RR = N / R + 1; int GG = N / G + 1; int BB = N / B + 1; int count = 0; for (int i = 0; i < RR; i++) { for (int j = 0; j < (N - R * i) / G + 1; j++) { if ((N - R * i - G * j) % B...
replace
14
21
14
16
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int r, g, b, n, ans = 0; cin >> r >> g >> b >> n; for (int i = 0; i <= n / r; i++) { for (int j = 0; j <= (n - i * r) / g; j++) { for (int k = 0; k <= (n - i * r - j * g) / b; k++) { if (i * r + j * g + k * b == n) { ans++; ...
#include <iostream> using namespace std; int main() { int r, g, b, n, ans = 0; cin >> r >> g >> b >> n; for (int i = 0; i <= n / r; i++) { for (int j = 0; j <= (n - i * r) / g; j++) { if ((n - i * r - j * g) % b == 0) { ans++; } } } cout << ans << endl; return 0; }
replace
8
12
8
10
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int r, g, b, n; cin >> r >> g >> b >> n; int ans = 0; for (int i = 0; i * r <= n; i++) { for (int j = 0; j * g <= (n - i * r); j++) { for (int k =...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int r, g, b, n; cin >> r >> g >> b >> n; int ans = 0; for (int i = 0; i * r <= n; i++) { for (int j = 0; j * g <= (n - i * r); j++) { /*for(int k ...
replace
12
21
12
23
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int r, g, b, count = 0; for (r = 0; r * R <= N; r++) { for (g = 0; r * R + g * G <= N; g++) { for (b = 0; r * R + g * G + b * B <= N; b++) { if (r * R + g * G + b * B == N) { count++; ...
#include <iostream> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int r, g, b, count = 0; for (r = 0; r * R <= N; r++) { for (g = 0; r * R + g * G <= N; g++) { if ((N - r * R - g * G) % B == 0) { count++; } } } cout << count << endl; return 0; }
replace
10
14
10
12
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int r, g, b, n, i, j, k, ans = 0; cin >> r >> g >> b >> n; for (i = 0; i <= n / r; i++) { for (j = 0; j <= n - i * r && j <= n / g; j++) { for (k = 0; k <= n - i * r - j * g && k <= n / b; k++) { if (i * r + j * g + k * b == n) { ...
#include <bits/stdc++.h> using namespace std; int main() { int r, g, b, n, i, j, k, ans = 0; cin >> r >> g >> b >> n; for (i = 0; i <= n / r; i++) { for (j = 0; j <= n - i * r; j++) { if ((n - (i * r + j * g)) % b == 0 && n - (i * r + j * g) >= 0) { ans++; } } } cout << ans << e...
replace
8
13
8
11
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> int main() { int R, G, B, N; scanf("%d %d %d %d", &R, &G, &B, &N); int r, g, b, cnt; cnt = 0; for (r = 0; r * R <= N; r++) { for (g = 0; r * R + g * G <= N; g++) { for (b = 0; r * R + g * G + B * b <= N; b++) { if (R * r + G * g + B * b == N) { cnt++; ...
#include <iostream> int main() { int R, G, B, N; scanf("%d %d %d %d", &R, &G, &B, &N); int r, g, b, cnt; for (r = 0; R * r <= N; r++) { for (g = 0; R * r + G * g <= N; g++) { if ((N - (R * r + G * g)) % B == 0) { cnt++; } } } printf("%d", cnt); return 0; }
replace
9
17
9
13
TLE
p03048
Python
Time Limit Exceeded
R, G, B, N = map(int, input().split()) ans = 0 for i in range(N // R + 1): N_R = N - i * R for j in range(N_R // G + 1): N_RG = N_R - j * G for k in range(N_RG // B + 1): N_RGB = N_RG - k * B if N_RGB == 0: ans += 1 print(ans)
R, G, B, N = map(int, input().split()) ans = 0 for i in range(N // R + 1): for j in range((N - i * R) // G + 1): if (N - i * R - j * G) % B == 0: ans += 1 print(ans)
replace
4
11
4
7
TLE
p03048
Python
Time Limit Exceeded
R, G, B, N = map(int, input().split()) ans = 0 for i in range(int(N / R) + 1): for j in range(int((N - i * R) / G) + 1): if (N - (i * R + j * G)) % B == 0 and (N - (i * R + j * G)) >= 0: ans += 1 print(ans)
R, G, B, N = map(int, input().split()) ans = 0 for i in range(int(N / R) + 1): for j in range(int((N - i * R) / G) + 1): if (N - (i * R + j * G)) % B == 0: ans += 1 print(ans)
replace
5
6
5
6
TLE
p03048
Python
Time Limit Exceeded
R, G, B, N = map(int, input().split()) LIM = 3003 ans = 0 for r in range(LIM): for g in range(LIM): if R * r + G * g > N: break Bb = N - R * r - G * g if Bb % B == 0: ans += 1 print(ans)
def solve(): R, G, B, N = map(int, input().split()) LIM = 3001 ans = 0 for r in range(LIM): for g in range(LIM): if R * r + G * g > N: break Bb = N - R * r - G * g if Bb % B == 0: ans += 1 return ans print(solve())
replace
0
11
0
15
TLE
p03048
Python
Time Limit Exceeded
R, G, B, N = map(int, input().split()) res = 0 for i in range(N // R + 1): for j in range(N // G + 1): b = N - R * i - G * j if b >= 0 and b % B == 0: res += 1 print(res)
R, G, B, N = map(int, input().split()) res = 0 for i in range(N // R + 1): for j in range((N - R * i) // G + 1): b = N - R * i - G * j if b >= 0 and b % B == 0: res += 1 print(res)
replace
5
6
5
6
TLE
p03048
Python
Time Limit Exceeded
# from time import perf_counter def main(): r, g, b, n = list(map(int, input().split())) count = 0 x1, x2, x3 = sorted([r, g, b], reverse=True) # print(x1, x2, x3) for i in range(n // x1 + 1): for j in range((n - i) // x2 + 1): for k in range((n - i - j) // x3 + 1): ...
# from time import perf_counter def main(): r, g, b, n = list(map(int, input().split())) count = 0 x1, x2, x3 = sorted([r, g, b], reverse=True) # print(x1, x2, x3) for i in range(n // x1 + 1): for j in range((n - i) // x2 + 1): rest = n - (x1 * i) - (x2 * j) # print...
replace
10
14
10
22
TLE
p03048
Python
Time Limit Exceeded
r, g, b, n = map(int, input().split()) ans = 0 for i in range(n // r + 1): for j in range(n // g + 1): m = r * i + g * j if m <= n and (n - m) % b == 0: ans += 1 print(ans)
r, g, b, n = map(int, input().split()) ans = 0 for i in range(n // r + 1): for j in range(n // g + 1): m = r * i + g * j if m <= n and (n - m) % b == 0: ans += 1 elif m > n: break print(ans)
insert
8
8
8
10
TLE
p03048
Python
Time Limit Exceeded
#!/usr/bin/env python3 import sys read = sys.stdin.buffer.read # input = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines a, b, c, n = map(int, input().split()) ans = 0 for i in range(3001): for j in range(3001): if n <= i * a + j * b and (n - i * a - j * b) % c == 0: ans += 1 p...
#!/usr/bin/env python3 import sys read = sys.stdin.buffer.read # input = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines a, b, c, n = map(int, input().split()) ans = 0 for i in range(3001): for j in range(3001): if n >= i * a + j * b and (n - i * a - j * b) % c == 0: ans += 1 p...
replace
10
11
10
11
TLE
p03048
Python
Time Limit Exceeded
r, g, b, n = map(int, input().split()) ans = 0 nr = n // r ng = n // g for i in range(nr + 1): for j in range(ng + 1): tmp = n - i * r - j * g if tmp % b == 0 and tmp >= 0: ans += 1 print(ans)
r, g, b, n = map(int, input().split()) ans = 0 nr = n // r ng = n // g for i in range(nr + 1): for j in range(ng + 1): tmp = n - i * r - j * g if tmp >= 0 and tmp % b == 0: ans += 1 print(ans)
replace
7
8
7
8
TLE
p03048
Python
Time Limit Exceeded
r, g, b, n = map(int, input().split()) c = sorted([r, g, b])[::-1] ans = 0 for i in range(n // c[0] + 1): for j in range((n - i * r) // c[1] + 1): x = n - i * c[0] - j * c[1] if x >= 0 and x % c[2] == 0: ans += 1 print(ans)
r, g, b, n = map(int, input().split()) c = sorted([r, g, b])[::-1] ans = 0 for i in range(n // c[0] + 1): x = n - i * c[0] for j in range(x // c[1] + 1): y = x - j * c[1] if y < 0: break elif y % c[2] == 0: ans += 1 print(ans)
replace
4
7
4
10
TLE
p03048
Python
Time Limit Exceeded
R, G, B, N = map(int, input().split()) ans = 0 for r in range(min(3000, 3000 // R) + 1): for g in range(min(3000, 3000 // G) + 1): v = R * r + G * g if N >= v and (N - v) % B == 0: ans += 1 print(ans)
R, G, B, N = map(int, input().split()) ans = 0 for r in range(min(3000, 3000 // R) + 1): if R * r <= N: for g in range(min(3000, 3000 // G) + 1): v = R * r + G * g if N >= v and (N - v) % B == 0: ans += 1 print(ans)
replace
4
8
4
9
TLE
p03048
Python
Time Limit Exceeded
R, G, B, N = map(int, input().split()) ans = 0 for r in range(3001): if R * r > N: break for g in range(3001): if R * r + G * g > N: break elif (N - (R * r + G * g)) % B == 0: ans += 1 print(ans)
R, G, B, N = map(int, input().split()) ans = 0 for r in range(N // R + 1): for g in range((N - R * r) // G + 1): if (N - (R * r + G * g)) % B == 0: ans += 1 print(ans)
replace
2
9
2
5
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N, count = 0; cin >> R >> G >> B >> N; for (int i = 0; i <= N / R; i++) { for (int j = 0; j <= (N - i * R) / G; j++) { for (int k = 0; k <= (N - i * R - j * G) / B; k++) { if (i * R + j * G + k * B == N) count++;...
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N, count = 0; cin >> R >> G >> B >> N; for (int i = 0; i <= N / R; i++) { for (int j = 0; j <= (N - i * R) / G; j++) { if ((N - i * R - j * G) % B == 0) count++; } } cout << count << endl; }
replace
9
13
9
11
TLE
p03048
Python
Time Limit Exceeded
R, G, B, N = map(int, input().split()) counter = 0 for r in range((N // R) + 1): for g in range(((N - (r * R)) // G) + 1): w_b_sum = N - ((R * r) + (G * g)) if w_b_sum % B == 0 and w_b_sum >= 0 and w_b_sum == N - ((R * r) + (G * g)): # print(r, g, (w_b_sum // B)) counter +=...
R, G, B, N = map(int, input().split()) counter = 0 for r in range((N // R) + 1): for g in range(((N - (r * R)) // G) + 1): w_b_sum = N - ((R * r) + (G * g)) if w_b_sum % B == 0 and w_b_sum >= 0: # print(r, g, (w_b_sum // B)) counter += 1 print(counter)
replace
7
8
7
8
TLE
p03048
Python
Time Limit Exceeded
r, g, b, n = map(int, input().split()) cnt = 0 for i in range(3001): for j in range(3001): x = n - (r * i + g * j) if x < 0: continue if x % b == 0: cnt += 1 print(cnt)
r, g, b, n = map(int, input().split()) cnt = 0 for i in range(int(n // r) + 1): r_num = r * i for j in range(int((n - r_num) // g) + 1): g_num = g * j b_num = n - r_num - g_num if b_num >= 0 and b_num % b == 0: cnt += 1 print(cnt)
replace
3
9
3
9
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <numeric> #include <string> #include <unordered_map> #include <vector> using namespace std; int R, G, B, N; int main() { cin >> R >> G >> B >> N; int ans = 0; for (int r = 0; r * R <= N; r++) { for (int g = 0; g * G <= N; g++) { for ...
#include <algorithm> #include <cmath> #include <iostream> #include <numeric> #include <string> #include <unordered_map> #include <vector> using namespace std; int R, G, B, N; int main() { cin >> R >> G >> B >> N; int ans = 0; for (int r = 0; r * R <= N; r++) { for (int g = 0; g * G <= N; g++) { if (...
replace
18
24
18
20
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int r, g, b, n; cin >> r >> g >> b >> n; long long count = 0; for (int i = 0; i <= n / r; i++) for (int j = 0; j <= n / g; j++) for (int k = 0; k <= n / b; k++) ...
#include <algorithm> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int r, g, b, n; cin >> r >> g >> b >> n; long long count = 0; for (int i = 0; i <= n / r; i++) for (int j = 0; j <= n / g; j++) if ((n - i * r - j * g) % b == 0 and n - ...
replace
15
18
15
17
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define ll long long // const int INF = 1e8; typedef pair<int, int> P; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; queue<P> que; int main(void) { int a, b, c, n; cin >> a >> b >> c >> n; ll sum = 0; for (int ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define ll long long // const int INF = 1e8; typedef pair<int, int> P; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; queue<P> que; int main(void) { int a, b, c, n; cin >> a >> b >> c >> n; ll sum = 0; for (int ...
replace
17
21
17
22
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long int llint; typedef pair<int, int> pii; typedef pair<llint, llint> pll; typedef vector<int> vi; typedef vector<llint> vl; typedef vector<pii> vii; typedef vector<pll> vll; #define ci cin #define co cout #define en endl #define ln cout << '\n' #define rep...
#include <bits/stdc++.h> using namespace std; typedef long long int llint; typedef pair<int, int> pii; typedef pair<llint, llint> pll; typedef vector<int> vi; typedef vector<llint> vl; typedef vector<pii> vii; typedef vector<pll> vll; #define ci cin #define co cout #define en endl #define ln cout << '\n' #define rep...
replace
47
51
47
49
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; for (int rr = 0; rr < N / R + 1; rr++) { for (int gg = 0; gg < (N - R * rr) / G + 1; gg++) { for (int bb = 0; bb < (N - R * rr - G * gg) / B + 1; bb++) { if...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; for (int rr = 0; rr < N / R + 1; rr++) { for (int gg = 0; gg < (N - R * rr) / G + 1; gg++) { if ((N - R * rr - G * gg) % B == 0) ans++; } } cout << ...
replace
12
16
12
14
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int just_count = 0; for (int i = 0; i * R <= N; i++) { for (int j = 0; j * G <= N; j++) { for (int k = 0; k * B <= N; k++) { if (i * R + j * G + k * B == N) { just_count++; } ...
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int just_count = 0; for (int i = 0; i * R <= N; i++) { for (int j = 0; j * G <= N; j++) { int remainder = i * R + j * G; if ((N - remainder) % B == 0 && N - remainder >= 0) { just_count++...
replace
9
13
9
12
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; for (int i = 0; i <= (3000 / R); i++) { /...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; for (int i = 0; i <= 3000; i++) { // iはRの数 ...
replace
17
25
17
22
TLE
p03048
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N, ct, r, g, b; cin >> R >> G >> B >> N; ct = 0; for (r = 0; r * R <= N; r++) { for (g = 0; g * G <= N - r * R; g++) { ct = ((N - r * R + g * G) % b == 0) ? ct + 1 : ct; } } cout << ct << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N, ct, r, g, b; cin >> R >> G >> B >> N; ct = 0; for (r = 0; r * R <= N; r++) { for (g = 0; g * G <= N - r * R; g++) { ct = ((N - r * R - g * G) % B == 0) ? ct + 1 : ct; } } cout << ct << endl; return 0; }
replace
9
10
9
10
0
p03048
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <...
insert
80
80
80
82
0
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int answer = 0; for (int i = 0; i * R <= N; i++) { for (int j = 0; j * G <= N; j++) { for (int k = 0; k * B <= N; k++) { if (i * R + j * G + k * B == N) { answer++; } } ...
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int answer = 0; for (int i = 0; i * R <= N; i++) { for (int j = 0; j * G <= N; j++) { if ((N - i * R - j * G) >= 0 && (N - i * R - j * G) % B == 0) { answer++; } } } cout << answer...
replace
8
12
8
10
TLE
p03048
Python
Runtime Error
def inpl(): return list(map(int, input().split())) def gcd(a, b): # greatest common divisor la = max(a, b) sm = min(a, b) if la % sm == 0: return sm else: return gcd(sm, la - sm) def lcm(a, b): # least common multiple return a * b // gcd(a, b) R, G, B, N = inpl() an...
def inpl(): return list(map(int, input().split())) def gcd(a, b): # greatest common divisor la = max(a, b) sm = min(a, b) if la % sm == 0: return sm else: return gcd(sm, la - sm) def lcm(a, b): # least common multiple return a * b // gcd(a, b) import sys sys.setrec...
insert
19
19
19
24
0
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <stdio.h> #define LIM_S 200002 #define LIM_N 200001 char str[LIM_S]; int R, G, B, N; int A[LIM_N]; void receive_input() { fgets(str, sizeof(str), stdin); sscanf(str, "%d %d %d %d", &R, &G, &B, &N); } void initialize() {} int main(void) { receive_input(); initialize(); int ...
#include <algorithm> #include <stdio.h> #define LIM_S 200002 #define LIM_N 200001 char str[LIM_S]; int R, G, B, N; int A[LIM_N]; void receive_input() { fgets(str, sizeof(str), stdin); sscanf(str, "%d %d %d %d", &R, &G, &B, &N); } void initialize() {} int main(void) { receive_input(); initialize(); int ...
replace
27
33
27
32
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { int R, G, B, N; cin >> R >> G >> B >> N; long long ans = 0; for (int i = 0; i < N / R + 1; i++) { for (int j = 0; j < N / G + 1; j++) { for (int k = 0; k < N / B + 1; k++) { if (i * R + j * G + k * B == N) {...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { int R, G, B, N; cin >> R >> G >> B >> N; long long ans = 0; for (int i = 0; i < N / R + 1; i++) { for (int j = 0; j < N / G + 1; j++) { for (int k = 0; k < N / B + 1; k++) { if (i * R + j * G + k * B == N) {...
insert
19
19
19
22
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, ini, n) for (int i = ini; i < n; i++) #define _rep(i, ini, n) for (int i = ini; i >= n; i--) #define ToEnd(a) a.begin(), a.end() uint64_t MOD = 1000000007; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int64_t ans = 0; rep(r, 0, N / R + 1) {...
#include <bits/stdc++.h> using namespace std; #define rep(i, ini, n) for (int i = ini; i < n; i++) #define _rep(i, ini, n) for (int i = ini; i >= n; i--) #define ToEnd(a) a.begin(), a.end() uint64_t MOD = 1000000007; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int64_t ans = 0; rep(r, 0, N / R + 1) {...
replace
14
18
14
16
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; vector<int> cnt; for (int i = 0; i <= N; i++) { int sum = 0; if (i * R > N) break; for (int j = 0; j <= N; j++) { if (i * R + j * G > N) break; ...
#include <iostream> #include <vector> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; vector<int> cnt; for (int i = 0; i <= N; i++) { int sum = 0; if (i * R > N) break; for (int j = 0; j <= N; j++) { if (i * R + j * G > N) break; ...
replace
27
36
27
29
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int res = 0; for (int i = 0; i <= N / R; i++) { for (int j = 0; j <= N / G; j++) { for (int k = 0; k <= N / B; k++) { if (R * i + G * j + B * k == N) res++; } } } cout << re...
#include <iostream> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int res = 0; for (int i = 0; i <= N / R; i++) { for (int j = 0; j <= N / G; j++) { int t = R * i + G * j; if (N >= t && (N - t) % B == 0) res++; } } cout << res << endl; return 0; }
replace
10
14
10
13
TLE
p03048
C++
Time Limit Exceeded
#include <iomanip> #include <iostream> typedef long long ll; using namespace std; const ll INF = 1e9; const ll MOD = 1e9 + 7; #define repi(i, n, init) for (ll i = init; i < (n); i++) int main() { int r, g, b, n, ans = 0; cin >> r >> g >> b >> n; repi(i, n / r + 1, 0) { repi(j, n / g + 1, 0) { repi(k, n...
#include <iomanip> #include <iostream> typedef long long ll; using namespace std; const ll INF = 1e9; const ll MOD = 1e9 + 7; #define repi(i, n, init) for (ll i = init; i < (n); i++) int main() { int r, g, b, n, ans = 0; cin >> r >> g >> b >> n; repi(i, n / r + 1, 0) { repi(j, n / g + 1, 0) { if ((n - ...
replace
13
17
13
15
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < (n); i++) #define REPR(i, n) for (ll i = (n); i >= 0; i--) #define FOR(i, m, n) for (ll i = (m); i < (n); i++) #define FORR(i, m, n) for (ll i = (m); i >= (n); i--) #define INF 1e9 #define ALL(x) (x).begin(), (x)....
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < (n); i++) #define REPR(i, n) for (ll i = (n); i >= 0; i--) #define FOR(i, m, n) for (ll i = (m); i < (n); i++) #define FORR(i, m, n) for (ll i = (m); i >= (n); i--) #define INF 1e9 #define ALL(x) (x).begin(), (x)....
replace
24
31
24
30
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N, a = 0; cin >> R >> G >> B >> N; for (int i = 0; i * R <= N; i++) { for (int j = 0; i * R + j * G <= N; j++) { for (int k = 0; i * R + j * G + k * B <= N; k++) { if (i * R + j * G + k * B == N) { a++; } ...
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N, a = 0; cin >> R >> G >> B >> N; for (int i = 0; i * R <= N; i++) { for (int j = 0; i * R + j * G <= N; j++) { if ((N - i * R - j * G) % B == 0) { a++; } } } cout << a << endl; }
replace
8
12
8
10
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; int main(void) { int r, g, b, n; int ans = 0; int o, p, q; cin >> r >> g >> b >> n; o = n / r + 1; p = n / g + 1; q = n / b + 1; for (int i = 0; i < n / r + 1; i++) { for (int j =...
#pragma GCC optimize("Ofast") #include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; int main(void) { int r, g, b, n; int ans = 0; int o, p, q; cin >> r >> g >> b >> n; o = n / r + 1; p = n / g + 1; q = n / b + 1; for (int i = 0; i < n /...
insert
0
0
0
2
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N; cin >> R; cin >> G; cin >> B; cin >> N; int ans = 0; int maxR = N / R; for (int r = 0; r <= maxR; r++) { int maxG = (N - R * r) / G; for (int g = 0; g <= maxG; g++) { int maxB = (N - R * r - G * g); for (in...
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N; cin >> R; cin >> G; cin >> B; cin >> N; int ans = 0; int maxR = N / R; for (int r = 0; r <= maxR; r++) { int maxG = (N - R * r) / G; for (int g = 0; g <= maxG; g++) { if ((N - R * r - G * g) % B == 0) { a...
replace
16
21
16
18
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int ans = 0, R, G, B, N; cin >> R >> G >> B >> N; for (int i = 0; i < N / R + 1; i++) { if (i * R > N) { break; } for (int j = 0; j < N / G + 1; j++) { if (i * R + j * G > N) { break; } for (int k = 0; k < N / ...
#include <bits/stdc++.h> using namespace std; int main() { int ans = 0, R, G, B, N; cin >> R >> G >> B >> N; for (int i = 0; i < N / R + 1; i++) { if (i * R > N) { break; } for (int j = 0; j < N / G + 1; j++) { if (i * R + j * G > N) { break; } if (R * i + G * j <= N a...
replace
14
21
14
16
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace ::std; typedef long long lint; typedef long double ldouble; #define rep(i, n) for (lint i = 0; i < (lint)(n); i++) #define repi(i, a, b) for (lint i = lint(a); i < lint(b); i++) #define rep2(i, a, b, c) for (lint i = lint(a); i > lint(b); i += c) #define all(x) (x).begin(), (x)....
#include <bits/stdc++.h> using namespace ::std; typedef long long lint; typedef long double ldouble; #define rep(i, n) for (lint i = 0; i < (lint)(n); i++) #define repi(i, a, b) for (lint i = lint(a); i < lint(b); i++) #define rep2(i, a, b, c) for (lint i = lint(a); i > lint(b); i += c) #define all(x) (x).begin(), (x)....
replace
130
132
130
132
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int r, g, b, n; cin >> r >> g >> b >> n; int ans = 0; for (int i = 0; i <= (n + r - 1) / r; i++) { for (int q = 0; q <= (n + g - 1) / g; q++) { for (int p = 0; p <= (n + b - 1) / b; p++) { if (i * r + q * g + p * b == n) { a...
#include <bits/stdc++.h> using namespace std; int main() { int r, g, b, n; cin >> r >> g >> b >> n; int ans = 0; for (int i = 0; i <= 3000; i++) { for (int q = 0; q <= 3000; q++) { int as = n - r * i - q * g; if (as >= 0 && as % b == 0) { ans++; } } } cout << ans << endl; ...
replace
7
13
7
12
TLE
p03048
C++
Time Limit Exceeded
#include <stdio.h> int main() { int i, j, k; int r, g, b, n; int xp, cnt = 0; scanf("%d%d%d%d", &r, &g, &b, &n); for (i = 0; i <= n; i++) { for (j = 0; j <= n; j++) { for (k = 0; k <= n; k++) { xp = (i * r) + (j * g) + (k * b); if (n == xp) cnt++; } } } printf...
#include <stdio.h> int main() { int i, j, k; int r, g, b, n; int xp, cnt = 0; scanf("%d%d%d%d", &r, &g, &b, &n); for (i = 0; i <= 3000; i++) { for (j = 0; j <= 3000; j++) { if ((n - (i * r) - (j * g)) >= 0 && (n - (i * r) - (j * g)) % b == 0) { cnt++; } } } printf("%d\n", cnt);...
replace
6
12
6
10
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef pair<long long, long long...
#include <algorithm> #include <bitset> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef pair<long long, long long...
replace
33
37
33
38
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int P = N / R + 1; int Q = N / G + 1; int S = N / B + 1; int Ans = 0; for (int r = 0; r <= P; r++) { for (int g = 0; g <= Q; g++) { if (r * R + g * G > N) { break; } for (int ...
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int P = N / R + 1; int Q = N / G + 1; int S = N / B + 1; int Ans = 0; for (int r = 0; r <= P; r++) { for (int g = 0; g <= Q; g++) { if (r * R + g * G > N) { break; } if ((N - ...
replace
15
22
15
17
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define MAX 100000 const long long INF = 1145141919, MOD = 1e9 + 7; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; const double EPS = 1e-9; // 許容誤差。問題によって変える // typedef complex<double> P; // Point // typedef vector<P> VP; //単純...
#include <bits/stdc++.h> using namespace std; #define MAX 100000 const long long INF = 1145141919, MOD = 1e9 + 7; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; const double EPS = 1e-9; // 許容誤差。問題によって変える // typedef complex<double> P; // Point // typedef vector<P> VP; //単純...
replace
47
51
47
49
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <utility> #include <vector> #define ll long long using namespace std; using p = pair<ll, ll>; ll dx[4] = {-1, 0, 1, 0}; ll dy[4] = {0, 1, 0, -1}; int main(void) { ...
#include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <utility> #include <vector> #define ll long long using namespace std; using p = pair<ll, ll>; ll dx[4] = {-1, 0, 1, 0}; ll dy[4] = {0, 1, 0, -1}; int main(void) { ...
replace
20
27
20
25
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #define long long long using namespace std; int main() { int r, g, b, N; cin >> r >> g >> b >> N; int maxv = max(max(r, g), b); int minc = N / maxv; int count = 0; for (int i = 0; i <= N; i++) { for (int j = 0; j <= N; j++) { for (int k = 0; k <= N...
#include <algorithm> #include <iostream> #define long long long using namespace std; int main() { int r, g, b, N; cin >> r >> g >> b >> N; int maxv = max(max(r, g), b); int minc = N / maxv; int count = 0; for (int i = 0; i <= N; i++) { for (int j = 0; j <= N; j++) { if (N >= i * r + j * g...
replace
21
29
21
23
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iostream> #include <queue> #include <sstream> #include <stdexcept> #include <stdio.h> #include <string> #include <vector> #define cinf(n, x) \ for (int i = 0; i < n; i++) ...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iostream> #include <queue> #include <sstream> #include <stdexcept> #include <stdio.h> #include <string> #include <vector> #define cinf(n, x) \ for (int i = 0; i < n; i++) ...
replace
25
31
25
28
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main(void) { int R, G, B, N; cin >> R >> G >> B >> N; int count = 0; for (int r = 0; r <= N / R; r++) { for (int g = 0; g <= N / G; g++) { for (int b = 0; b <= N / B; b++) { if (R * r + G * g + B * b == N) { count++; } } ...
#include <iostream> using namespace std; int main(void) { int R, G, B, N; cin >> R >> G >> B >> N; int count = 0; for (int r = 0; r <= N; r += R) { for (int g = 0; g <= N; g += G) { int b = N - r - g; if (b >= 0 && b % B == 0) { count++; } } } cout << count << endl; r...
replace
9
15
9
14
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define initdp(a, b) \ for (int i = 0; i <= a; i++) \ for (int j =...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define initdp(a, b) \ for (int i = 0; i <= a; i++) \ for (int j =...
replace
50
57
50
53
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int R, G, B, N; cin >> R >> G >> B >> N; int ball[3] = {R, G, B}; sort(ball, ball + 3); int answer = 0; for (int i = 0; N >= ball[2] * i; i++) { for (int j = 0; N >= ball[2] * i + ball[1] * j; j...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int R, G, B, N; cin >> R >> G >> B >> N; int ball[3] = {R, G, B}; sort(ball, ball + 3); int answer = 0; for (int i = 0; N >= ball[2] * i; i++) { for (int j = 0; N >= ball[2] * i + ball[1] * j; j...
replace
18
22
18
20
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> // minmax, sort, swap #include <climits> // INT_MIN, LLONG_MIN #include <cmath> // long, trig, pow #include <cstdio> // printf, scanf #include <iostream> // cin, cout, cerr, clog #include <map> // key-value pairs sorted by keys #include <numeric> // iot...
#include <algorithm> // minmax, sort, swap #include <climits> // INT_MIN, LLONG_MIN #include <cmath> // long, trig, pow #include <cstdio> // printf, scanf #include <iostream> // cin, cout, cerr, clog #include <map> // key-value pairs sorted by keys #include <numeric> // iot...
replace
26
29
26
28
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <math.h> #include <set> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int r, g, b, n; cin >> r >> g >> b >> n; int ans = 0; int i, j, k; for (i = 0; i * r <= n; i++) { for (j = 0; j * g <= (n - r * i); j++) { ...
#include <algorithm> #include <iostream> #include <math.h> #include <set> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int r, g, b, n; cin >> r >> g >> b >> n; int ans = 0; int i, j, k; for (i = 0; i * r <= n; i++) { for (j = 0; j * g <= (n - r * i); j++) { ...
replace
16
20
16
18
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main(void) { int s[3], n, sum = 0; cin >> s[0] >> s[1] >> s[2] >> n; for (int i = 0; i <= n; i++) { for (int j = 0; j <= n; j++) { for (int k = 0; k <= n; k++) { if (s[0] * i + s[1] * j + s[2] * k == n) sum++; } } } cout << su...
#include <iostream> using namespace std; int main(void) { int r, g, b, n, sum = 0; cin >> r >> g >> b >> n; for (int i = 0; r * i <= n; i++) { for (int j = 0; r * i + g * j <= n; j++) { int k = n - r * i - g * j; if (k % b == 0) sum++; } } cout << sum << endl; return 0; }
replace
4
12
4
11
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) using ll = long long; using P = pair<ll, ll>; int main() { ll R, G, B, n; cin >> R >> G >> B >> n; ll r = n / R, g = n / G, b = n / B, sum = 0; rep(i, r + 1) { rep(j, g + 1) { rep(k, b + 1) { if (i * R ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) using ll = long long; using P = pair<ll, ll>; int main() { ll R, G, B, n; cin >> R >> G >> B >> n; ll r = n / R, g = n / G, b = n / B, sum = 0; rep(i, r + 1) { rep(j, g + 1) { ll a = n - (i * R + j * G); ...
replace
12
16
12
15
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int count = 0; for (int r = 0; r <= N / R; r++) { for (int g = 0; g <= N / G; g++) { for (int b = 0; b <= N / B; b++) { if (R * r + G * g + B * b == N) { count++; } } } ...
#include <iostream> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int count = 0; for (int r = 0; r <= N / R; r++) { for (int g = 0; g <= N / G; g++) { int tmp = N - R * r - G * g; if (tmp % B == 0 && tmp >= 0 && tmp / B >= 0) { count++; } } } ...
replace
10
14
10
13
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define INF 1e9 #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(a) (a).begin(), (a).end() ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> #define INF 1e9 #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(a) (a).begin(), (a).end() ...
replace
62
66
62
64
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <stdio.h> #include <string.h> #include <vector> #define MOD 1e9 + 7; #define INF 1e17 + 9; #define PI acos(-1); using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; long long cnt = 0; for (int r = 0; r ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <stdio.h> #include <string.h> #include <vector> #define MOD 1e9 + 7; #define INF 1e17 + 9; #define PI acos(-1); using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; long long cnt = 0; for (int r = 0; r ...
replace
22
27
22
26
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; template <c...
#include <algorithm> #include <array> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; template <c...
replace
53
57
53
55
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; using vll = vector<vl>; using Pll = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(v) v.begin(), v.end() #define sz(x) ((int)x.size()) #define pb push_back #define mp make_pai...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; using vll = vector<vl>; using Pll = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(v) v.begin(), v.end() #define sz(x) ((int)x.size()) #define pb push_back #define mp make_pai...
replace
38
44
38
42
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1LL << 60; const ll MOD = 1e9 + 7; int main() { double R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; for (int r = 0; r * R <= N; r++) { for (int g = 0; g * G <= N; g++) { for (int b = 0; b * B <= N; b++) { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1LL << 60; const ll MOD = 1e9 + 7; int main() { double R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; for (int r = 0; r * R <= N; r++) { for (int g = 0; g * G + r * R <= N; g++) { int tmp = (N - r * R - g * G) / B;...
replace
12
17
12
16
TLE
p03048
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <float.h> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #inclu...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <float.h> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #inclu...
replace
42
44
42
47
-8
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; int main() { int r, b, g, n; cin >> r >> b >> g >> n; ; int ans = 0; for (int i = 0; i <= n; i += r) { for (int j = 0; j <= n; j += b) { for (int k = 0; k <= n; k += ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; int main() { int r, b, g, n; cin >> r >> b >> g >> n; ; int ans = 0; for (int i = 0; i <= n; i += r) { for (int j = 0; j <= n; j += b) { int p = 0; if (n >= i +...
replace
18
20
18
23
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <limits> #include <sstream> #include <string> #include <deque> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int R, G, B, N; cin >> R >> G >> B ...
#include <algorithm> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <limits> #include <sstream> #include <string> #include <deque> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int R, G, B, N; cin >> R >> G >> B ...
replace
32
38
32
36
TLE
p03048
C++
Time Limit Exceeded
#include <climits> #include <cstdio> #include <cstdlib> #include <iostream> #include <string> #include <vector> using namespace std; int main(void) { int r, g, b, n; cin >> r >> g >> b >> n; int ct = 0; for (int ri = 0; ri * r <= n; ri++) { for (int gi = 0; gi * g <= n; gi++) { for (int bi = 0; bi...
#include <climits> #include <cstdio> #include <cstdlib> #include <iostream> #include <string> #include <vector> using namespace std; int main(void) { int r, g, b, n; cin >> r >> g >> b >> n; int ct = 0; for (int ri = 0; ri * r <= n; ri++) { for (int gi = 0; ri * r + gi * g <= n; gi++) { int diff =...
replace
16
24
16
20
TLE
p03048
C++
Time Limit Exceeded
#pragma GCC optimize("Ofast") #include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int R, G, B, N; cin >> R >> G >> B >> N; long long cnt = 0; if (R == 1 && G == 1 && B == 1 && N == 3000) { cout << 4504501 << endl; } for (int a = 0; a <= N; a += R) { ...
#pragma GCC optimize("Ofast") #include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int R, G, B, N; cin >> R >> G >> B >> N; long long cnt = 0; if (R == 1 && G == 1 && B == 1 && N == 3000) { cout << 4504501 << endl; return 0; } for (int a = 0; a <= ...
insert
11
11
11
12
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <complex> #include <fstream> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int cn...
#include <algorithm> #include <complex> #include <fstream> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int cn...
replace
21
25
21
24
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N; int count = 0; cin >> R >> G >> B >> N; int r_max = N / R, g_max = N / G, b_max = N / B; for (int i = 0; i <= r_max; i++) { for (int j = 0; j <= g_max; j++) { for (int k = 0; k <= b_max; k++) { if (i * R + j * G + k...
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N; int count = 0; cin >> R >> G >> B >> N; int r_max = N / R, g_max = N / G, b_max = N / B; for (int i = 0; i <= r_max; i++) { for (int j = 0; j <= (N - i * R) / G; j++) { if ((N - i * R - j * G) % B == 0) { count++; ...
replace
10
15
10
13
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, n; cin >> R >> G >> B >> n; int rm, gm, bm; rm = n / R; gm = n / G; bm = n / B; int count = 0; for (int i = 0; i <= rm; i++) { for (int j = 0; j <= gm; j++) { if (i * R + j * G > n) break; for (int k = 0; k <...
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, n; cin >> R >> G >> B >> n; int rm, gm, bm; rm = n / R; gm = n / G; bm = n / B; int count = 0; for (int i = 0; i <= rm; i++) { for (int j = 0; j <= gm; j++) { if (i * R + j * G > n) break; if ((n - (i * R + j...
replace
14
20
14
16
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N, cnt = 0; cin >> R >> G >> B >> N; for (int r = 0; r <= N / R; r++) { for (int g = 0; g <= (N - r) / G; g++) { for (int b = 0; b <= (N - r - g) / B; b++) { if (R * r + G * g + B * b == N) cnt++; } } ...
#include <bits/stdc++.h> using namespace std; int main() { int R, G, B, N, cnt = 0; cin >> R >> G >> B >> N; for (int r = 0; r <= N / R; r++) { for (int g = 0; g <= (N - r * R) / G; g++) { if ((N - (R * r + G * g)) % B == 0) cnt++; } } cout << cnt << endl; }
replace
7
12
7
10
TLE
p03048
C++
Time Limit Exceeded
/* �����悭�ǂ����I �_���I�ɍl���悤�I �T���v�����m�F���悤! ��΂ɒ��߂�ȁI �H�v������I �z��͏������߂ɂƂ��Ă��� Twitter�͏I���܂Ń��O�A�E�g�I �i�ԈႦ�ĉ�@���c�C�[�g���Ă͂����Ȃ�����j */ // include #include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <cstring> #include <deque...
/* �����悭�ǂ����I �_���I�ɍl���悤�I �T���v�����m�F���悤! ��΂ɒ��߂�ȁI �H�v������I �z��͏������߂ɂƂ��Ă��� Twitter�͏I���܂Ń��O�A�E�g�I �i�ԈႦ�ĉ�@���c�C�[�g���Ă͂����Ȃ�����j */ // include #include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <cstring> #include <deque...
replace
99
106
99
104
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using lint = long long; template <class T = int> using V = vector<T>; template <class T = int> using VV = V<V<T>>; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int R, G, B, N; cin >> R >> G >> B >> N; lint res = 0; for (int r = 0; R * r <= N; ++r...
#include <bits/stdc++.h> using namespace std; using lint = long long; template <class T = int> using V = vector<T>; template <class T = int> using VV = V<V<T>>; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int R, G, B, N; cin >> R >> G >> B >> N; lint res = 0; for (int r = 0; R * r <= N; ++r...
replace
14
17
14
15
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; for (int i = 0; i <= N / R; i++) { for (int j = 0; j <= N / G; j++) { if (R * i + G * j > N) { break; } for (int k = 0; k <= N / B; k++) { if (R * i + G * j + B * k =...
#include <iostream> using namespace std; int main() { int R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; for (int i = 0; i <= N / R; ++i) { for (int j = 0; j <= N / G; ++j) { int tmp = R * i + G * j; if (N - tmp >= 0) { if ((N - tmp) % B == 0) { ans += 1; } } ...
replace
6
17
6
12
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i <= (n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; using namespace std; int main() { ll r, g, b, n; cin >> r >> g >> b >> n; int ans = 0; rep(i, n / r) { rep(j, n / g) { rep(k, n / b) { i...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i <= (n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; using namespace std; int main() { ll r, g, b, n; cin >> r >> g >> b >> n; int ans = 0; rep(i, n / r) { rep(j, n / g) { if ((n - i * r - j * g) >...
replace
13
17
13
15
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll r, g, b, n; cin >> r >> g >> b >> n; ll ans = 0; for (ll i = 0; i <= n / r; i++) { for (ll j = 0; j <= (n - r * i) / g; j++) { for (ll k = 0; k <= (n - r * i - g * j) / b; k++) { if (r * i + g * j + b * k == n)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll r, g, b, n; cin >> r >> g >> b >> n; ll ans = 0; for (ll i = 0; i <= n / r; i++) { for (ll j = 0; j <= (n - r * i) / g; j++) { if ((n - r * i - g * j) % b == 0) { ans++; } } } cout << ans << endl;...
replace
9
13
9
11
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; for (int i = 0; i * R <= N; i++) { for (int j = 0; j * G <= N - i * R; j++) { for (int k = 0; k * B <= N - i * R - j * G; k++) { if (i * R...
#include <iostream> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int R, G, B, N; cin >> R >> G >> B >> N; int ans = 0; for (int i = 0; i * R <= N; i++) { for (int j = 0; j * G <= N - i * R; j++) { if ((N - i * R - j * G) % B == 0) ans++; } } cout <...
replace
13
17
13
15
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> #define N 3001 using namespace std; int ans = 0; void dfs(int sum, int r, int g, int b, int n) { // r < g < b if (sum > n) return; for (int i = 0; i < n / b + 1; i++) { if (sum == n - i * b) ans++; if (sum > n - i * b) break; } if (sum + r <= n) dfs(sum + r, r,...
#include <iostream> #define N 3001 using namespace std; int ans = 0; void dfs(int sum, int r, int g, int b, int n) { // r < g < b if (sum > n) return; if ((n - sum) % b == 0) ans++; if (sum + r <= n) dfs(sum + r, r, g, b, n); if (sum + g <= n) dfs(sum + g, N, g, b, n); } int main(void) { i...
replace
9
15
9
11
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define Abs(x) ((x) < 0 ? (x) * -1 : (x)) #define rep(x, y) for ((x) = 0; (x) < (y); (x)++) #define repin(x, y) for ((x) = 0; (x) <= (y); (x)++) #define nep(x, y) for ((x) = (y)-1; 0 <= (x); (x)--) #define nepi(x, y,...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define Abs(x) ((x) < 0 ? (x) * -1 : (x)) #define rep(x, y) for ((x) = 0; (x) < (y); (x)++) #define repin(x, y) for ((x) = 0; (x) <= (y); (x)++) #define nep(x, y) for ((x) = (y)-1; 0 <= (x); (x)--) #define nepi(x, y,...
replace
195
206
195
199
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long R, G, B, N; cin >> R >> G >> B >> N; long long ans = 0; for (int i = 0; i <= N / R; i++) { for (int j = 0; j <= N / G; j++) { for (int k = 0; k <= N / B; k++) { if (R * i + G * j + k * B == N) { ans++; } ...
#include <bits/stdc++.h> using namespace std; int main() { long long R, G, B, N; cin >> R >> G >> B >> N; long long ans = 0; for (int i = 0; i <= N; i++) { for (int j = 0; j <= N; j++) { int X = N - R * i - G * j; if (X % B == 0 && X >= 0) { ans++; } } } cout << ans << end...
replace
7
13
7
12
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int r, g, b, n; cin >> r >> g >> b >> n; int ans = 0; for (int i = 0; i < n / r + 1; i++) { for (int j = 0; j < (n - i * r) / g + 1; j++) { for (int k = 0; k < (n - i * r - j * g) / b + 1; k++) { ...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int r, g, b, n; cin >> r >> g >> b >> n; int ans = 0; for (int i = 0; i < n / r + 1; i++) { for (int j = 0; j < (n - i * r) / g + 1; j++) { int tmp = n; tmp -= i * r + j * g; if (tmp % ...
replace
11
19
11
15
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { int r, g, b, n; std::cin >> r >> g >> b >> n; int num = 0; rep(i, n / r + 1) { rep(j, n / g + 1) { rep(k, n / b + 1) { if (r * i + g * j + b * k == n) { num++; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { int r, g, b, n; std::cin >> r >> g >> b >> n; int num = 0; rep(i, n / r + 1) { rep(j, n / g + 1) { int t = r * i + g * j; if ((n - t) % b == 0 && t <= n) { num++; } ...
replace
13
17
13
16
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; int main(void) { // Your code here! int R, G, B, N; cin >> R; cin >> G; cin >> B; cin >> N; int count = 0; for (int r = 0; r <= N / R; r++) { for (int g = 0; g <= (N - r * R) / G; g++) { for (int b = 0; b <= (N - r * R - g * G) / B; b+...
#include <iostream> #include <string> using namespace std; int main(void) { // Your code here! int R, G, B, N; cin >> R; cin >> G; cin >> B; cin >> N; int count = 0; if (R == 1 && G == 1 && B == 1 && N == 3000) { count = 4504501; } else { for (int r = 0; r <= N / R; r++) { for (int g = 0...
replace
11
16
11
20
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int r, g, b, n; cin >> r >> g >> b >> n; int ans = 0; for (int i = 0; i <= n; i++) { if (i * r <= n) { for (int j = 0; j <= n; j++) { if (i * r + j * g <= n) for (int k = 0; k <=...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int r, g, b, n; cin >> r >> g >> b >> n; int ans = 0; for (int i = 0; i <= n; i++) { if (i * r <= n) { for (int j = 0; j <= n; j++) { if ((n - (i * r + j * g)) % b == 0 && (n - (i * r + j ...
replace
12
16
12
14
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define repr(i, n) for (int i = (int)n - 1; i >= 0; --i) #define ALL(a) (a).begin(), (a).end() const ll mod = 1e9 + 7; int main() { int r,...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define repr(i, n) for (int i = (int)n - 1; i >= 0; --i) #define ALL(a) (a).begin(), (a).end() const ll mod = 1e9 + 7; int main() { int r,...
replace
14
17
14
16
TLE
p03048
C++
Time Limit Exceeded
#include <stdio.h> int main() { int R, G, B, N, r, g, b; while (scanf("%d %d %d %d", &R, &G, &B, &N) != EOF) { int cnt = 0; int tb = 0, tr = 0, tg = 0; for (r = 0, tr = 0; tr <= N; r++, tr += R) { for (g = 0, tg = 0; tg <= N - tr; g++, tg += G) { for (b = 0, tb = 0; tb <= N - tg - tr; b++...
#include <stdio.h> int main() { int R, G, B, N, r, g, b; while (scanf("%d %d %d %d", &R, &G, &B, &N) != EOF) { int cnt = 0; int tb = 0, tr = 0, tg = 0; for (r = 0, tr = 0; tr <= N; r++, tr += R) { for (g = 0, tg = 0; tg <= N - tr; g++, tg += G) { if ((N - tg - tr) % B == 0) { cn...
replace
9
13
9
11
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int a[3], b[3]; int n; int main() { cin >> a[0] >> a[1] >> a[2] >> n; sort(a, a + 3); int ans = 0; for (int i = n / a[0]; i >= 0; i--) for (int j = (n - i * a[0]) / a[1]; j >= 0; j--) for (int k = (n - i * a[0] - j * a[1]) / a[2]; k >= 0; k--) { if...
#include <bits/stdc++.h> using namespace std; int a[3], b[3]; int n; int main() { cin >> a[0] >> a[1] >> a[2] >> n; sort(a, a + 3); int ans = 0; int df = -1, di = -1; if (a[0] == a[1]) { df = 2; di = 1; } else { if (a[0] == a[2]) { df = 1; di = 2; } else if (a[1] == a[2]) d...
replace
8
14
8
35
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int red, green, blue; int ways = 0; int N; cin >> red >> green >> blue >> N; for (int i = 0; i <= N; i += red) { for (int j = 0; j <= N; j += green) { for (int k = 0; k <= N; k += blue) { if (i + j + k == N) { ways++; ...
#include <bits/stdc++.h> using namespace std; int main() { int red, green, blue; int ways = 0; int N; cin >> red >> green >> blue >> N; for (int i = 0; i <= N; i += red) { for (int j = 0; j <= N; j += green) { if ((N - i - j) % blue == 0 && (N - i - j) / blue >= 0) { ways++; } } ...
replace
9
13
9
11
TLE
p03048
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int R, G, B, N; int ans = 0; cin >> R >> G >> B >> N; for (int i = 0; i <= N; i++) { if (R * i <= N) { for (int j = 0; j <= N; j++) { if (R * i + G * j <= N) { for (int k = 0; k <= N; k++) { if (R * i + G * j + B * k ...
#include <iostream> using namespace std; int main() { int R, G, B, N; int ans = 0; cin >> R >> G >> B >> N; for (int i = 0; i <= N; i++) { if (R * i <= N) { for (int j = 0; j <= N; j++) { if (R * i + G * j <= N) { if ((N - R * i - G * j) % B == 0) { ans++; } ...
replace
11
16
11
13
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <iomanip> #include <iostream> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; int main(void) { int r, g, b, n, count = 0; cin >> r >> g >> b >> n; for (int i = 0; i <= n / r; i++) { for (int j = 0; j <= n / g; j++) { for (int q...
#include <algorithm> #include <iomanip> #include <iostream> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; int main(void) { int r, g, b, n, count = 0; cin >> r >> g >> b >> n; for (int i = 0; i <= n / r; i++) { for (int j = 0; j <= n / g; j++) { if (n - i ...
replace
14
18
14
18
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int r, g, b, n, an = 0; cin >> r >> g >> b >> n; for (int i = 0; i <= (n / r); i++) for (int j = 0; j <= ((n - i * r) / g); j++) for (int k = 0; k <= ((n - i * r - j * g) / b); k++) if ((i * r + j * g + k * b) == n) an++; cou...
#include <bits/stdc++.h> using namespace std; int main() { int r, g, b, n, an = 0; cin >> r >> g >> b >> n; int a, c, p, q; a = n / r; for (int i = 0; i <= (n / r); i++) { c = (n - i * r) / g; for (int j = 0; j <= c; j++) { p = n - i * r - j * g; if (p % b == 0) an++; } } ...
replace
5
10
5
16
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <string> using namespace std; #define int long long #define mod 1000000007 signed main() { int r, g, b, n; cin >> r >> g >> b >> n; int count = 0; for (int i = 0; i <= n / r; i++) { for (int j = 0; j <= n...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <string> using namespace std; #define int long long #define mod 1000000007 signed main() { int r, g, b, n; cin >> r >> g >> b >> n; int count = 0; for (int i = 0; i <= n / r; i++) { for (int j = 0; j <= n...
replace
15
18
15
17
TLE
p03048
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> #define repd(i, a, b) for (ll i = (a); i < (b); i++) #define rep(i, n) repd(i, ...
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> #define repd(i, a, b) for (ll i = (a); i < (b); i++) #define rep(i, n) repd(i, ...
replace
29
35
29
33
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define ll long long #define P pair<ll, ll> #define all(v) (v).begin(), (v).end() const ll mod = 1e9 + 7; const ll INF = 1e18; const double pi = acos(-1); int main(void) { ll r, g, b, n, cnt = 0; c...
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define ll long long #define P pair<ll, ll> #define all(v) (v).begin(), (v).end() const ll mod = 1e9 + 7; const ll INF = 1e18; const double pi = acos(-1); int main(void) { ll r, g, b, n, cnt = 0; c...
replace
15
28
15
19
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) using namespace std; using P = pair<int, int>; typedef long long ll; int main() { int r, g, b, n; cin >> r >> g >> b >> n; long ans = 0; for (int i = 0; i <= n / r; i++) { fo...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) using namespace std; using P = pair<int, int>; typedef long long ll; int main() { int r, g, b, n; cin >> r >> g >> b >> n; long ans = 0; for (int i = 0; i <= n / r; i++) { fo...
replace
13
15
13
17
TLE
p03048
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ALL(A) A.begin(), A.end() const long long mod = 1000000007; int main() { int r, g, b, n; cin >> r >> g >> b >> n; int sum = 0, ans = 0; for (int i = 0; i * r <= n; i++) { for (int j = 0; j * g + i * r <= n; j++) { for (int k = 0; k * b + i * r + j ...
#include <bits/stdc++.h> using namespace std; #define ALL(A) A.begin(), A.end() const long long mod = 1000000007; int main() { int r, g, b, n; cin >> r >> g >> b >> n; int sum = 0, ans = 0; for (int i = 0; i * r <= n; i++) { for (int j = 0; i * r + j * g <= n; j++) { if ((n - i * r - j * g) % b == 0) ...
replace
9
13
9
12
TLE