Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int tc, n;
- scanf("%d", &tc);
- for(int i=1;i<=tc;i++){
- scanf("%d", &n);
- int count, price=0, size[n];
- char c[n];
- for(int j=0;j<n;j++){
- scanf(" %c %d", &c[j], &size[j]);
- }
- for(int j=0;j<n;j++){
- count = 1;
- for(int k=j+1;k<n;k++){
- if(size[k]==-1){
- continue;
- }
- if(c[j]==c[k] && size[j]==size[k]){
- size[k] = -1;
- count++;
- }
- }
- price+=count/2*10;
- }
- printf("Case #%d: %d\n", i, price);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement