Submission #64038952
Source Code Expand
Copy
#include <bits/stdc++.h>//#include <atcoder/all>using namespace std;#define rep(i,n) for(ll i=0; i<n; i++)#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)#define rrep(i,n) for(ll i=n-1; i>=0; i--)#define fi first#define se second#define pcnt __builtin_popcountlltypedef long long ll;typedef unsigned long long ull;typedef long double ld;typedef pair<int,int> Pii;typedef pair<ll,ll> Pll;typedef pair<ll,Pll> PlP;template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}string zero_padding(int val, int nf){ ostringstream sout;sout << setfill('0') << setw(nf) << val; return sout.str();};const ld eps = 1e-10;
#include <bits/stdc++.h> //#include <atcoder/all> using namespace std; #define rep(i,n) for(ll i=0; i<n; i++) #define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++) #define rrep(i,n) for(ll i=n-1; i>=0; i--) #define fi first #define se second #define pcnt __builtin_popcountll typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<int,int> Pii; typedef pair<ll,ll> Pll; typedef pair<ll,Pll> PlP; template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; } template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; } template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";} template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);} string zero_padding(int val, int nf){ ostringstream sout;sout << setfill('0') << setw(nf) << val; return sout.str();}; const ld eps = 1e-10; const ll INF = 1e18; ull mo = 1000000007; ld PI=asin(1)*2; //using namespace atcoder; int main(){ ll N; cin >> N; vector<ll> A(N); map<ll,ll> mp; rep(i,N){ cin >> A[i]; mp[A[i]]++; } ll val = -1; for(auto& [a,n]:mp){ if(n == 1) cmax(val,a); } if(val == -1) drop(-1); rep(i,N){ if(A[i] == val) drop(i+1); } }
Submission Info
Submission Time | |
---|---|
Task | C - Uniqueness |
User | zssa |
Language | C++ 20 (gcc 12.2) |
Score | 300 |
Code Size | 1307 Byte |
Status | AC |
Exec Time | 184 ms |
Memory | 24520 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 | 3532 KB |
hand_02.txt | AC | 1 ms | 3520 KB |
hand_03.txt | AC | 1 ms | 3460 KB |
random_01.txt | AC | 184 ms | 24520 KB |
random_02.txt | AC | 64 ms | 11816 KB |
random_03.txt | AC | 176 ms | 23724 KB |
random_04.txt | AC | 124 ms | 18632 KB |
random_05.txt | AC | 179 ms | 24284 KB |
random_06.txt | AC | 144 ms | 12056 KB |
random_07.txt | AC | 103 ms | 9920 KB |
random_08.txt | AC | 104 ms | 9960 KB |
random_09.txt | AC | 74 ms | 5880 KB |
random_10.txt | AC | 111 ms | 15360 KB |
random_11.txt | AC | 109 ms | 15192 KB |
random_12.txt | AC | 120 ms | 15240 KB |
random_13.txt | AC | 122 ms | 15252 KB |
random_14.txt | AC | 127 ms | 15240 KB |
random_15.txt | AC | 126 ms | 15184 KB |
random_16.txt | AC | 41 ms | 7552 KB |
random_17.txt | AC | 8 ms | 4288 KB |
random_18.txt | AC | 103 ms | 12960 KB |
random_19.txt | AC | 77 ms | 10756 KB |
random_20.txt | AC | 56 ms | 9028 KB |
random_21.txt | AC | 2 ms | 3580 KB |
random_22.txt | AC | 79 ms | 10800 KB |
random_23.txt | AC | 32 ms | 6716 KB |
sample_01.txt | AC | 1 ms | 3524 KB |
sample_02.txt | AC | 1 ms | 3592 KB |