//* C++11//////////////////////////////////////////////////////////////////////////////////////////
#include <array>
#include <unordered_map>
//*////////////////////////////////////////////////////////////////////////////////////////////////
#include <fstream>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <set>
#include <queue>
#include <map>
#include <stack>
#include <cmath>
#include <cstring>
#include <bitset>
//////////////////////////////////////////////////////////////////////////////////////////////////
#define P(i,a) for(int i=0;i<a;i++)
#define P2(i,a,b) for (int i=a;i<b;i++)
#define PR(i,a) for (int i=a-1;i>=0;i--)
#define PR2(i,a,b) for (int i=b-1;i>=a;i--)
#define FOREACH(i,t) for(__typeof(t.begin()) i=t.begin();i!=t.end();i++)
#define s size()
#define VI vector<int>
#define PB(a) push_back(a)
#define PII pair<int,int>
#define PLL pair<long long,long long>
#define st first
#define nd second
#define ld long double
#define ll long long
#define MP make_pair
#define MT make_tuple
#define A(a) a.begin(),a.end()
#define cmp_g(t) greater<t>
#define inf numeric_limits<int>::max()
#define llinf numeric_limits<long long>::max()
#define troj tuple <int,int,int>
#define czwor tuple <int,int,int,int>
#define G(a,b) get<a>(b)
#define C(a,siz) memset(a,0, siz*sizeof(a[0]))
//////////////////////////////////////////////////////////////////////////////////////////////////
#define DEBUG
//////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef DEBUG
#define D(a) cerr<<#a<<"="<<a<<"\n"
#define D2(a,b) cerr<<#a<<"="<<a<<" , "; D(b);
#define D3(a,b,c) cerr<<#a<<"="<<a<<" , "; D2(b,c);
#define DP(a) cerr<<#a<<"=["<<a.st<<","<<a.nd<<"]\n";
#define out(a,siz) cerr<<#a<<" [";cerr<<a[0];P2(i,1,siz)cerr<<","<<a[i];cerr<<"]\n";
#define out_it(a) cerr<<#a<<" ["; FOREACH(it69,a){cerr <<" "<<*it69<<" ,";}cerr<<"]\n";
#define out_itP(a) cerr<<#a<<" ["; FOREACH(it69,a){cerr <<" ["<<(*it69).st<<","<<(*it69).nd<<"] ,";}cerr<<"]\n";
#else
#define D(a) (void(0))
#define D2(a,b) (void(0))
#define D3(a,b,c) (void(0))
#define DP(a) (void(0))
#define out(a,siz) (void(0))
#define out_it(a) (void(0))
#define out_itP(a) (void(0))
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
int akt,mini=10001,pom=0,wyn=0,ile;
cin >>ile;
P(i,ile)
{
cin >>akt;
wyn+=akt;
if (akt%2==1)
{mini=min(mini,akt); pom++;}
}
if (pom%2){wyn-=mini;}
if (wyn==0)
{cout <<"NIESTETY\n";}
else
{cout <<wyn;}
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | //* C++11////////////////////////////////////////////////////////////////////////////////////////// #include <array> #include <unordered_map> //*//////////////////////////////////////////////////////////////////////////////////////////////// #include <fstream> #include <iostream> #include <iomanip> #include <algorithm> #include <set> #include <queue> #include <map> #include <stack> #include <cmath> #include <cstring> #include <bitset> ////////////////////////////////////////////////////////////////////////////////////////////////// #define P(i,a) for(int i=0;i<a;i++) #define P2(i,a,b) for (int i=a;i<b;i++) #define PR(i,a) for (int i=a-1;i>=0;i--) #define PR2(i,a,b) for (int i=b-1;i>=a;i--) #define FOREACH(i,t) for(__typeof(t.begin()) i=t.begin();i!=t.end();i++) #define s size() #define VI vector<int> #define PB(a) push_back(a) #define PII pair<int,int> #define PLL pair<long long,long long> #define st first #define nd second #define ld long double #define ll long long #define MP make_pair #define MT make_tuple #define A(a) a.begin(),a.end() #define cmp_g(t) greater<t> #define inf numeric_limits<int>::max() #define llinf numeric_limits<long long>::max() #define troj tuple <int,int,int> #define czwor tuple <int,int,int,int> #define G(a,b) get<a>(b) #define C(a,siz) memset(a,0, siz*sizeof(a[0])) ////////////////////////////////////////////////////////////////////////////////////////////////// #define DEBUG ////////////////////////////////////////////////////////////////////////////////////////////////// #ifdef DEBUG #define D(a) cerr<<#a<<"="<<a<<"\n" #define D2(a,b) cerr<<#a<<"="<<a<<" , "; D(b); #define D3(a,b,c) cerr<<#a<<"="<<a<<" , "; D2(b,c); #define DP(a) cerr<<#a<<"=["<<a.st<<","<<a.nd<<"]\n"; #define out(a,siz) cerr<<#a<<" [";cerr<<a[0];P2(i,1,siz)cerr<<","<<a[i];cerr<<"]\n"; #define out_it(a) cerr<<#a<<" ["; FOREACH(it69,a){cerr <<" "<<*it69<<" ,";}cerr<<"]\n"; #define out_itP(a) cerr<<#a<<" ["; FOREACH(it69,a){cerr <<" ["<<(*it69).st<<","<<(*it69).nd<<"] ,";}cerr<<"]\n"; #else #define D(a) (void(0)) #define D2(a,b) (void(0)) #define D3(a,b,c) (void(0)) #define DP(a) (void(0)) #define out(a,siz) (void(0)) #define out_it(a) (void(0)) #define out_itP(a) (void(0)) #endif ////////////////////////////////////////////////////////////////////////////////////////////////// using namespace std; int main() { ios_base::sync_with_stdio(0); int akt,mini=10001,pom=0,wyn=0,ile; cin >>ile; P(i,ile) { cin >>akt; wyn+=akt; if (akt%2==1) {mini=min(mini,akt); pom++;} } if (pom%2){wyn-=mini;} if (wyn==0) {cout <<"NIESTETY\n";} else {cout <<wyn;} } |
English