Skip to content

Instantly share code, notes, and snippets.

@Hacv16

Hacv16/cabo.cpp Secret

Created October 4, 2023 21:16
Show Gist options
  • Save Hacv16/18a8528566e2de2d4ca9416aebc99bcf to your computer and use it in GitHub Desktop.
Save Hacv16/18a8528566e2de2d4ca9416aebc99bcf to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> v(6);
for(auto &x : v) cin >> x;
int soma = accumulate(v.begin(), v.end(), 0);
bool impasse = false;
for(int i = 0; i < 6; i++)
for(int j = i + 1; j < 6; j++)
for(int k = j + 1; k < 6; k++)
if(soma % 2 == 0 && (v[i] + v[j] + v[k]) == soma / 2) impasse = true;
cout << (impase ? 'S' : 'N') << '\n';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment