3 solutions

  • 1
    @ 2025-7-13 15:03:39

    #include <bits/stdc++.h> using namespace std;

    int main() { int n, a[200005], x; scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d", &x); if (a[x] == 0) { cout << x << " "; a[x] = 1; } } return 0; }

    • 0
      @ 2025-7-13 15:06:22

      #include <bits/stdc++.h> using namespace std;

      int main() { int n,a[200005],x; scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d",&x); if(a[x]==0){ cout<<x<<" "; a[x]=1; } }

      return 0;
      

      }

      • -1
        @ 2025-7-13 15:02:55

        #include <bits/stdc++.h> using namespace std;

        int main() { int n, a[200005], x; scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d", &x); if ( a[x] == 0) { cout << x << " "; a[x] = 1; } } return 0; }

        • 1

        Information

        ID
        387
        Time
        1000ms
        Memory
        256MiB
        Difficulty
        4
        Tags
        # Submissions
        18
        Accepted
        17
        Uploaded By