Submission #115789

#TimeUsernameProblemLanguageResultExecution timeMemory
115789imsifileRegistration (FXCUP4_registration)Text
0 / 100
0 ms0 KiB
#include<stdio.h> int n, ba[101010], chk[101010]; long long dap; int main(){ int i, j; scanf("%d", &n); for(i=0; i<n; i++)scanf("%d", &ba[i]); for(i=j=0; i<n; i++){ for(; j<n; j++){ if(chk[ba[j]])break; chk[ba[j]]++; } dap += j-i; chk[ba[i]]--; } printf("%lld", dap); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...