Submission #64049433
Source Code Expand
Copy
#include<bits/stdc++.h>#define ll long long#define ld long double#define pb push_back#define gcd __gcd#define MOD 998244353#define MOD2 1000000007#define inti __int128_t#define lset 63-__builtin_clzll#define fset __builtin_ctzll#define stcnt __builtin_popcountll#define pll pair<ll,ll>using namespace std;int main(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#include<bits/stdc++.h> #define ll long long #define ld long double #define pb push_back #define gcd __gcd #define MOD 998244353 #define MOD2 1000000007 #define inti __int128_t #define lset 63-__builtin_clzll #define fset __builtin_ctzll #define stcnt __builtin_popcountll #define pll pair<ll,ll> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll t; t=1; while(t--){ ll n; cin>>n; vector<ll>arr(n); ll maxind = -1; ll maxi = 0; map<ll,ll>mp; for(ll i=0;i<n;i++){ cin>>arr[i]; mp[arr[i]]++; } for(ll i=0;i<n;i++){ if(mp[arr[i]]==1){ if(arr[i]>maxi){ maxi=arr[i]; maxind = i+1; } } } cout<<maxind<<endl; } }
Submission Info
Submission Time | |
---|---|
Task | C - Uniqueness |
User | MayankBhakat |
Language | C++ 20 (gcc 12.2) |
Score | 300 |
Code Size | 881 Byte |
Status | AC |
Exec Time | 204 ms |
Memory | 24144 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt |
All | hand_01.txt, hand_02.txt, hand_03.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, sample_01.txt, sample_02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
hand_01.txt | AC | 1 ms | 3492 KB |
hand_02.txt | AC | 1 ms | 3392 KB |
hand_03.txt | AC | 1 ms | 3416 KB |
random_01.txt | AC | 203 ms | 24144 KB |
random_02.txt | AC | 66 ms | 11488 KB |
random_03.txt | AC | 188 ms | 23416 KB |
random_04.txt | AC | 131 ms | 18232 KB |
random_05.txt | AC | 204 ms | 23852 KB |
random_06.txt | AC | 137 ms | 11824 KB |
random_07.txt | AC | 95 ms | 9376 KB |
random_08.txt | AC | 98 ms | 9548 KB |
random_09.txt | AC | 17 ms | 5416 KB |
random_10.txt | AC | 82 ms | 14620 KB |
random_11.txt | AC | 81 ms | 14732 KB |
random_12.txt | AC | 81 ms | 14704 KB |
random_13.txt | AC | 81 ms | 14800 KB |
random_14.txt | AC | 86 ms | 14636 KB |
random_15.txt | AC | 86 ms | 14724 KB |
random_16.txt | AC | 35 ms | 6996 KB |
random_17.txt | AC | 6 ms | 4404 KB |
random_18.txt | AC | 105 ms | 12524 KB |
random_19.txt | AC | 74 ms | 10448 KB |
random_20.txt | AC | 53 ms | 8588 KB |
random_21.txt | AC | 1 ms | 3600 KB |
random_22.txt | AC | 73 ms | 10572 KB |
random_23.txt | AC | 28 ms | 6436 KB |
sample_01.txt | AC | 1 ms | 3508 KB |
sample_02.txt | AC | 1 ms | 3432 KB |