# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
115789 | imsifile | Registration (FXCUP4_registration) | Text | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |