Submission #785997

# Submission time Handle Problem Language Result Execution time Memory
785997 2023-07-17T21:44:29 Z Sputnik1234 개미 (GA4_ant) C++14
100 / 100
190 ms 1432 KB
#pragma comment(linker, "/STACK:100000000")
#include <bits/stdc++.h>
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <vector>
#define pb push_back
#define in insert
#define pll pair<ll,ll>
#define vpl vector<pll>
#define vll vector <ll>
#define vl vector<ll>
#define sl set<ll>
#define msl multiset<ll>
#define mll map<ll,ll>
#define mmll multimap<ll,ll>
#define mcl map<char,ll>
#define mp make_pair
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define endl "\n"
#define speed ios_base::sync_with_stdio(false);cin.tie();cout.tie()
#define ll long long
#define ull unsigned long long
#define LMX LLONG_MAX
using namespace std;
#define REP(i, n) for (ll i=0;i<(n);i++)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i, 0, a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i, a) ROF(i, 0, a)
#define rep(a) F0R(_, a)
#define each(a, x) for (auto &a : x)
/*
#pragma omp parallel for
#pragma GCC optimize("0fast")
#pragma GCC target ("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
*/
bool comp(pair <ll,ll> p1,pair <ll,ll> p2)
{
   if(p1.first==p2.first)
   {
      return p1.second>p2.second;
   }
   return p1.first<p2.first;
}
void solve()
{
   ll a,b,c;
   cin>>a>>b>>c;
   ll mini=min({a,b,c});
   ll maxi=max({a,b,c});
   ll orta=a+b+c-maxi-mini;
   cout<<(mini+orta)*(mini+orta)+maxi*maxi<<endl;
}
int main ()
{
   ll t=1;
   cin>>t;
   while(t--)
   {
      solve();
   }
}
 
/*
 
string
length
 
*/
/*
    auto locate = [&](int x) -> int {
        for (int i = 0; i < N; i++)
            if (P[i] == x)
                return i;
 
        return -1;
    };
    function in funcition
*/

Compilation message

ant.cpp:1: warning: ignoring '#pragma comment ' [-Wunknown-pragmas]
    1 | #pragma comment(linker, "/STACK:100000000")
      |
# Verdict Execution time Memory Grader output
1 Correct 150 ms 1016 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 177 ms 1304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 158 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 161 ms 1340 KB Output is correct
2 Correct 185 ms 1324 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 163 ms 1204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 189 ms 1328 KB Output is correct
2 Correct 190 ms 1364 KB Output is correct
3 Correct 178 ms 1432 KB Output is correct
4 Correct 170 ms 1344 KB Output is correct
5 Correct 178 ms 1392 KB Output is correct