arrow_forward
همه ارسالها
جزئیات ارسال کد#398
برای پسندیدن وارد شوید
1#include <iostream>
2#include <stdio.h>
3
4using namespace std;
5
6int main(){
7
8 int n ;
9 cin >> n;
10 int house_f = n;
11 int house_s = 0;
12 int counter = 0;
13 int array [n];
14 for(int i=0 ; i<2*n ; i++){
15 cin >> array[i];
16 }
17 for(int i= house_s ; i<n ; i++){
18 int count = n - i;
19 for(int j=house_f ; j< (2*n) - 1 ; j++){
20 if(array[i] != array[j]){
21 count++;
22 }else{
23 break;
24 }
25 }
26 counter += count ;
27 }
28
29 cout << counter ;
30 return 0;
31}
کد ارسالشده برای داوری خودکار هاتکدز
UTF-8