fork download
  1. /*input
  2. 5
  3. 1 2 3 4 5
  4. */
  5. #include<bits/stdc++.h>
  6. using namespace std;
  7. const int mod=1e9 + 7;
  8. #define int long long
  9. const int inf=1e18;
  10. #define pii pair<int, int>
  11. #define f first
  12. #define s second
  13. #define mp make_pair
  14. #define FOR(i, n) for(int i=1;i<=n;i++)
  15. #define TRACE(x) cerr << #x << " = " << x << endl
  16. //Trace prints the name of the variable and the value.
  17. void solve()
  18. {
  19. int n;cin>>n;assert(n<=5e5);int mval=inf;set<int> vals;
  20. for(int i=1;i<=n;i++)
  21. {
  22. int cur;cin>>cur;
  23. assert(vals.count(cur)==0);vals.insert(cur);
  24. mval=min(mval, cur);
  25. }
  26. cout<<mval<<endl;
  27. }
  28. signed main()
  29. {
  30. ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
  31. /* freopen("input1.txt", "r", stdin);
  32. freopen("output1.txt", "w", stdout);*/
  33. int t;cin>>t;
  34. while(t--) solve();
  35. }
Runtime error #stdin #stdout #stderr 0s 4240KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog: prog.cpp:19: void solve(): Assertion `n<=5e5' failed.