Untitled
unknown
c_cpp
2 years ago
340 B
6
Indexable
#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;
}Editor is loading...
Leave a Comment