fork download
  1. /*
  2.   Cred : SunnyYeahBoi
  3.   It's my last chance (⌐■_■)
  4.   Problem :
  5. */
  6.  
  7. #include<bits/stdc++.h>
  8.  
  9. using namespace std;
  10.  
  11. #define int long long
  12. #define double long double
  13. #define endl "\n"
  14. #define NAME "a"
  15.  
  16. const int MAXN = 1e6 + 5;
  17. const int inf = 1e18;
  18. const int MOD = 1e9 + 7;
  19.  
  20. void FileInput(){
  21. if(fopen(NAME".inp" , "r") == NULL)
  22. freopen(NAME".inp" , "w" , stdout);
  23. freopen(NAME".inp" , "r" , stdin);
  24. freopen(NAME".out" , "w" , stdout);
  25. }
  26.  
  27. int n;
  28. int a[MAXN];
  29.  
  30. void solve(){
  31. cin >> n;
  32. for(int i = 1 ; i <= n ; i++)
  33. cin >> a[i];
  34.  
  35. int Min = inf;
  36. // giá trị cực kỳ lớn - inf
  37. // đặt bằng 1 giá trị trong mảng
  38.  
  39. for(int i = 1 ; i <= n ; i++)
  40. Min = min(Min , a[i]);
  41.  
  42. for(int i = 1 ; i <= n ; i++)
  43. if(a[i] == Min)
  44. cout << i << " ";
  45. }
  46.  
  47. int32_t main(){
  48. //FileInput();
  49. ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  50. int t = 1;
  51. // cin >> t;
  52. while(t--)
  53. solve();
  54. return 0;
  55. }
  56.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty