| 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()