fork(6) download
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. int test,money,i,num[52] = {0};
  5. char ch = '1';
  6. scanf("%d",&test);
  7. while(test--){
  8. money = 0;
  9. while(ch!='\n'){
  10. scanf("%c", &ch);
  11. if((int)ch>91)
  12. num[(int)ch-71]++;
  13. else
  14. num[(int)ch-65]++;
  15. }
  16. ch = '1';
  17. for(i=0;i<52;i++){
  18. money += num[i]/2 + num[i]%2;
  19. num[i] = 0;
  20. }
  21. printf("%d\n", money);
  22. }
  23. return 0;
  24. }
Time limit exceeded #stdin #stdout 5s 1836KB
stdin
4
ssss
ssas
sa
s
stdout
Standard output is empty