Common BoardShow all threads Hide all threads Show all messages Hide all messages | Test with maximum L N | Zergatul | 1598. DSA Attack | 17 May 2021 20:04 | 1 | 36 60 60238766947 689134144379425669 151303190236896619 105037406971508485 68317121395 x=6221392564 | WA #8 | dmitrmax | 1018. Binary Apple Tree | 17 May 2021 10:38 | 1 | WA #8 dmitrmax 17 May 2021 10:38 Any thoughts whats in test #8? Solution passes all the tests here on forum and a lot of my tests. Just can't figure out what is wrong... | why this solution is wrong? | Gleb | 1409. Two Gangsters | 16 May 2021 03:02 | 3 | #include<iostream> using namespace std; int main() { int a; int b; int c; int d; int h; cin>>a; cin>>b; h=a-1+b; c=h-a; d=h-b; cout<<c; cout<<d; return 0; } You should test your code locally before submitting, this way you will notice that you missed a space! I've simplified your way. use the following, you'll get the result - c = b - 1; d = a - 1; cout<<c<<" "<<d; Edited by author 16.05.2021 03:02 | Why WA3? | Personal Data | 2157. Skydiving | 15 May 2021 05:45 | 1 | Why WA3? Personal Data 15 May 2021 05:45 | C++ - how to value (a*b)%c, when a,b,c are long long? | ToadMonster | 1013. K-based Numbers. Version 3 | 14 May 2021 21:33 | 4 | long long mul(long long a,long long n) { long long ret; if(n==0) return 0; ret=mul(a,n/2); ret=(ret+ret)%mod; if(n%2) ret=(ret+a)%mod; return ret; } Edited by author 24.11.2016 05:02 LL product_mod(LL a, LL b, LL mod) { a %= mod; b %= mod; LL result = 0, y = a; while(b) { if(b&1) result = ((result%mod) + y) %mod; y = (y + y)%mod; b = b >> 1; } return result%mod; } This is also known as the Russian peasant method for multiplication. For example, 7x13 13 = (8 + 4 + 1) The product is re-written as 8.7 + 4.7. 1.7 In my code, y keeps track of 7, 2.7. 4.7, 8.7, etc. It gets added to result whenever a bit is set in b. long long c = (__int128_t)a*b%md; he he) Edited by author 14.05.2021 21:34 Edited by author 14.05.2021 21:34 | Please give me some tests.Thank in advance!!!! | Search | 1073. Square Country | 13 May 2021 16:11 | 2 | I don't understand problem,please give me some tests.Thank!!!!!! Here are some tests ~~~~~~~~~~~~ 11995=3 11996=4 11997=3 11998=3 11999=4 12000=3 12001=3 12002=2 12003=3 ~~~~~~~~~~~~~~ 23402=2 23403=3 23404=3 23405=3 23406=3 23407=4 23408=4 23409=1 23410=2 23411=3 ~~~~~~~~~~~~~~ 59989=3 59990=3 59991=4 59992=3 59993=2 59994=3 59995=3 59996=4 59997=3 59998=3 59999=4 60000=3 | Hint | yyll | 1172. Ship Routes | 13 May 2021 12:53 | 1 | Hint yyll 13 May 2021 12:53 let there be 2k odd gaps and n-2k even gaps between island A even gaps could be BCBCBC or CBCBCB odd gaps are half BCB half CBC | WA3 | Zergatul | 2101. Knight's Shield | 12 May 2021 01:10 | 2 | WA3 Zergatul 28 Nov 2020 02:48 Try this test: =========================== -10 -10 10 5 5 10 0 0 --- 42.8571428571 5 | OEIS A259935 | yyll | 2047. Maths | 11 May 2021 19:35 | 1 | Edited by author 11.05.2021 19:41 | Frustrating beauvoir of the Judge -- data type limit issue with C++ -- | Nouaili | 1209. 1, 10, 100, 1000... | 11 May 2021 01:55 | 1 | | Can't figure out the WA on test #3. Please, help | Nouaili | 1209. 1, 10, 100, 1000... | 10 May 2021 17:44 | 1 | I checked the output of my code for all K ( 1 <= k <= 65535), I think it gives the correct output. https://github.com/Mourad-NOUAILI/Timus-Online-Judge/blob/main/1209/WA%233 long long type is used. Code explanation: I use a(k) = 1, 2, 2, 4, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 32, 32, 32, 32, 32, 32, 64, 64, 64, 64, 64, 64, 64,... to compute a(k) https://oeis.org/search?q=1%2C2%2C2%2C4%2C4%2C4%2C8%2C8%2C8%2C8%2C16%2C16%2C16%2C16%2C16&sort=&language=english&go=Search the pos(k) in a(k) from 0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 8, 7, 6, 5, 4, 3, 2, 1,.. https://oeis.org/search?q=1+0+2+1+0+3+2+1+0+4+3+2+1+0&sort=&language=english&go=Search sequences are 0-base indexing. example: k = 16 --> a(15) = 32 = (100000)2 pos(15) in 0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 0, 5, 4,... is 5, which means we gonna pick the bit at the 5th position from the left in 100000 100000 543210 so, for k = 16, the answer is 1 Thanks. | About understanding of problem | Noob [NULP] | 1431. Diplomas | 8 May 2021 12:17 | 1 | Edited by author 21.05.2021 00:09 | WHAT IS IN TEST #6 | shota zedashidze | 1402. Cocktails | 7 May 2021 02:43 | 7 | I have the same problem. I printed "endline" after answer. Where did you print endline ? I have the same problem - WA6... | WA#2 | JavXn1 | 1207. Median on the Plane | 6 May 2021 00:41 | 1 | WA#2 JavXn1 6 May 2021 00:41 import math import operator n = int(input()) s = input() l1 = s.split(" ") x = int(l1[0]) y = int(l1[1]) sp = {} for i in range(n-1): s = input().split(" ") x1 = int(s[0]) y1 = int(s[1]) dx = x1-x dy = y1-y dl = math.sqrt(math.pow(dx,2)+math.pow(dy,2)) a = math.degrees(math.asin(dy/dl)) #print(a) sp.update({i+2:a}) sorted_tuples = sorted(sp.items(), key=operator.itemgetter(1)) #print(sorted_tuples) print("1") print(sorted_tuples[len(sorted_tuples)//2][0]) | Тест 12 | Ilya | 1962. In Chinese Restaurant | 5 May 2021 06:44 | 1 | 2 1 2 Ответ: 1 Этот тест может быть крайним случаем в вашем решении так как уже на такой тест и схожие: 3 2 2 3 Ответ: 2 Edited by author 05.05.2021 06:45 | Wrong answer 24 ( Знаю случай ) | Ilya | 1872. Spacious Office | 5 May 2021 04:52 | 1 | Я получил такой вердикт, выводя "Ask Shiftman for help." как только встречалось в цикле подходящее условие, вместо того чтобы проверить все отрезки до конца на наличие случая "Let's search for another office." | where is mistake? Python | Xar4ok | 1880. Psych Up's Eigenvalues | 3 May 2021 00:22 | 1 | m=[] m2=[] for tik in range(3): n=int(input()) m1=input().split() for i in m1: if i not in m: m.append(i) elif i in m: if i not in m2: m2.append(i) print(len(m)-len(m2)) I don't know why this program doesn't work. Edited by author 03.05.2021 00:22 | Unclear statement. | Ajay Jadhav | 1638. Bookworm | 2 May 2021 11:14 | 1 | If you put two books on a bookshelf by facing binding side (book number) outwards i.e facing person, then this problem statement makes sense. | WA 3 | Otrebus | 1768. Circular Strings | 1 May 2021 17:30 | 1 | WA 3 Otrebus 1 May 2021 17:30 The coordinates are given in the traversal order. | WA8 | vtalgo21_RKhuzin | 1628. White Streaks | 29 Apr 2021 19:30 | 1 | WA8 vtalgo21_RKhuzin 29 Apr 2021 19:30 Try this: 3 3 6 1 1 1 2 1 3 2 1 2 2 2 3 Should be: 1 |
|
|