Submission #6839836


Source Code Expand

Copy
<?php
fscanf(STDIN, '%d', $n);
$cnt = 0;
$arr = [];
for ($i  = 0; $i < $n; $i++) {
    $s = str_split(trim(fgets(STDIN)));
    sort($s);
    $s = implode('', $s);
    if (array_key_exists($s, $arr)) {
        $arr[$s]++;
        $cnt += $arr[$s] - 1;
    } else {
        $arr[$s] = 1;
    }
}
echo $cnt.PHP_EOL;

Submission Info

Submission Time
Task C - Green Bin
User hideyuk1
Language PHP7 (7.0.15)
Score 300
Code Size 327 Byte
Status
Exec Time 172 ms
Memory 13048 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 a01, a02, a03
All 300 / 300 a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13
Case Name Status Exec Time Memory
a01 9 ms 4728 KB
a02 8 ms 4604 KB
a03 9 ms 4604 KB
b04 9 ms 4604 KB
b05 137 ms 4604 KB
b06 165 ms 4604 KB
b07 168 ms 4604 KB
b08 151 ms 13048 KB
b09 161 ms 13048 KB
b10 153 ms 13048 KB
b11 172 ms 4604 KB
b12 162 ms 13048 KB
b13 10 ms 4604 KB