Submission #6833935


Source Code Expand

Copy
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
  int n;
  cin>>n;
  string str[n];
  for(int i=0;i<n;i++)
  {
    cin>>str[i];
    
    sort(str[i].begin(),str[i].end());
  }
  sort(str,str+n);
  long long count=0;
  for(int i=0;i<n-1;i++)
  {
  	int k=1;
 
    while((str[i].compare(str[i+1])==0)&&i<n-1)
    {
    	i++;
    	k++;
    }
    count+=((k-1)*(k))/2;
    
  }
  cout<<count;
  return 0;
}

Submission Info

Submission Time
Task C - Green Bin
User aditya787
Language C++14 (GCC 5.4.1)
Score 0
Code Size 480 Byte
Status WA
Exec Time 133 ms
Memory 7296 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 12
WA × 1
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13
Case Name Status Exec Time Memory
a01 AC 1 ms 256 KB
a02 AC 1 ms 256 KB
a03 AC 1 ms 256 KB
b04 AC 1 ms 256 KB
b05 AC 117 ms 7296 KB
b06 AC 120 ms 7296 KB
b07 AC 117 ms 7296 KB
b08 AC 129 ms 7296 KB
b09 AC 133 ms 7296 KB
b10 AC 129 ms 7296 KB
b11 WA 103 ms 7296 KB
b12 AC 128 ms 7296 KB
b13 AC 2 ms 256 KB