MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / floor_sum_super_slow

Function floor_sum_super_slow

code/mathematics/floor_sum.test.cpp:3–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1// Field testing: MIPT 2015, 4J Triangle
2
3ll floor_sum_super_slow(ll n, ll a, ll b, ll c) {
4 if (c < 0) return 0;
5 ll cnt = 0;
6 for (ll x = 0; x <= n; x++) {
7 for (ll y = 0; y <= c; y++) {
8 if (a*x + b*y <= c) {
9 cnt++;
10 }
11 }
12 }
13 return cnt;
14}
15ll floor_sum_slow(ll n, ll a, ll b, ll c) {
16 if (c < 0) return 0;
17 ll cnt = 0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected