(I2
I70
I5
(dp0
Vnecklace.%l
p1
(Vnecklace2.cpp
p2
S'#include<iostream>\r\nusing namespace std;\r\n\r\nint main()\r\n{\r\n    ios_base::sync_with_stdio(false);\r\n    cin.tie(NULL);\r\n    cout.tie(NULL);\r\n    string necklace;\r\n    long long result=0;\r\n    int length=0;\r\n    int br=0;\r\n    char first[1024],second[1024];\r\n    long long num[1024];\r\n    cin>>length>>br;\r\n    cin>>necklace;\r\n    for(int i=0; i<br; i++)\r\n    {\r\n        cin>>first[i];\r\n        cin>>second[i];\r\n        num[i]=0;\r\n    }\r\n    for(int i=0; i<length; i++)\r\n    {\r\n        for(int j=0; j<br; j++)\r\n        {\r\n            if(necklace[i]==second[j])\r\n            {\r\n                result+=num[j];\r\n            }\r\n            if(necklace[i]==first[j])\r\n            {\r\n                num[j]++;\r\n            }\r\n        }\r\n    }\r\n    cout<<result<<"\\n";\r\n    return 0;\r\n}\r\n\r\n'
p3
tp4
stp5
.