Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
340 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main() 
{

  int H, N, M, t, b; cin >> H >> N >> M;
  int  y = 0;
  for (int i = 0; i < M; i++) 
  {
    cin >> b;
    if (b > 0) 
    {
      y += b;
    }
  }
  if ( y >= H)
  {
    cout << y << endl << "VICTORY" << endl;
  }
  else cout << y << endl << "DEFEAT" << endl;
}
Leave a Comment