Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
abhilash
#include <bits/stdc++.h> typedef long long ll; typedef long double ld; typedef unsigned long long ul; #define pb push_back #define mp make_pair #define inf (long)1e9 #define eps 1e-9 using namespace std; bool vis[100]; int main(){ std::ios::sync_with_stdio(false); //cin.tie(0); int t; cin>>t; while(t--) { int n; cin>>n; int c[n]; for(int i=0;i<n;i++) cin>>c[i]; sort(c,c+n); int mi=c[0]; bool fl=false; //map<int,bool>mp; for(int i=1;i<n;i++) { if(fl&&mi!=c[i]) { mi=c[i]; fl=false; } if(c[i]==mi) fl=true; } cout<<mi<<endl; } }
run
|
edit
|
history
|
help
0
Elevator 3
Grundy Number
SIP_parser_with_std_regex_need_help_to_improve_it.cc
kroliki
Date n Time Macros
ExceptionHandling4
List add
Eratosfen final
Dar
matrix