Jeremiah_

ABC_123 - B - Five Dishes

Jun 6th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define SYNC ios::sync_with_stdio(0);
  4. #define F first
  5. #define S second
  6. #define endl '\n'
  7.  
  8.  
  9. using namespace std;
  10.  
  11. using ll = long long int;
  12. using ii = pair<int, int>;
  13. using vii = vector<ii>;
  14. using vi = vector<int>;
  15. using graph = vector<vi>;
  16. const int INF = 0x3f3f3f3f;
  17. const int MAXN = 58;
  18. const ll mod = 1000000007;
  19.  
  20.  
  21.  
  22. int main() {
  23.     SYNC
  24.     int n[5], ans = 0;
  25.     int idx = 0, maxi = 0;
  26.     for (int i = 0; i < 5; ++i) {
  27.         cin >> n[i];
  28.         //cout << "dif: " << abs(n[i]%10 - 10)%10 << endl;
  29.         if (maxi < abs(n[i]%10 - 10)%10) {
  30.             maxi = abs(n[i]%10 - 10)%10;
  31.             idx = i;
  32.         }
  33.         ans += n[i] + abs(n[i]%10 - 10)%10;
  34.         //cout << "ans: " << ans << endl;
  35.     }
  36.     //cout << idx << endl;
  37.     ans -= abs(n[idx]%10 - 10)%10;
  38.     cout << ans << endl;
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment