{"action":"opened","issue":{"url":"https://api.github.com/repos/liuchuo/PAT/issues/86","repository_url":"https://api.github.com/repos/liuchuo/PAT","labels_url":"https://api.github.com/repos/liuchuo/PAT/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/liuchuo/PAT/issues/86/comments","events_url":"https://api.github.com/repos/liuchuo/PAT/issues/86/events","html_url":"https://github.com/liuchuo/PAT/issues/86","id":387743881,"node_id":"MDU6SXNzdWUzODc3NDM4ODE=","number":86,"title":"patA1093可以再简单一点点，时间复杂度大概从2n变成n","user":{"login":"jiangwenxuan","id":32122801,"node_id":"MDQ6VXNlcjMyMTIyODAx","avatar_url":"https://avatars3.githubusercontent.com/u/32122801?v=4","gravatar_id":"","url":"https://api.github.com/users/jiangwenxuan","html_url":"https://github.com/jiangwenxuan","followers_url":"https://api.github.com/users/jiangwenxuan/followers","following_url":"https://api.github.com/users/jiangwenxuan/following{/other_user}","gists_url":"https://api.github.com/users/jiangwenxuan/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangwenxuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangwenxuan/subscriptions","organizations_url":"https://api.github.com/users/jiangwenxuan/orgs","repos_url":"https://api.github.com/users/jiangwenxuan/repos","events_url":"https://api.github.com/users/jiangwenxuan/events{/privacy}","received_events_url":"https://api.github.com/users/jiangwenxuan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-05T12:54:31Z","updated_at":"2018-12-05T12:54:31Z","closed_at":null,"author_association":"NONE","body":"只用一次循环就ok啦。\r\n`#include <string>\r\n#include <iostream>\r\nusing namespace std;\r\n\r\nint main() {\r\n    string str;\r\n    cin >> str;\r\n    long long p = 0;\r\n    long long a = 0;\r\n\tint begin = 0;\r\n\twhile(str[begin] != 'P') {\r\n\t\tbegin++;\r\n\t}\r\n\tlong ans = 0;\r\n\tint len = str.length();\r\n\tfor(int i = begin; i < len; i++) {\r\n\t\tif(str[i] == 'P') {\r\n\t\t\tp++;\r\n\t\t}\r\n\t\telse if(str[i] == 'A') {\r\n\t\t\ta = a + p;\r\n\t\t}\r\n\t\telse if(str[i] == 'T') {\r\n\t\t\tans = ans + a;\r\n\t\t}\r\n\t}\r\n\tprintf(\"%lld\", ans % 1000000007);\r\n\treturn 0;\r\n}\r\n`"}}
{"actor":{"display_login":"jiangwenxuan"}}