1 solutions

  • 0
    @ 2025-3-3 16:24:10

    C++ :

    #include<iostream>
    #include<cstdio>
    using namespace std;
    int a[32777]={0};
    int main()
    {
    	int n,x,first=1;
    	cin>>n;
    	for(int i=1;i<=n;i++) {cin>>x;a[x]++;}
    	for(int i=0;i<=32767;i++)
    	if(a[i]>=1) a[i]=1;
    	for(int i=0;i<=32767;i++)
    		if(a[i]==1)
    		{
    			if(first) first=0;else cout<<" ";
    			cout<<i;
    		}
        return 0;
    }
    
    • 1

    Information

    ID
    10040
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By