|
|
Общий форумAC QH 10H JC KC 4D AC AC 4D 5D AD 4C 5C JC 2H AC 5C 5D AD 5S 5H JC 2H AC 5C 5D AD 5S 5H JC 2H AD 5C 5D AD 5S 5H JC JH JD JS 8H JC 8C 8D 10H 8H 10H 10D 8D 9D 3D 3C 3H AH AS 2C 3D 4H 2D 3H 4S AH AH 8C QC JC JD 9D KD 3H 3H 8C QC KC JD 9D KD 3H 3H 10C QC KC JD 9D KD 3H 3H 5C 10C 10D 10S 9D 6D 3H 3H AC 10C 10D 10S 9D 6D 3H 3H AC 10C 9C 10S 9D 6D 3H 3H AC 10C 9C 10S 10D 6D 3H 4S AH AS AD AC 10C 10S 3H 4S AH AS AD AC 10C JC 3H 4S AH AS AD AC 10C JC 3H 4S AH QS KD AD KC JD 3H 4S AH QS KD AD KC JD 3H 4S AH AS KD AD AC QD 3H 4S AH AS 3D KS KC 2D 3H 4S AH AS 3D KS KC 2D 2H 2S AH AS 3D KS KC KD 2H 3H AH AS AD KS KC KD 2H 3H 3S 4C 5C 2S 4S 5S AH AD 3S 4C 5C AS AH 2C AH AD 3C 4C 5C AS AH 2C AH AD 3C 4C 5C 2S 7S 10S AH AH 4S 5D 8H 5S 7S 8D 3C 2D 4S 4D 4H 5S 5D 2H 2C 2D 4S 4D 4H 5S 5D 3H 3C 3D 4S 4D 4H 5S 5D 6H 6C 6D 4S 4D 4H 5S 5D 5H 5H 5H AH AS JS AC AD 10S KS KD AH AS KH AC AD 10S KS KD 3C 4C 5C 4S 5S 6S AH AH 3C 4C 5C 3S 4H 5D AH AH 2S 4S 5S 7D 4D 5D AH AH 3D 4D 5D 2S 3S 4S AH AH 4C 4D JS 4S 4H 3H 7S 7S 4C AC 2C 4S KD 6H 5C KH JS 8H JC 8C 8D 10H 8H 10H 10D 8D 9D 3D 3C 3H AH AS 2C 3D 4H 2D 3H 4S AH AH Sasha Dima Artyom Sasha Dima Sasha Dima Artyom Dima Sasha Sasha Sasha Sasha Sasha Sasha Sasha Sasha Sasha Sasha Sasha Sasha Dima Dima Dima Sasha Sasha Dima Sasha Sasha Dima Sasha Dima Dima Dima Dima Artyom Dima Sasha Dima Sasha Sasha Dima Sasha Dima Artyom The output needs to be sorted in ascending order(!) so for test number 5: 45 the correct answer is 59 (5*9) and 95 (9*5) will be rejected. Hope this helps someone. Mine does return 59 yet its said to be WA simple anwser: WA Edited by author 13.11.2022 12:39 1 12 1 1 10 8 1 1 8 10 1 1 9 3 1 1 7 4 1 1 2 4 1 1 5 4 1 1 2 5 1 1 9 9 1 1 3 5 1 1 9 2 1 1 9 5 1 1 5 9 1 1 6 4 Ans: 1 4 Also, check that you print "Impossilbe", when it's impossible to achieve the finish vertex I have correctly performed all tests from the forum, but still WA 3. Please tell me what the problem is or write new tests for me. 8 30 => 35 and not 36 12 26 => 35 and not 36 14 28 => 39 and not 40 15 30 => 42 and not 43 16 32 => 45 and not 46 20 22 => 39 and not 40 20 43 => 60 and not 61 28 27 => 52 (you get the idea) Thanks for the tests, pal. solution on the surface, take a look at the arithmetic mean P #include<bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; while(t--){ string s; cin >> s; int a = int(s[1] - 48); if(s[0]=='a' ||s[0]=='h'){ if(a==1 ||a==8) cout << 2 << endl; else if(a==2||a==7) cout << 3 << endl; else if(a>2) cout << 4 << endl; } else if(s[0]=='b'||s[0]=='g'){ if (a == 1 || a==8) cout << 3 << endl; else if (a == 2|| a==7) cout << 4 << endl; else if (a > 2) cout << 6 << endl; } else{ if (a == 1|| a==8) cout << 4 << endl; else if (a == 2|| a==7) cout << 6<< endl; else if (a > 2) cout << 8<< endl; } } } Из точки (2,2) мы можем попасть в (1,1),а потом в (0,0), сразу в (0,0), в (1,0),а потом в (0,0). В первом случае t=0.63246+0.23277=0.86522, во втором t=0.86522, в третьем t=0.70711+0.15811=0.86522. Я использую формулу для t=(-v+sqrt(v*v+2*g*len*sina))/(g*sina)),если наклонный отрезок и t=len/v иначе. Попробуй вариант 2,2 -> 2,1 -> 0,0 (опускаемся на 1 вниз(по вертикали), потом проводим до конца(по диагонали)) I tested for a long time and tried to understand why the thymus mockingly shows me such a mocking number, it's all because of the portals, it's just impossible there, I got so confused in them that I didn't understand how my code worked, in general, how to avoid such a problem. add all sorts of checks near the portals, which is right wherever there are portals, just destroy these portals completely, absolutely dont add negative numbers to answer i think its something like this 2 ab\df\fd df\df ab df fd df df fd Сама задача конечно же довольно простая. Решив ее несколькими способами я каждый раз упирался в превышение объема допустимой памяти на 11 тесте. Соответственно львиная доля времени ушла на осознание того, что же именно потребляет память и на устранение этого узкого места. Как можно было догадаться, память жрали Строки. Я убрал использование string отовсюду кроме считывания данных из консоли. Хранение данных реализовано через два массива int. Для разбора ввода и для вывода ответов в консоль использовались массивы int и char. Вообще, это одна из тех задач, которые отлично иллюстрируют проблему, описанную в FAQ "Как писать решения на C#": "В некоторых задачах потребуется собственная быстрая реализация разбора входных данных и форматирования выходных". Только здесь проблема не в скорости, а в памяти. somebody faced this problem? somebody has a test data? Try this 4 8 1 8 8 should give 1 4 8 8 1 8 also should give 1 if time of djek ravno time of this people so, this is crash i just draw its in paint and use some kinematick formulas and solve it by that These two tests helped we find my bugs. Test 2 1 3 0 2 1 2 The answer is 4. Test 3 10 20 30 1 29 3 1 2 3 2 1 2 The answer is 29. Hope it will help you too. Indeed helpful. You may buy more taps than you need. if you use the two-pointer method, then you have problems with the left pointer N =int(input()) Nl = [] for i in range(N): Nl.append(int(input()))
M = int(input()) Ml = [] for j in range(M): Ml.append(int(input()))
answerl = [] Nl = set(Nl) Nl = list(Nl) Nl.sort() for ni in Nl: for mi in Ml: if mi == ni: answerl.append(mi) else: continue
print(len(answerl)) #include <stdio.h> int main(){ int a, b, c; scanf("%d", &a); b=12-a; if(b*45<=240){ printf("Yes"); } else{ printf("No"); } return 0; } |
|
|