Advertisement
PikMike

Untitled

Jun 17th, 2016
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define pb push_back
  4. #define mp make_pair
  5. #define sz size
  6. #define ll long long
  7. #define ld long double
  8. #define fs first
  9. #define sc second
  10. #define forn(i, f, t) for(int i = f; i < t; i++)
  11. #define all(x) (x).begin(), (x).end()
  12. #define ins insert
  13.  
  14. const int INF = 2147483647;
  15. const int MOD = 1000000007;
  16. const ll INF64 = 9223372036854775807;
  17. const ld EPS = 1e-7;
  18.  
  19. using namespace std;
  20.  
  21.  
  22. int main(){
  23.     int a[2], b[2], c[2], d[2], e[2], f[2], ans = INF;
  24.     scanf("%d%d", a, a + 1);
  25.     scanf("%d%d", b, b + 1);
  26.     scanf("%d%d", c, c + 1);
  27.     scanf("%d%d", d, d + 1);
  28.     scanf("%d%d", e, e + 1);
  29.     scanf("%d%d", f, f + 1);
  30.     forn(i, 0, 2)
  31.         forn(j, 0, 2)
  32.             forn(k, 0, 2)
  33.                 forn(l, 0, 2)
  34.                     forn(m, 0, 2)
  35.                         forn(n, 0, 2)
  36.                             if ((a[i] + b[j] + c[k] + d[l] + e[m] + f[n]) % 3 != 0)
  37.                                 ans = min(ans, a[i] + b[j] + c[k] + d[l] + e[m] + f[n]);
  38.     printf("%d\n", (ans == INF ? 0 : ans));
  39.  
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement