목차

Strfry

ps
링크acmicpc.net/…
출처BOJ
문제 번호11328
문제명Strfry
레벨브론즈 2
분류

기초

시간복잡도O(t*n)
인풋사이즈t<=1000, n<=1000
사용한 언어Python
제출기록32148KB / 136ms
최고기록84ms
해결날짜2021/12/23

풀이

코드

"""Solution code for "BOJ 11328. Strfry".

- Problem link: https://www.acmicpc.net/problem/11328
- Solution link: http://www.teferi.net/ps/problems/boj/11328
"""

import collections
import sys


def main():
    N = int(sys.stdin.readline())
    for _ in range(N):
        str1, str2 = sys.stdin.readline().split()
        counter1 = collections.Counter(str1)
        counter2 = collections.Counter(str2)
        print('Possible' if counter1 == counter2 else 'Impossible')


if __name__ == '__main__':
    main()