Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <set>
- using namespace std;
- set<long long> S;
- long long frecv[4], v[] = {3,4,5,8,10,12,14,32,57,64};
- int main()
- {
- for(int i = 0;i<(1<<20);i++)
- {
- for(int j = 0;j<4;j++)
- frecv[j] = 0;
- for(int j = 0;j<10;j++)
- {
- int nrelem = ((i >> (2*j)) % 4);
- frecv[nrelem] += v[j];
- }
- long long P = frecv[1] + frecv[2] + frecv[3];
- bool valid = true;
- for(int j = 0; j < 3 && valid; j++)
- {
- if(P - 2 * frecv[j + 1] <= 0)
- valid = false;
- if(frecv[j % 3 + 1] >= frecv[(j+1) % 3 + 1] + frecv[(j+2) % 3 + 1])
- valid = false;
- }
- if(valid)
- {
- long long aria = P * (P - 2*frecv[1]) * (P - 2*frecv[2]) * (P - 2*frecv[3]);
- S.insert(aria);
- }
- }
- cout << S.size() << '\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement