Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- int testcase , n , a , b , r ;
- double add , total , another ;
- scanf("%d",&testcase) ;
- while( testcase-- ) {
- another = 0.0 ;
- total = 0.0 ;
- scanf("%d",&n) ; getchar() ; // space soranor jonno getchar() ;
- char lotus[n][20] ;
- double eater[n] ;
- /*
- df fd jk kj dd ff jj kk er jonno 0.4 baki sob .2 and 1st one er jonno .2
- */
- for( a = 0 ; a < n ; a++ ) {
- add = 0 ;
- scanf("%s",lotus[a]) ;
- for( b = 0 ; lotus[a][b] != '\0' ; b++ ) {
- if( b == 0 ) add += 0.2 ;
- else {
- if( lotus[a][b-1] == 'd' && lotus[a][b] == 'f' ) add += 0.4 ;
- else if( lotus[a][b-1] == 'f' && lotus[a][b] == 'd' ) add += 0.4 ;
- else if( lotus[a][b-1] == 'j' && lotus[a][b] == 'k' ) add += 0.4 ;
- else if( lotus[a][b-1] == 'k' && lotus[a][b] == 'j' ) add += 0.4 ;
- else if( lotus[a][b-1] == 'd' && lotus[a][b] == 'd' ) add += 0.4 ;
- else if( lotus[a][b-1] == 'f' && lotus[a][b] == 'f' ) add += 0.4 ;
- else if( lotus[a][b-1] == 'j' && lotus[a][b] == 'j' ) add += 0.4 ;
- else if( lotus[a][b-1] == 'k' && lotus[a][b] == 'k' ) add += 0.4 ;
- else add += 0.2 ;
- }
- }
- eater[a] = add ;
- }
- /*
- double array er number same hole then same number er jaegae -33 bosano & tar age oi number half kore another(variable) ey add kora
- */
- for( a = 0 ; a < n-1 ; a++ ) {
- if( eater[a] == -33 ) continue ;
- for( b = a+1 ; b < n ; b++ ) {
- if( eater[a] == eater[b] ) {
- another = another + 0.5*eater[b] ;
- eater[b] = -33 ;
- }
- }
- }
- for( a = 0 ; a < n ; a++ ) {
- if( eater[a] != -33 ) total += eater[a] ;
- }
- printf("%.0lf\n",( another + total)*10.0 ) ;
- }
- return 0 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement