problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 262k 1.05M | problem_description stringlengths 48 1.55k | codes stringlengths 35 98.9k | status stringlengths 28 1.7k | submission_ids stringlengths 28 1.41k | memories stringlengths 13 808 | cpu_times stringlengths 11 610 | code_sizes stringlengths 7 505 |
|---|---|---|---|---|---|---|---|---|---|---|
p02571 | u918770092 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['s = str(input())\nt = str(input())\nans = 10000\nfor i in range(len(s) - len(t) + 1) : \n cnt = 0\n for j in range(len(t)) : \n if s[i + j] != t[j] : \n cnt += 1\n ans = min(ans, cnt)\n', 's = str(input())\nt = str(input())\nans = 10000\nfor i in range(len(s) - len(t) + 1) : \n cnt = 0\n for j in range(l... | ['Wrong Answer', 'Accepted'] | ['s729573756', 's834992089'] | [9084.0, 9008.0] | [61.0, 55.0] | [187, 197] |
p02571 | u918845030 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['\ndef input_from_console():\n s = input()\n t = input()\n return s, t\n\n\ndef solve(s, t):\n min_count = len(t)\n for i in range(len(s)-len(t)):\n temp_count = 0\n for j in range(len(t)):\n if s[j+i] != t[j]:\n temp_count += 1\n min_count = min(min_count,... | ['Wrong Answer', 'Accepted'] | ['s217890931', 's062471698'] | [8944.0, 9124.0] | [50.0, 57.0] | [596, 585] |
p02571 | u919519672 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ["def probB():\n S = input()\n T = input()\n\n maxdiff = 0\n for i in range(len(S) - len(T)):\n count = 0\n for j in range(len(T)):\n if S[i + j] != T[j]:\n count += 1\n if (count > maxdiff):\n maxdiff = count\n print(maxdiff)\n\n\ndef mai... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s100193565', 's488857220', 's561653602', 's642228965', 's442256211'] | [9040.0, 9068.0, 9036.0, 9056.0, 8964.0] | [54.0, 54.0, 50.0, 53.0, 60.0] | [360, 567, 576, 393, 581] |
p02571 | u923824033 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['a = input()\nb = input()\n\nl = []\nfor i in range(len(a) - len(b) + 1):\n cnt = 0\n for j in range(len(b)):\n if b[j] == a[i + j]:\n cnt += 1\n l.append(cnt)\n\nprint(l)\nprint(len(b) - max(l))', 'a = input()\nb = input()\n\nl = []\nfor i in range(len(a) - len(b) + 1):\n cnt = 0\n fo... | ['Wrong Answer', 'Accepted'] | ['s482700422', 's041645950'] | [8928.0, 9028.0] | [77.0, 73.0] | [209, 210] |
p02571 | u924852499 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['S = input()\nT = input()\n\nlen_S = len(S)\nlen_T = len(T)\n\nans = 10*5\nfor i in range(len_S - len_T+1):\n num = 0\n tmp = S[i:i+len_T]\n print(tmp)\n for j in range(len(tmp)):\n print(tmp[j])\n if tmp[j] != T[j]:\n num+=1\n ans = min(ans, num)\n\nprint(ans)', 'S = input()\nT... | ['Wrong Answer', 'Accepted'] | ['s006880657', 's880515871'] | [9160.0, 9124.0] | [119.0, 62.0] | [283, 222] |
p02571 | u935254309 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['S = str(input())\nT = str(input())\n\n\nresult =0\ncnt = len(T)\ntemp = S[:cnt]\nMin = len(T)\n\nwhile True:\n sum = 0\n \n for i in range (len(T)):\n if temp[i] != T[i]:\n sum+=1\n \n result = min(Min,sum)\n \n if cnt+len(T) <= len(S):\n temp = S[cnt:cnt+len(T)]\n ... | ['Wrong Answer', 'Accepted'] | ['s117594309', 's811945064'] | [9064.0, 9060.0] | [32.0, 56.0] | [399, 340] |
p02571 | u939790872 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['S = input()\nT = input()\n\nss = len(S)\ntt = len(T)\n\ncount = 0\nres = []\n\n\nfor i in range(ss-tt+1):\n for j in range(tt):\n if S[i+j] != T[j]:\n count += 1\n res.append(count)\n count = 0\n\nprint(res)\nprint(min(res))', 'S = input()\nT = input()\n\nss = len(S)\ntt = len(T)\n\ncount =... | ['Wrong Answer', 'Accepted'] | ['s762635109', 's172825986'] | [9032.0, 9040.0] | [63.0, 63.0] | [233, 222] |
p02571 | u939847032 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['def main():\n S = input()\n T = input()\n print(S)\n print(T)\n min = len(T)\n for i in range(len(S) - len(T) + 1):\n temp = 0\n for j in range(len(T)):\n if S[i + j] != T[j]:\n temp += 1\n if temp < min:\n min = temp\n print(min)\nmain()'... | ['Wrong Answer', 'Accepted'] | ['s555986468', 's428910076'] | [9020.0, 9052.0] | [48.0, 47.0] | [303, 277] |
p02571 | u941047297 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ["def main():\n s = input()\n t = input()\n n = len(t)\n ans = 0\n\n for i in range(len(s) - n + 1):\n cnt = 0\n for a, b in zip(s[i:i + n], t):\n if a == b: cnt += 1\n ans = max(ans, cnt)\n print(s[i:i + n])\n print(n - ans)\n\nif __name__ == '__main__':\n ma... | ['Wrong Answer', 'Accepted'] | ['s168817547', 's332989540'] | [9056.0, 9052.0] | [40.0, 45.0] | [309, 283] |
p02571 | u941438707 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['s=input()\nt=input()\nans=0\nfor i in range(len(s)-len(t)):\n u=0\n for a,b in zip(t,s[i:len(t)+i]):\n if a==b:u+=1\n print(t,s[i:len(t)+i],u) \n ans=max(ans,u) \nif len(s)==len(t):\n for a,b in zip(t,s):\n if a==b:ans+=1 \nprint(len(t)-ans)', 's=input()\nt=input()\nans=0\nfor i in... | ['Wrong Answer', 'Accepted'] | ['s643757519', 's402455802'] | [9072.0, 9068.0] | [63.0, 57.0] | [265, 232] |
p02571 | u942033906 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['S = list(input())\nT = list(input())\nls = len(S)\nlt = len(T)\nans = lt\nfor offset in range(ls - lt + 1):\n\tprint(offset)\n\tcnt = 0\n\tfor i in range(lt):\n\t\tprint(S[offset+i], T[i])\n\t\tif S[offset + i] != T[i]:\n\t\t\tcnt += 1\n\tans = min(ans, cnt)\nprint(ans)', 'S = list(input())\nT = list(input())\nls = l... | ['Wrong Answer', 'Accepted'] | ['s224466144', 's992185210'] | [9172.0, 9120.0] | [177.0, 59.0] | [246, 204] |
p02571 | u945065638 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['S =input()\nT =input()\nmint=10000\n\nfor i in range(len(S)-len(T)+1):\n con = 0\n for j in range(len(T)):\n if S[i+j] != T[j]:\n con += 1\n \n mint =min(con,mint)\n \n if min_count == 0:\n break\n\n\nprint(mint)', 's = input()\nt = input()\nmini =10000000\n\nfor i i... | ['Runtime Error', 'Accepted'] | ['s585336318', 's691263987'] | [9056.0, 8904.0] | [23.0, 59.0] | [247, 238] |
p02571 | u949115942 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['s = input()\nt = input()\nans = len(t)\nfor i in range(0, (len(s)-len(t)+1)):\n diff = 0\n for j in range(i, len(t)):\n if t[j] == s[i+j]:\n diff += 1\n ans = min(ans, len(t)-diff)\nprint(ans)', 's = input()\nt = input()\nans = len(t)\nfor i in range(0, (len(s)-len(t))):\n diff = 0\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s346646412', 's514776411', 's905257938'] | [9020.0, 9008.0, 9128.0] | [50.0, 47.0, 72.0] | [210, 209, 210] |
p02571 | u956318161 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['S=input()\nT=input()\n\nfor i in range(0,len(S)-len(T)+1):\n score=0\n for j in range(0,len(T)):\n if(S[i] != T[i+j]):\n score += 1\n score = min(score, len(T))\nprint(score)', 'S=input("codefoces")\nT=input("atcoder")\ntlen = len(T)\n \n \nfor i in range(tlen, 1):\n for k in range(0, tlen+1-i):\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s548148754', 's994613786', 's453852698'] | [9056.0, 9084.0, 9052.0] | [28.0, 25.0, 49.0] | [176, 177, 219] |
p02571 | u957799665 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['S = list(str(input()))\nT = list(str(input()))\ni = 0\nt = 0\nans = 0\nstart = 0\n\nwhile i <= len(T)-1:\n if S[i] == T[i]:\n t = i\n while t <= len(T)-1:\n print(S[t])\n if T[t] == S[t]:\n ans += 1\n t += 1\n break\n i += 1\n\nif ans > 0:\n ... | ['Wrong Answer', 'Accepted'] | ['s849486728', 's495400940'] | [9168.0, 9124.0] | [28.0, 45.0] | [342, 328] |
p02571 | u959682393 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['S = list(input())\nT = list(input())\nans = 1e9\n\nfor i in range(len(S) - len(T) + 1):\n print(S[i:len(T)+i],T)\n tmp = 0\n for j in range(len(T)):\n if S[i:len(T)+i][j] == T[j]: continue\n tmp += 1\n ans = min (ans,tmp)\n\nprint(ans)', 'S = list(input())\nT = list(input())\nans = 1e9\n\nfo... | ['Wrong Answer', 'Accepted'] | ['s458830379', 's408809333'] | [9036.0, 9064.0] | [499.0, 501.0] | [249, 222] |
p02571 | u970348538 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['s = input()\nt = input()\n\nans = len(t)\nfor i in range(len(s) - len(t) + 1):\n ans_tmp = 0\n for j in range(len(t)):\n if s[i+j] != t[j]:\n ans_tmp += 1\n print(s[i+j])\n ans = min(ans, ans_tmp)\nprint(ans)', 's = input()\nt = input()\n\nans = len(t)\nfor i in range(len(s) - len(t) + 1... | ['Wrong Answer', 'Accepted'] | ['s810941103', 's244112567'] | [8988.0, 9012.0] | [59.0, 61.0] | [227, 209] |
p02571 | u972036293 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['S = input()\nT = input()\nans = len(T)\nfor start in range(len(S) - len(T)):\n dif = 0\n for i in range(len(T)):\n if T[i] == S[start + i]:\n dif += 1\n ans = min(ans, dif) \nprint(ans)', 'S = input()\nT = input()\nans = len(T)\nfor start in range(len(S) - len(T)):\n dif = 0\n for i in range(len(T)):\n ... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s119717610', 's355375561', 's373229046', 's584543430', 's697000882', 's704191784', 's810754078', 's624455224'] | [8996.0, 9092.0, 8992.0, 8976.0, 40280.0, 9060.0, 9040.0, 9044.0] | [68.0, 71.0, 45.0, 68.0, 266.0, 51.0, 179.0, 62.0] | [187, 179, 174, 187, 169, 174, 167, 192] |
p02571 | u973972117 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['S = input()\nT = input()\nAnswer = len(T)\nfor i in range(0,len(S)-len(T)):\n String = S[i:i+len(T)]\n for j in range(len(String)):\n B = len(T)\n if String[j] == T[j]:\n B -= 1\n Answer = min(Answer,B)\nprint(Answer)', 'S = input()\nT = input()\nAnswer = len(T)\nfor i in range(0... | ['Wrong Answer', 'Accepted'] | ['s835158071', 's232109249'] | [9020.0, 9080.0] | [133.0, 62.0] | [245, 371] |
p02571 | u974402118 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['S = input()\nt = input()\nneq = len(t)\nfor i in range(len(S)-len(t)+1):\n if S[i]==t[0]:\n neq_temp = 0\n for j in range(1,len(t)):\n if S[i+j]!=t[j]:\n neq += 1\n neq = min(neq,neq_temp)\nprint(neq)', 'S = input()\nt = input()\nneq = len(t)\nfor i in range(len(S)-len(t)+1):\n neq_temp = 0\n ... | ['Wrong Answer', 'Accepted'] | ['s397287782', 's579332169'] | [9000.0, 9068.0] | [59.0, 55.0] | [212, 188] |
p02571 | u987637902 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['s = input()\nt = input()\nls = len(s)\nlt = len(t)\nans = 10000\n\n\nfor i in range(ls-lt+1): \n score = 0\n U = s[i:i + lt] \n for j in range(lt): \n \n if U[j] != t[j]:\n score += 1 \n ans = min(ans, score) \n\nprint(ans)', '# ABC177\n# B Substring\n\n\n\ns = input()\nt ... | ['Wrong Answer', 'Accepted'] | ['s403067655', 's901347710'] | [9060.0, 9116.0] | [95.0, 59.0] | [623, 839] |
p02571 | u989364230 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['s = input()\nt = input()\nx = len(t)\nmx= 0\n\nres= 0\nfor i in range(len(s) - x+1):\n print(i)\n tmp = s[i:i+x]\n cntmp = 0\n for j in range(x):\n if t[j] == tmp[j]:\n cntmp += 1\n # print(tmp, i)\n res = max(res, cntmp)\nprint(x-res)', 's = input()\nt = input()\nx = len(t)\nres= ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s661717510', 's707776948', 's717281277'] | [9032.0, 8948.0, 9024.0] | [62.0, 66.0, 72.0] | [256, 211, 258] |
p02571 | u989892335 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['s=input()\nt=input()\nans=0\ntsize=len(t)\nfor i in range(tsize):\n if t[:i] in s:\n ans=tsize-(i+1)\n \nprint(ans)', 's,t=input(),input()\nans=len(t)\n\nfor x in range(len(s)-len(t)+1):\n tmp=0\n for y in range(len(t)):\n if s[x+y]!=t[y]:\n tmp+=1\n ans=min(ans... | ['Wrong Answer', 'Accepted'] | ['s810603013', 's684186835'] | [9028.0, 9092.0] | [29.0, 55.0] | [136, 405] |
p02571 | u990641144 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['import numpy as np\nS = input()\nT = input()\n\ntmp = np.zeros(len(T))\n\ni=0\nflg=True\n\nwhile flg:\n for j in range(i, len(T)):\n print(i,j)\n print(T[i:j+1])\n print(T[i:j+1] in S)\n if T[i:j+1] in S:\n tmp[i] = j+1-i\n i = max(i + int(tmp[i]),i+1)\n if i >= len(T)-... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s024113656', 's024772340', 's211399432', 's537955267', 's958433397'] | [148204.0, 9104.0, 9056.0, 148152.0, 8972.0] | [1286.0, 28.0, 29.0, 2735.0, 68.0] | [353, 210, 242, 342, 180] |
p02571 | u992455162 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['s = input()\nt = input()\ncnt = 0\nmin = 0\nfor i in range(len(s)-len(t)):\n cnt = 0\n for j in range(len(t)):\n if s[i+j] == t[j]:\n cnt += 1\n print(i,j,cnt)\n if min < cnt:\n min = cnt\nprint(len(t)-min)', 's = input()\nt = input()\ncnt = 0\nmin = 0\nfor i i... | ['Wrong Answer', 'Accepted'] | ['s416263786', 's796117073'] | [9228.0, 9088.0] | [254.0, 117.0] | [251, 526] |
p02571 | u995062424 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['S = input()\nT = input()\n\nnum = 10**10\n\nfor i in range(len(S)-len(T)+1):\n U = S[i:(i+len(T))]\n for j in range(len(T)):\n if(T[j] != S[j]):\n tmp += 1\n num = min(num, tmp)\n \nprint(num)', 'S = input()\nT = input()\n\nnum = 10**10\n\nfor i in range(len(S)-len(T)+1):\n U = S[i:(i... | ['Runtime Error', 'Accepted'] | ['s195852490', 's126051741'] | [9060.0, 8952.0] | [29.0, 57.0] | [210, 222] |
p02571 | u995400612 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['def minimumChar(S,T): \n n, m = len(S), len(T) \n ans = sys.maxsize \n for i in range(m - n + 1): \n minRemovedChar = 0\n for j in range(n): \n if (S[j] != T[i + j]): \n minRemovedChar += 1\n ans = min(minRemovedChar, ans) \n return ans \n \nS=input()\nT... | ['Runtime Error', 'Accepted'] | ['s888852484', 's708409285'] | [8728.0, 9116.0] | [22.0, 44.0] | [341, 351] |
p02571 | u998741086 | 2,000 | 1,048,576 | Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`. | ['#!/usr/bin/env python3\n\ns = input()\nt = input()\n\nerrors = []\nfor i in range(len(s)-len(t)+1):\n error = 0 \n for j in range(len(t)):\n if s[i+j] != t[j]:\n error += 1\n errors.append(error)\nprint(min(errors)', '#!/usr/bin/env python\n\ns = input()\nt = input()\n\nerrors = []\nfor i i... | ['Runtime Error', 'Accepted'] | ['s899126789', 's707183364'] | [8912.0, 9048.0] | [25.0, 55.0] | [229, 229] |
p02572 | u005569385 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\na = list(map(int,input().split()))\nt = [];s = 0\nfor i in range(N):\n for j in range(N):\n if i != j:\n if a[i]*a[j]<10**9+7:\n t.append(a[i]*a[j])\n else:\n t.append(a[i]%7*a%[j]%7)\nfor i in t:\n s += i\ns = s//2\nprint(s%10**9+7)',... | ['Runtime Error', 'Accepted'] | ['s864793843', 's461876807'] | [72304.0, 31124.0] | [2208.0, 139.0] | [303, 200] |
p02572 | u006728642 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\nA = list(map(int,input().split()))\n\nS = sum(A)\nS2 = sum(map(lambda x: x*x,A))\n\nprint((S*S - S2) / 2 % 1000000007)', 'N = int(input())\nA = list(map(int,input().split()))\nmod = 1000000000 + 7\nS = sum(A)\nS2 = sum(map(lambda x: x*x,A))\nans = (S*S - S2)// 2 % mod\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s281461607', 's577534870'] | [31544.0, 31468.0] | [95.0, 93.0] | [130, 152] |
p02572 | u009885900 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['import numpy as np\n\nN = int(input())\nA = numpy.array(list(map(int, input().split())))\n\nans = 0\n\nfor i in range(N):\n\tans = (ans + A[i] * numpy.sum(A[i+1:N])) % (10**9+7)\n\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\nDIV = 10**9+7\nans = 0\nAsum = sum(A)\nAsum_sq = Asum**2\n\nfor i... | ['Runtime Error', 'Accepted'] | ['s934187629', 's121560322'] | [27132.0, 31652.0] | [109.0, 142.0] | [181, 182] |
p02572 | u013617325 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\nA = list(map(int, input().split()))\n\nnumber = 0\nfor i in range(N-1):\n for j in range(i+1, N):\n print(A[i], A[j])\n number += A[i]*A[j]\n\nprint(number)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nnumber = 0\nMOD = 1000000007\n\nfor i in range(N-1):\n for j ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s209440138', 's496944342', 's891637150', 's525902443'] | [78960.0, 71800.0, 72020.0, 44472.0] | [2338.0, 2315.0, 3051.0, 161.0] | [183, 251, 251, 820] |
p02572 | u013864607 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = input()\nAs = list(map(int, input().split()))\n\nresult = 0\nfor i in range(N-1):\n result+=As[i]*sum(As[i+1:])\nprint(result%(1*10**9+7))\n', 'N = int(input())\nAs = list(map(int, input().split()))\n\nresult = 0\nbefore_sum = sum(As)\nfor i in range(N-1):\n before_sum-=As[i]\n result+=As[i]*(before_sum)... | ['Runtime Error', 'Accepted'] | ['s492393192', 's453652079'] | [31736.0, 31388.0] | [72.0, 131.0] | [140, 187] |
p02572 | u014386369 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['sum_all=[]\nfor i in range(N-1):\n for j in range(i+1,N):\n A[i]=A[i]%mod\n A[j]=A[j]%mod\n sum_all.append((A[i])*(A[j]))\n\nsum=0\nfor n in sum_all:\n sum+=n\nprint(sum%mod)', 'N=int(input())\nA=list(map(int,input().split()))\n\nmod=10**9+7\n\nB=[0]\nfor i in range(1,N+1):\n B.append(A[... | ['Runtime Error', 'Accepted'] | ['s052803494', 's094877915'] | [9028.0, 31440.0] | [27.0, 197.0] | [191, 204] |
p02572 | u018538342 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\nlis = list(map(int, input().split())\nsum = 0\nfor i in lis:\n for j in lis:\n sum += i * j\nprint(sum % 1000000009) ', 'n = int(input())\nlis = list(map(int, input().split()))\ns = 0\nfor ind, i in enumerate(lis):\n for j in lis[ind+1:]:\n print(i, j)\nprint(s % 10000000... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s388345397', 's530237835', 's869606128'] | [8900.0, 102044.0, 31576.0] | [25.0, 2613.0, 129.0] | [148, 159, 147] |
p02572 | u036340997 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na = list(map(int, input().split()))\ns = sum(a)\nans = 0\nmod = 10**9 + 7\nfor i in range(n):\n ans = (ans + a[i] * (s - a[i])) % mod\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\ns = 0\nans = 0\nmod = 10**9 + 7\nfor i in range(n):\n ans = (ans + a[i] * s) % mod\n s = (s +... | ['Wrong Answer', 'Accepted'] | ['s358585835', 's353149354'] | [31560.0, 31672.0] | [134.0, 141.0] | [157, 166] |
p02572 | u037098269 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['s = input()\nt = input()\n\nres = 0\nfor i in range(len(s)-len(t)+1):\n tmp = 0\n for j in range(len(t)):\n if s[j+i] == t[j]:\n tmp += 1\n res = max(res, tmp)\n\nprint(len(t)-res)', 'n = int(input())\na = list(map(int, input().split()))\nmod = 10**9+7\n\ncur = 0\nres = 0\nfor i in range(n-... | ['Wrong Answer', 'Accepted'] | ['s111698519', 's106360110'] | [13128.0, 31652.0] | [34.0, 180.0] | [196, 210] |
p02572 | u048004795 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['import sys\n\ndef main():\n input = sys.stdin.readline\n n = int(input())\n a_list = list(map(int, input().split()))\n b_list = [0]*(n+1)\n MOD = 10**9 + 7\n\n for i in range(n):\n b_list[i+1] = b_list[i] + a_list[i]\n \n ans = 0\n for i in range(n):\n ai_sum = b_list[n] - b_l... | ['Wrong Answer', 'Accepted'] | ['s324667887', 's063267142'] | [9120.0, 31460.0] | [30.0, 159.0] | [380, 429] |
p02572 | u051376899 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['MOD = 1000000007\n\nn=int(input())\na=list(map(int,input().split()))\n\narray_sum = 0\nfor i in range(0, n, 1): \n array_sum += a[i]\n array_sum%=MOD\n\narray_sum_square = pow(array_sum,2,MOD)\n\nindividual_square_sum = 0\nfor i in range(0, n, 1): \n individual_square_sum+= pow(a[i],2,MOD)\n individual_sq... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s213299826', 's221188631', 's398343109'] | [31552.0, 31504.0, 31716.0] | [295.0, 304.0, 170.0] | [392, 400, 377] |
p02572 | u056358163 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\nA = list(map(int, input().split()))\n\nans = 0\nQ = 1e9 + 7\n\nfor i in range(N-1):\n for j in range(i+1, N):\n print(A[i], A[j])\n ans += (A[i] * A[j])\n ans %= Q\n\nprint(int(ans))', 'N = int(input())\nA = list(map(int, input().split()))\n \nans = 0\nQ = int(1e9 + 7)\n \nsu... | ['Wrong Answer', 'Accepted'] | ['s887749279', 's969126126'] | [66984.0, 31528.0] | [2260.0, 156.0] | [212, 184] |
p02572 | u065099501 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['import sys\ninput = sys.stdin.readline\nn = int(input())\ntmp = list(map(int, input().split()))\nA = [a % M for a in tmp]\nM = 1000000007\nans = 0\nfor i in range(1,n):\n ans += (A[i-1] * ((sum(A[i::])%M)))%M\nprint(ans%M)', 'import sys\ninput = sys.stdin.readline\nM = 1000000007\nn = int(input())\nA = list(map(in... | ['Runtime Error', 'Accepted'] | ['s357409029', 's392835021'] | [31576.0, 31224.0] | [74.0, 190.0] | [216, 273] |
p02572 | u077296371 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n=int(input())\nl=list(map(int,input().split()))\nsu=l[0]\nans=0\nfor i in range(1,n):\n ans+=su*l[i]\n ans%=mod\n su+=l[i]\n su%=mod\nprint(ans)', '\nimport math\nimport random\nimport heapq, bisect\nimport sys\nfrom collections import deque, defaultdict\nfrom fractions import Fraction\nimport sys\n#impo... | ['Runtime Error', 'Accepted'] | ['s820871280', 's589755218'] | [31564.0, 35284.0] | [71.0, 169.0] | [148, 15062] |
p02572 | u080885857 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ["from itertools import accumulate\nmod = 1e9 +7\ndef main():\n n = int(input())\n a = list(map(int,input().split()))\n ans =0\n ac = list(accumulate(a))\n \n for i in range(n):\n ans += a[i]* (ac[-1]-ac[i])\n ans %=mod\n print(ans)\n\nif __name__ == '__main__':\n main()", 'mod = 1... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s069358880', 's897229120', 's287737689'] | [31636.0, 31360.0, 31624.0] | [155.0, 218.0, 130.0] | [293, 265, 292] |
p02572 | u094213642 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na = list(map(int, input().split()))\n \n# required function \ndef findProductSum(A, n): \n \n # calculating array sum (a1 + a2 ... + an) \n array_sum = 0\n for i in range(0, n, 1): \n array_sum = array_sum + A[i] \n \n # calcualting square of array sum \n # (a1 + a2 + ...... | ['Wrong Answer', 'Accepted'] | ['s168496865', 's361544031'] | [31392.0, 31444.0] | [111.0, 104.0] | [709, 786] |
p02572 | u097319437 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input)\nA = [int(x) for x in input().split(" ")]\n\nfrom itertools import combinations\n\nmod = 1000000007 \ns = 0\nfor c in combinations(A, 2):\n s += c[0] * c[1]\n\nprint(s % mod)', 'N = int(input())\nA = [int(x) for x in input().split(" ")]\n\nfrom itertools import combinations\n\nmod = 1000000007 \n\... | ['Runtime Error', 'Accepted'] | ['s472858563', 's698362695'] | [8656.0, 31564.0] | [30.0, 194.0] | [248, 310] |
p02572 | u100792505 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\nalist = list(map(int, input().split()))\nSum_a = 0\nfor i in range(N):\n for j in range(i+1, N):\n Sum_a += alist[i]*alist[j]\nprint(Sum_a%(1e9+7))', 'N = int(input())\nalist = list(map(int, input().split()))\nimport numpy as np\nSum_a = 0\nSum_j_list = np.cumsum(alist)\nfor i in range(N-1):\n ... | ['Wrong Answer', 'Accepted'] | ['s438297592', 's300933576'] | [31428.0, 37828.0] | [2206.0, 420.0] | [163, 272] |
p02572 | u108072608 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na_list = list(map(int, input().split()))\n \ns = 0\nfor i in a_list:\n for j in a_list:\n s += i*j\n\ns_2 = 0\nfor i in a_list:\n s_2 += i**2\n \nans = int((s - s_2)/2)\nans %(10**9+7)', 'n = int(input())\na_list = list(map(int, input().split()))\n\ns_2 = 0\nfor i in a_list:\n s_2... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s149336409', 's159189297', 's797614610'] | [31524.0, 31588.0, 31544.0] | [2206.0, 125.0, 125.0] | [205, 165, 166] |
p02572 | u111471511 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['ans = 0\nmod = 1e9+7\n\nN = int(input())\nA = [int(num)%mod for num in input().split()]\n\nA_sum = sum(A)\nA_squared = sum([num**2 for num in A])\n\nans = (A_sum**2 - A_squared)/2\nans = int(ans%mod)\nprint(ans-1)\n', 'N = int(input())\nA = [int(num) for num in input().split()]\nA_sum = sum(A)\n\nans = 0\nfor i in ra... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s309521341', 's950946714', 's348618116'] | [31544.0, 31436.0, 31644.0] | [111.0, 148.0, 142.0] | [203, 177, 160] |
p02572 | u123745130 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['s=input()\nt=input()\nlen_s=len(s)\nlen_t=len(t)\nlen_n=len_s-len_t\nans=100000\nfor i in range(0,len_n+1):\n cnt=0\n for j in range(len_t):\n if s[i+j]!=t[j]:\n cnt+=1\n\n ans=min(ans,cnt)\nprint(ans)\n', 'n=int(input())\nlst=list(map(int,input().split()))\naa=sum(lst) % (10**9+7)\n# print... | ['Wrong Answer', 'Accepted'] | ['s290340864', 's700316378'] | [13196.0, 31320.0] | [34.0, 150.0] | [216, 313] |
p02572 | u124445903 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n=int(input())\n \na=list(map(int,input().split()))\ns = sum(a)\nnum = 0\nfor i in range(n):\n num = num - a[i]\n num = a[i]*num\nelse:\n print(num)', 'n=int(input())\n\nl = 1000000007\na=list(map(int,input().split()))\ns = sum(a)\nnum = 0\nfor i in range(n):\n s = s- a[i]\n num =num+a[i]*s\nelse:\n print(num%l... | ['Wrong Answer', 'Accepted'] | ['s733097298', 's463600274'] | [31524.0, 31408.0] | [2206.0, 136.0] | [142, 156] |
p02572 | u128282559 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na = list(map(int, input().split()))\nsum = 0\nt = n-1\nfor i in a:\n for j in range(t):\n sum += i * a[-(j+1)]\n t -= 1\nans = sum % (10**9 + 7)', 'n = int(input())\na = list(map(int, input().split()))\nmod = 10**9 + 7\nans = 0\ns = sum(a)\nfor i in a:\n s -= i\n ans = (ans + (i *... | ['Wrong Answer', 'Accepted'] | ['s599640482', 's131736057'] | [31540.0, 31624.0] | [2206.0, 115.0] | [167, 163] |
p02572 | u133936772 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n,*l=map(int,open(0).read().split())\nprint((sum(l)**2-sum(i**2 for i in l)//2)%(10**9+7))', 'n,*l=map(int,open(0).read().split())\nprint((sum(l)**2-sum(i**2 for i in l))//2%(10**9+7))'] | ['Wrong Answer', 'Accepted'] | ['s825870467', 's814737831'] | [31508.0, 31732.0] | [124.0, 119.0] | [89, 89] |
p02572 | u135642682 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na = list(map(int, input().split(" ")))\n\nres = 1\nfor j in range(n):\n for i in range(j+1):\n res = res * a[j] * a[i] % ((10**9) + 7)\nprint(res)\n ', 'n = int(input())\na = list(map(int, input().split(" ")))\n\nres = 0\nruiseki = 0\nfor j in range(n):\n if j == 0:\n cont... | ['Wrong Answer', 'Accepted'] | ['s104906964', 's076433640'] | [31600.0, 31580.0] | [2206.0, 131.0] | [176, 204] |
p02572 | u141786930 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['# C - Sum of product of pairs\nimport numpy as np\n\nN = int(input())\nA = list(int(a) for a in input().split())\nMOD = 10**9 + 7\nA = np.array(A)\ncsA = np.zeros((N+1), np.object)\nfor i in range(N):\n csA[i+1] = csA[i] + A[i]\n \nans = 0\nfor i in range(N-1):\n ans += (A[i] * (csA[N] - csA[i+1])) % MOD\npr... | ['Wrong Answer', 'Accepted'] | ['s152233777', 's338025234'] | [49580.0, 50248.0] | [557.0, 472.0] | [316, 323] |
p02572 | u146057001 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na = list(map(int, input().split()))\nans = 0\nc = sum(a)\n\nfor i in range(n - 1):\n ans += a[i] * (c - a[i])\n\nprint(ans % (10 ** 9 + 7)) \n', 'n = int(input())\na = list(map(int, input().split()))\nans = 0\nc = sum(a)\n\nfor i in range(n - 1):\n c = c - a[i]\n ans += a[i] * c\n\np... | ['Wrong Answer', 'Accepted'] | ['s445564139', 's034159805'] | [31648.0, 31532.0] | [122.0, 130.0] | [161, 164] |
p02572 | u153047519 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na = list(map(int, input().split()))\nfor i in range(n):\n for j in range(i + 1, n):\n result += (a[i] % (10**9 + 7)) * (a[i] % (10**9 + 7))\nresult = result % (10**9 + 7)\nprint(result)', 'n = int(input())\na = list(map(int, input().split()))\nresult = 0\nd = 0\nfor i in range(n):\n d += a[i] *... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s469326461', 's655250971', 's494065024'] | [31752.0, 31588.0, 31228.0] | [68.0, 139.0, 149.0] | [201, 181, 196] |
p02572 | u155659281 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['def solve():\n N = int(input())\n AA = list(map(int,input().split()))\n \n ans = 0\n for a in AA:\n ans += a\n ans = ans**2\n for a in AA:\n ans -= a**2\n ans = (ans+(10**9+7)**2//2) % (10**9+7)\n print(ans)\nsolve()', 'def solve():\n N = int(input())\n AA = list(map(int,input().split()))\n \n ans = ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s015608126', 's650483893', 's607851013'] | [31520.0, 8880.0, 31408.0] | [121.0, 26.0, 132.0] | [218, 200, 201] |
p02572 | u156815136 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['#from statistics import median\n#import collections\n\nfrom fractions import gcd\nfrom itertools import combinations,permutations,accumulate, product \n#from collections import deque\nfrom collections import deque,defaultdict,Counter\nimport decimal\nimport re\nimport math\nimport bisect\n#\n#\n#\n\n#\n#\n# my_round_... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s347572240', 's504633059', 's415632329'] | [34356.0, 34584.0, 32860.0] | [182.0, 185.0, 172.0] | [1210, 1186, 1160] |
p02572 | u157232135 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['from itertools import accumulate\ndef main():\n n=int(input())\n a=list(map(int,input().split()))\n aa=list(accumulate(a))\n mod=10**9+7\n ans=0\n print(aa)\n for i in range(n):\n ans += a[i]*(aa[-1]-aa[i])%mod\n print(ans%mod)\n \nif __name__ == "__main__":\n main()', 'from itert... | ['Wrong Answer', 'Accepted'] | ['s630794489', 's390523711'] | [35808.0, 31564.0] | [151.0, 131.0] | [291, 277] |
p02572 | u167993508 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\nl = list(map(int,input().split()))\nans = 0\nfor i in range(1,n):\n l[i] += l[i-1]\ni = 0\nwhile i<n-1:\n ans += l[i]*(l[n] - l[i])\n i += 1\nprint(ans)', 'n = int(input())\nl = list(map(int,input().split()))\nx = [*l]\nans = 0\nmod = 1000000007\nfor i in range(1,n):\n l[i] += l[i-1]\ni = 0\nwhi... | ['Runtime Error', 'Accepted'] | ['s612205843', 's308083926'] | [31388.0, 31444.0] | [104.0, 171.0] | [164, 199] |
p02572 | u170913092 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\nA = [int(x)%(1e9+7) for x in input().split()]\n\n# calculating array sum (a1 + a2 ... + an) \narray_sum = 0\nfor i in range(0, n, 1): \n array_sum = (array_sum + A[i])%(1e9+7)\n\n # calcualting square of array sum \n # (a1 + a2 + ... + an)^2 \n array_sum_square = (array_sum * array_sum)%... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s477334869', 's904744296', 's533040808'] | [31552.0, 31836.0, 31840.0] | [234.0, 70.0, 195.0] | [638, 305, 304] |
p02572 | u185042816 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na = list(map(int, input().split()))\n\nsum = 0\n\nfor i in range(n-1):\n sum_i = 0\n for j in range(n-i-1):\n sum_i += a[-(j+1)]\n print(sum_i)\n sum += (sum_i * a[i])\n\nprint(sum%((10 ** 9)+7))', 'n = int(input())\na = list(map(int, input().split()))\n\nsum_a = 0\nsum_i = sum(a)... | ['Wrong Answer', 'Accepted'] | ['s624433015', 's373998886'] | [31600.0, 31748.0] | [2206.0, 140.0] | [220, 173] |
p02572 | u185405877 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n=int(input())\ni = list(map(int, input().split())) \n\nm=sum(i)\n\nans=0\nfor k in range(n-1):\n ans+=(i[k]+(m-i[k]))\nans=ans//2\nans=ans%(10**9+7)\nprint(ans)', 'n=int(input())\ni = list(map(int, input().split())) \n\nans=0\nfor k in range(n-1):\n for j in range(i+1,n):\n ans+=(i[k]*i[j])%(10**9+7)\n\... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s444558378', 's509991605', 's671803211', 's055000196'] | [31556.0, 31628.0, 31196.0, 31452.0] | [119.0, 75.0, 125.0, 120.0] | [154, 172, 155, 152] |
p02572 | u186820109 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['i = 0\nj = i+1\nans = 0\nwhile i != n - 1:\n ans = (ans+(a[i] * a[j])) % 1000000007\n j += 1\n if j == n:\n i += 1\n j = i + 1\nprint(ans)\n', 'i = 0\nj = i+1\nans = 0\nwhile i != n - 1:\n ans += a[i] * a[j]\n j += 1\n if j == n:\n i += 1\n j = i + 1\nprint(ans % 1000000007)', 'n = int... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s559546543', 's930348420', 's202910977'] | [9100.0, 8996.0, 31520.0] | [23.0, 24.0, 177.0] | [153, 131, 229] |
p02572 | u191491133 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n=int (input())\na= list(map(int,input().split()))\ns2=int(sum(a)*sum(a))\na2=[int(i*i) for i in a]\nans1=int((s2-sum(a2))/2)\nprint(int(ans1%10**9+7))\n', 'n=int (input())\na= list(map(int,input().split()))\ns2=int(sum(a)*sum(a))\na2=[int(i*i) for i in a]\nans1=(s2-sum(a2))//2\n\nprint(int(ans1%((10**9)+7)))\n'] | ['Wrong Answer', 'Accepted'] | ['s631704168', 's494223950'] | [31704.0, 31532.0] | [104.0, 101.0] | [147, 148] |
p02572 | u193690465 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = input()\nvals = list(map(int, input().split()))\ns = sum(vals)\nret = 0\nfor i, val in enumerate(vals):\n ret += val * (s - val)\n\nmod = 10 ** 9 + 7\nprint(int(ret/2) % mod))', 'n = input()\nvals = list(map(int, input().split()))\ns = sum(vals)\nret = 0\nfor i, val in enumerate(vals):\n ret += val * (s - v... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s525464401', 's953157020', 's962639240'] | [9068.0, 9032.0, 31648.0] | [26.0, 23.0, 116.0] | [174, 174, 174] |
p02572 | u198336369 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na = list(map(int, input().split()))\nsum = 0\nb = [i % (10**9+7) for i in a if i % (10**9+7) != 0]\nprint(b)\nfor j in range(0,len(b)-1):\n for k in range(j+1,len(b)):\n c = b[j]*b[k]\n sum = sum + c\nprint(sum%(10**9+7))', 'n = int(input())\na = list(map(int, input().split()))\nA =... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s187113381', 's885955846', 's157453944'] | [31748.0, 31512.0, 31496.0] | [2210.0, 151.0, 146.0] | [247, 176, 167] |
p02572 | u207582576 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\ns = list(map(int, input().split()))\n \nadd = 0\nj = 0\n \nfor i in range(N):\n for j in range(i+1, N):\n a = s[i] * s[j]\n add += a\n \na = add % (10**9 + 7) \nprint(sum)', 'n=int(input())\na=list(map(int,input().split()))\nmod = 10**9 + 7\n\nsum = 0\nf = 0\n\nfor i in range(n-1):\n f ... | ['Wrong Answer', 'Accepted'] | ['s754642705', 's095242980'] | [31400.0, 31704.0] | [2206.0, 125.0] | [187, 158] |
p02572 | u208588434 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\nX = list(map(int, input().split()))\np = 0\nfor n in range(N):\n for m in range(n+1, N):\n p += X[n]*X[m]\n if p >= 10**9 + 7:\n while p >= 10**9 + 7:\n p -= 10**9 + 7\n \nprint(p)', 'N = int(input())\nX = list(map(int, input().split()))\np = 0\ns = sum(X)\nfor n in range(N):\n s -=... | ['Runtime Error', 'Accepted'] | ['s958144177', 's103812390'] | [9004.0, 31448.0] | [27.0, 143.0] | [204, 171] |
p02572 | u213497190 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['sum_ = 0\ntemp = 0\nfor i in range(len(a)-1):\n temp += a[-i-1]\n sum_ += temp * a[-i-2]\n\nprint(sum_%(10**9 + 7))', 'n = int(input())\na = list(map(int, input().split()))\n\nsum_ = 0\ntemp = 0\nfor i in range(len(a)-1):\n temp += a[-i-1]\n sum_ += temp * a[-i-2]\n\nprint(sum_%(10**9 + 7))'] | ['Runtime Error', 'Accepted'] | ['s585087564', 's754771391'] | [9084.0, 31388.0] | [29.0, 145.0] | [115, 169] |
p02572 | u219831209 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na = list(map(int, input().split()))\nmod = 10 ** 9 + 7\ns = 0\nSum = 0\nfor i in range(n):\n s = (s+a[i]) % mod\nfor i in range(n):\n Sum = (Sum+a[i]*(mod+s-a[i])) % mod\nprint(int(Sum/2)+1)\n', 'n = int(input())\na = list(map(int, input().split()))\nmod = 10 ** 9 + 7\ns = 0\nSum = 0\nfor i in... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s150420533', 's377262190', 's665734532', 's959238333', 's286329177'] | [31484.0, 31336.0, 31552.0, 31544.0, 31600.0] | [178.0, 138.0, 138.0, 173.0, 131.0] | [206, 194, 194, 199, 172] |
p02572 | u221149873 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\nAs = list(map(int,input().split()))\n\nout = (sum(As)**2 - sum([a**2 for a in As]))/2\nprint(out % (10**9+7))', 'N = int(input())\nAs = list(map(int,input().split()))\n\nout = (sum(As)**2 - sum([a**2 for a in As]))//2\nprint(out % (10**9+7))'] | ['Wrong Answer', 'Accepted'] | ['s013037649', 's367247105'] | [31444.0, 31484.0] | [134.0, 124.0] | [123, 124] |
p02572 | u224392054 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['import math\nfrom fractions import Fraction as frac\n\nMOD = 1e9 + 7\n\ndef solve(case_no):\n n = int(input())\n a = list(map(int, input().split()))\n ps = [a[0]]\n for i in range(1, n):\n ps.append(ps[i - 1] + a[i])\n ans = 0\n for i in range(n - 2, -1, -1):\n ans += a[i + 1] * ps[i]\... | ['Wrong Answer', 'Accepted'] | ['s657356941', 's421744563'] | [32968.0, 32816.0] | [190.0, 167.0] | [404, 412] |
p02572 | u239091426 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na = list(map(int, input().split()))\nleft = 0\nright = 0\nfor i in range(n):\n left += a[i]\n left %= (10**9+7)\nfor j in range(n):\n right += a[j]\n right %= (10**9+7)\nc = (left*right)%(10**9+7)\nl = [(k**2)%(10**9+7) for k in a]\nprint(((c+(10**9+7)-sum(l))**(10**9+5))%(10**9+7))', 'n = int(i... | ['Time Limit Exceeded', 'Accepted'] | ['s935402289', 's764390949'] | [36384.0, 31448.0] | [2207.0, 194.0] | [293, 317] |
p02572 | u239368018 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\nA = map(int,input().split())\n\nmod = 1000000007\n\nans = 0\ntmp1, tmp2 = 0, 0\n\nfor m in A:\n tmp1 = (tmp1+m) %mod\n tmp2 = (tmp2+m*m%mod)%mod\n \nans = ((tmp1*tmp1)%mod-tmp2)%mod\n\nif ans%2 ==0:\n ans = ans/2\nelse:\n ans =(ans+mod)/2\n\nprint(float(ans))', 'n = int(input())\nA = map(int,in... | ['Wrong Answer', 'Accepted'] | ['s198327670', 's684827594'] | [25216.0, 25056.0] | [140.0, 143.0] | [263, 261] |
p02572 | u240630407 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['# import itertools\n# import math\n# import sys\n\nimport numpy as np\n\nN = int(input())\n# S = input()\n# n, *a = map(int, open(0))\n# N, M = map(int, input().split())\nA = list(map(int, input().split()))\n# B = list(map(int, input().split()))\n# tree = [[] for _ in range(N + 1)]\n# B_C = [list(map(int,input().spli... | ['Wrong Answer', 'Accepted'] | ['s769979130', 's365939057'] | [49964.0, 50256.0] | [508.0, 290.0] | [1311, 1327] |
p02572 | u243312682 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ["import sys\nimport numpy as np\n\ndef main():\n n = int(input())\n A_ = [int(x) for x in input().split()]\n A = [a for a in A_ if a != 0]\n N = len(A)\n\n mod = 10**9+7\n PR = 2\n order = [1]\n x = PR\n while x != 1:\n order.append(x)\n x *= PR\n x %= mod\n\n order_l... | ['Time Limit Exceeded', 'Accepted'] | ['s964403908', 's157950679'] | [592028.0, 31620.0] | [2229.0, 142.0] | [1035, 357] |
p02572 | u244466744 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\nA = list(map(int, input().split()))\nsum = 0\n\nfor i in range(N):\n sum_a += A[i] \n\nfor i in range(N):\n sum_a -= A[i]\n sum += A[i] * sum_a\n ans = sum % (10**9 + 7)\n\nprint(ans)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nsum = 0\n\nfor i in range(N - 1):\n for j in rang... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s103789863', 's111565208', 's818369484', 's006403706'] | [31420.0, 31632.0, 31680.0, 31552.0] | [67.0, 2206.0, 2206.0, 166.0] | [194, 176, 178, 204] |
p02572 | u245375581 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['#!/usr/bin/env python3\n\nn=int(input()) #->n=5\na=list(map(int,input().split())) #->nl=[1,2,-,n]\n\ntemp = 0\nfor i in range(n-1):\n for j in range(i+1,n):\n temp = temp + a[j]\n temp = temp*a[i]\n temp = temp % (10**9+7)\n\nprint(temp)\n\n', '#!/usr/bin/env python3\n\nn=int(input()) #->n=5\na=lis... | ['Wrong Answer', 'Accepted'] | ['s804891572', 's556677464'] | [31400.0, 31464.0] | [2206.0, 202.0] | [245, 278] |
p02572 | u247211039 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N=int(input())\nA=list(map(int, input().split()))\nMOD=7+10**9\nans=0\nfor i in range(len(A)-1):\n for j in range(i+1,len(A)):\n print(A[i],A[j])\n ai= A[i] % MOD\n aj=A[j] % MOD\n ans = ans +ai*aj % MOD\nprint(ans%MOD)', 'N=int(input())\nA=list(map(int, input().split()))\n\nMOD=7+10**9... | ['Wrong Answer', 'Accepted'] | ['s164401089', 's303740604'] | [63520.0, 31752.0] | [2282.0, 142.0] | [240, 155] |
p02572 | u250944591 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n=int(input())\na=list(map(int,input().split()))\nb=0\nfor i in range(n-1):\n for j in range(i+1,n):\n b=(b+i*j)%(10^9+7)\nprint(b)\n', 'n=int(input())\na=list(map(int,input().split()))\nb=sum(a)%(10^9+7)\nfor i in range(len(a)):\n a[i]=(a[i]%(10^9+7))*b\nprint(sum(a))', 'n=int(input())\na=list(map(int,input().s... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s232325112', 's969450982', 's955767688'] | [31652.0, 31400.0, 31428.0] | [2206.0, 115.0, 148.0] | [130, 128, 144] |
p02572 | u251075661 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['import itertools\n\nn = int(input())\naaa = list(map(int, input().split()))\n\nresult = 0\nfor aa in itertools.combinations(aaa, 2):\n result += aa[0] * aa[1]\n \nprint(result % 10 ** 9 + 7)', 'n = int(input())\naaa = list(map(int, input().split()))\n\nsum_a = 0\nsum_aa = 0\nfor a in aaa:\n sum_a += a\n sum_aa +=... | ['Wrong Answer', 'Accepted'] | ['s186697128', 's715378882'] | [31236.0, 31576.0] | [2206.0, 166.0] | [183, 177] |
p02572 | u260370057 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na = list(map(int,input().split()))\ncount = 0\nsu = sum[a]\nfor i in range(n-1):\n\tsu -= a[i]\n\tcount += a[i]*su\nprint(count%(10**9+7))', 'n = int(input())\na = list(map(int,input().split()))\ncount = 0\nsu = sum(a)\nfor i in range(n-1):\n\tsu -= a[i]\n\tcount += a[i]*su\nprint(count%(10**9+7))'] | ['Runtime Error', 'Accepted'] | ['s475801125', 's609804149'] | [31384.0, 31536.0] | [76.0, 130.0] | [147, 147] |
p02572 | u264395947 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['A = list(map(int, input().split()))\n\nB = [0]*N\n\nnum = 0\nfor i in reversed(range(N)):\n B[i] = A[i] + num\n num = B[i]\n \nans = 0\nfor i in range(N-1):\n ans += A[i]*B[i+1] \n\nprint(ans%1000000007)', 'N = int(input())\nA = list(map(int, input().split()))\n\nB = [0]*N\n\nnum = 0\nfor i in reversed(ra... | ['Runtime Error', 'Accepted'] | ['s243186014', 's260573359'] | [9020.0, 31488.0] | [27.0, 181.0] | [202, 230] |
p02572 | u282376189 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\nA = list(map(int,input().split()))\nmod = 1000000000 + 7\nadd = 0\nfor i in range(N):\n tmp = sum(A[i+1:N])\n add += tmp * A[i]\nprint(add%mod', 'N = int(input())\nA = list(map(int,input().split()))\nmod = 1000000000 + 7\nadd = 0\ntmp = sum(A)\nfor i in range(N):\n tmp -= A[i]\n add += t... | ['Runtime Error', 'Accepted'] | ['s298983589', 's206240786'] | [8972.0, 31524.0] | [26.0, 130.0] | [159, 165] |
p02572 | u285497176 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n = int(input())\na = list(map(int,input().strip().split()))\n\nm = 10 ** 9 + 7\ndef main():\n r = 0\n for nn in range(n):\n r += a[nn]\n print(r)\n return\n\nmain()\n', 'n = int(input())\na = list(map(int,input().strip().split()))\n\n\nm = 10 ** 9 + 7\ndef main():\n s = sum(a)\n ss = 0\n ... | ['Wrong Answer', 'Accepted'] | ['s597475814', 's787951416'] | [31292.0, 31488.0] | [90.0, 123.0] | [174, 236] |
p02572 | u290866833 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\n\nA = list(map(int, input().split()))\nS = sum(A)\n\nfor i in range(N-1):\n S -= A[i]\n ans += A[i] * S\n \n\nans = ans % (10 ** 9 +7) \n\nprint(ans)\n', 'N = int(input())\n\nA = list(map(int, input().split()))\nS = sum(A)\nans = 0\nfor i in range(N):\n S -= A[i]\n ans += A[i]... | ['Runtime Error', 'Accepted'] | ['s680594898', 's098132892'] | [31544.0, 31464.0] | [72.0, 127.0] | [173, 177] |
p02572 | u290887281 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['mod = 10 ** 9 + 7\nn = int(input())\na_list = list(map(int, input().split()))\nresult = 0\na_sum = sum(a)\nfor i in a_list:\n a_sum -= i\n result += i * a_sum\nprint(result % mod)', 'mod = 10 ** 9 + 7\nn = int(input())\na_list = list(map(int, input().split()))\nresult = 0\na_sum = sum(a)\nfor i in a_list:\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s509970638', 's675948032', 's029053784'] | [31556.0, 31388.0, 31472.0] | [78.0, 80.0, 117.0] | [177, 177, 182] |
p02572 | u303711501 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n=int(input())\na = list(map(int,input().split()))\ndef p(val):\n print(val)\n \nsho = 10**9 +7\na1 = sum(a)**2\nb1 = list(map(lambda y:y**2,a))\nb2=sum(b1)\nresult = ((a1-b2)/2)% sho\np(result)', 'n=int(input())\na = list(map(int,input().split()))\ndef p(val):\n print(val)\n \nsho = 10**9 +7\na1 = sum(a)**2\nb... | ['Wrong Answer', 'Accepted'] | ['s299809451', 's109952427'] | [31628.0, 31392.0] | [138.0, 128.0] | [187, 188] |
p02572 | u304058693 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['import numpy as np\nimport itertools as it\n\nn = int(input())\na = list(map(int, input().split()))\n\ncombinations_lis = list(it.combinations(a, 2))\nprint(combinations_lis)\n\nsum = 0\nfor i in range(len(combinations_lis)):\n sum += combinations_lis[i][0] * combinations_lis[i][1]\nprint(sum % (10 ** 9 + 7))\n\n\... | ['Wrong Answer', 'Accepted'] | ['s027907358', 's045362093'] | [1943952.0, 31656.0] | [2276.0, 109.0] | [428, 341] |
p02572 | u304593245 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['import functools\nimport operator\n\nN = int(input())\nA = list(map(int, input().split()))\nmod = 10**9+7\nans = 0\n\nfor i in range(2**len(A)):\\\n list2 = []\n for j in range(len(A)):\n if (i >> j) &1 == 1:\n list2.append(A[j])\n if len(list2) == 2:\n ans += list2[0]*list2[1]\n# ... | ['Runtime Error', 'Accepted'] | ['s473308436', 's943322288'] | [8988.0, 32216.0] | [24.0, 139.0] | [365, 188] |
p02572 | u309120194 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\nA = list(map(int, input().split()))\n \ns = 0\nfor i in range(N):\n s += A[i]\n s %= (10**9+7)\ns = s**2\ns %= (10**9+7)\n \nt = 0\nfor i in range(N):\n t += (A[i]**2 % (10**9+7))\nt %= (10**9+7)\n\nans = (s-t) % (10**9+7)\ntmp = (2**1000000005) % (10**9+7)\nans *= tmp\nans %= (10**9+7)\nprint(an... | ['Time Limit Exceeded', 'Accepted'] | ['s963157052', 's135931475'] | [244904.0, 31436.0] | [2213.0, 198.0] | [301, 359] |
p02572 | u322171361 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['input()\na = list(map(int, input().split()))\nc = 1000000007\nprint(((sum(a)**2-sum(map(lambda x: x**2, a)))/2)%c)', 'input()\na = list(map(int, input().split()))\nc = 1000000007\nprint(((sum(a)**2-sum(map(lambda x: x**2, a)))//2)%c)'] | ['Wrong Answer', 'Accepted'] | ['s529397129', 's065233257'] | [31424.0, 31596.0] | [132.0, 119.0] | [111, 112] |
p02572 | u326278153 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ["n = int(input())\na = list(map(int, input().split()))\nmod = 1000000007\nres = 0\n\nfor i in range(n - 1):\n for j in range(n - (i + 1)):\n print(a[i] , '*' , a[i + (j + 1)])\n res = (res + a[i] * a[i + (j + 1)] % mod) % mod\n\nprint(res)\n", 'n = int(input())\na = set(list(map(int, input().split())... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s369540385', 's523390814', 's166995818'] | [58908.0, 31612.0, 31592.0] | [2299.0, 107.0, 149.0] | [247, 183, 212] |
p02572 | u327498205 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\nA = list(map(int,input().split()))\nsumm1 = 0\nanswer = 0\ntemp = 0\nsumm2 = 0\nsumm3 = 0\nfor i in range(N):\n summ1 += A[i]\nfor l in range(N):\n summ3 += A[l]\n summ2 += A[l]*(summ1-summ3)\n print(summ3)\n print(summ2)\nanswer = summ2 % 1000000007\nprint(answer)', 'N = int(input())... | ['Wrong Answer', 'Accepted'] | ['s618608861', 's806314524'] | [31544.0, 31624.0] | [387.0, 168.0] | [283, 249] |
p02572 | u329730886 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['import numpy as np\n\nN = int(input())\nA = np.asarray(input().split()).astype(np.int)\n\na = np.tile(A,(N, 1))\na = a * a.T\n\na_diag = np.diag(a).sum()\na = ((a.sum()-a_diag)/2)\n#print(a/10e9+7)\nprint(int(np.mod(a, 10**9+7)))', 'import numpy as np\n\nN = int(input())\nA = np.asarray(input().split()).astype(np.int... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s177532843', 's213928731', 's316578428', 's334908612', 's399777292', 's573230116', 's591979657', 's648025329', 's874628154', 's979569793', 's134187642'] | [1822420.0, 59104.0, 59404.0, 59504.0, 59504.0, 59236.0, 31612.0, 26952.0, 59380.0, 9060.0, 31520.0] | [1569.0, 219.0, 232.0, 2207.0, 241.0, 2206.0, 249.0, 119.0, 2207.0, 22.0, 187.0] | [323, 168, 187, 182, 166, 186, 246, 194, 211, 175, 233] |
p02572 | u332135290 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['import itertools\n\nN = int(input())\nA = list(int(x) for x in input().split())\n\nmod = 10**9+7\nans = 0\nsumm = 0\n\nfor i in range(N):\n summ += A[i]\n summ %= mod\n\nfor i in range(N):\n summ -= A[i]\n print(summ)\n if summ < 0:\n sum += mod\n ans += A[i] * summ\n print(ans)\n ans %... | ['Runtime Error', 'Accepted'] | ['s881907730', 's889004270'] | [31648.0, 31628.0] | [302.0, 164.0] | [330, 213] |
p02572 | u337573893 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['N = int(input())\n \nA = list(map(int, input().split()))\n \nc = 0\n \nfor i in range(N-2):\n for j in range(int(i)+1, N):\n d = A[i] \n e = A[j] \n c = (c + d*e) % (10**9+7)\n \n \n \nc = c % (10**9+7)\n \nprint(c)', 'N = int(input())\n\nA = list(map(int, input().split()))\n\nS = 0\nfor i in range(N)... | ['Wrong Answer', 'Accepted'] | ['s044212010', 's384488749'] | [31616.0, 31548.0] | [2206.0, 165.0] | [215, 197] |
p02572 | u344813796 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['n=int(input())\nA=list(map(int,input().split()))\nAr=list(itertools.accumulate(A))\nans=0\nfor i in range(n-1):\n ans+=A[i]*(Ar[n-1]-Ar[i])\n ans%=10**9+7\nprint(ans)', 'import itertools\n#h,w=map(int,input().split())\n#S=[list(map(int,input().split())) for _ in range(h)]\nn=int(input())\nA=list(map(int,input()... | ['Runtime Error', 'Accepted'] | ['s050429401', 's198433331'] | [31516.0, 31196.0] | [72.0, 156.0] | [165, 267] |
p02572 | u347502437 | 2,000 | 1,048,576 | Given are N integers A_1,\ldots,A_N. Find the sum of A_i \times A_j over all pairs (i,j) such that 1\leq i < j \leq N, modulo (10^9+7). | ['ut())\nA = list(input().split())\nB = [int(a) for a in A]\nx = 10**9+7\nsummation = sum((B[i] * (sum(B[j] for j in range(i+1,N)) % x)) % x for i in range(N-1)) % x\nprint(summation)', 'N = int(input())\nA = list(input().split())\nB = [int(a) for a in A]\nx = 10**9+7\nsummation1 = sum(B) ** 2\nsummation2 = sum(b ** 2 ... | ['Runtime Error', 'Accepted'] | ['s544464601', 's159466704'] | [8996.0, 32588.0] | [22.0, 132.0] | [176, 206] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.