| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Statement | -XraY- | 1405. Пусти козла в огород 5 | 26 фев 2026 06:31 | 2 |
What does it mean: "reach smth"? It's a strict condition, but how should i understand it?) In my opinion, this sample has two right answers: 4 0 0 0 1 0 5 0 8 2 * (1.5 * 1.5) * M_PI or (1 + 3 * 3) * M_PI. You have to find the largest possible answer. Thus the correct answer is: (1 * 1 + 3 * 3) * M_PI = 31.4159 |
| WA #12 | 👨🏻💻 Spatarel Dan Constantin | 2204. Друзья и экамены | 26 фев 2026 04:44 | 1 |
WA #12 👨🏻💻 Spatarel Dan Constantin 26 фев 2026 04:44 input: 2 8 12 28 40 46 48 54 60 80 2 7 9 24 34 49 54 62 66 77 78 79 80 83 84 84 output: 6 |
| WA #39 | 👨🏻💻 Spatarel Dan Constantin | 2217. Двоичная сортировка | 24 фев 2026 17:27 | 1 |
WA #39 👨🏻💻 Spatarel Dan Constantin 24 фев 2026 17:27 input #1: 3 110 output #1: YES input #2: 4 1110 output #2: NO |
| No subject | 👨🏻💻 Spatarel Dan Constantin | 2214. Качественный излучатель | 24 фев 2026 17:25 | 1 |
No subject 👨🏻💻 Spatarel Dan Constantin 24 фев 2026 17:25 Edited by author 24.02.2026 17:26 |
| Is correct second example ?? | coder | 2160. Мета-условие | 24 фев 2026 03:16 | 2 |
12 12 5 3 11 2 8 4 9 1 6 10 7 answer: 34650 in example output. But, following full check test prints 6300. ----- static bool match(int a[], int n, int b[], int m){ if (n != m) return false; if (n == 0 && m == 0) return true;
int i = std::max_element(a, a + n) - a; int j = std::max_element(b, b + m) - b;
return i == j && match(a, i, b, j) && match(a + i + 1, n - i - 1, b + j + 1, m - j - 1); } int main() { int n = 12; int a[] = { 12, 5, 3, 11, 2, 8, 4, 9, 1, 6, 10, 7 }; int b[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; int ans = 0; do{ if (match(a, n, b, n)) ++ ans;
} while (std::next_permutation(b, b + 12) );
printf("ans = %d\n", ans); return 0; }
The second example is correct. In your code, you should replace std::max_element with std::min_element to get the correct answer. |
| Is there any solution aside from DP? | Aleksander | 2173. Мета-условие 3 | 24 фев 2026 02:55 | 3 |
I solved it using pretty straigtforward DP O(n * m^2), obviously it's just a complexity without any additional factors but it doesn't seem to be fitting time limit. Somehow it did. But I wonder, is there any more intricate idea for a faster solution? pretty straigtforward DP O(n * m^2) it doesn't seem to be fitting time limit Most likely, your solution is actually O(N*M), because the statement says "It is guaranteed that the total number of wishes does not exceed 2 · M." I believe the time complexity is actually O(M*(N+M)). |
| 1001 | uen | 1001. Обратный корень | 24 фев 2026 00:58 | 3 |
1001 uen 24 дек 2025 11:34 how to know when there are no more inputs Just use a while loop like this: while( cin >> a ) and then push_back it in a vector and output the solution. while (scanf("%lf", &stack[++top]) != EOF); or while ((tmp = getchar()) != EOF) |
| WA-26 | Dmitrieva Viktoria | 1919. Руины титанов: трансформация цилиндров | 23 фев 2026 21:33 | 1 |
WA-26 Dmitrieva Viktoria 23 фев 2026 21:33 Что за 26 тест? Никак не могу его победить |
| why wa#17? | kurinov649 | 1348. Пусти козла в огород 2 | 22 фев 2026 20:28 | 2 |
why wa#17? help pls Edited by author 23.11.2018 08:05 0 0 0 0 5 0 10 if the length of the segment AB is 0 or point A= point B, then your solution fails. |
| Problem 1589. Sokoban rejudged | Problemset Maintainer | 1589. Сокобан | 22 фев 2026 18:34 | 1 |
New tests have been added. All accepted solutions have been rejudged. 15 out of 20 authors lost the Solved status for this problem. |
| Why this code in python 3 is not woking here though it is working in Jupyter Notebook ? | Prayanshu Singh | 1002. Телефонные номера | 21 фев 2026 12:27 | 2 |
def word_to_num(word): d= {'a':'2','b':'2','c':'2','d':'3','e':'3','f':'3','g':'4','h':'4','i':'1','j':'1','k':'5','l':'5','m':'6','n':'6','o':'0','p':'7','q':'0','r':'7','s':'7','t':'8','u':'8','v':'8','w':'9','x':'9','y':'9','z':'0'} s='' for i in word: s+=d[i] return s from itertools import permutations while True: num_dict={} num_list=[] word_list=[] num = input() if num=='-1': break loop_len = int(input()) for i in range(loop_len): word_list.append(input()) for item in word_list: num_dict[word_to_num(item)]=item num_list.append(word_to_num(item)) perm = permutations(num_list,2) x=0 for k,v in list(perm): if k+v==num: print(num_dict[k]+' '+num_dict[v]) else: x += 1
if x==loop_len*(loop_len-1): print('No solution')
|
| Стал третьим человеком кто сдал все задачи на тимус | kostan3 | | 21 фев 2026 02:16 | 2 |
Как же быстро это сообщение состарилось |
| Is there any easier solution? | Mickkie | 2055. Урбанистика | 20 фев 2026 18:36 | 4 |
One way I can think of is to sort edge by cost and use dynamic connectivity But it's very hard to implement :( What's the better solution? divide and conquer is ok. but i can't understand now .And i get T with dynamic connectivity. One way I can think of is to sort edge by cost and use dynamic connectivity But it's very hard to implement :( What's the better solution? Lucky one, I have TL with this method. |
| What is the complexity of the algorithm? | ilya trofimov | 2199. Фирменный вопрос | 19 фев 2026 19:24 | 1 |
O(n*sqrt(n)*log(n)) enough? Upd: OK with this complexity. But 2.7 c++. How to solve with 0.1 second? Edited by author 21.02.2026 00:26 |
| Test Miners | Milanin | 1589. Сокобан | 28 янв 2026 09:30 | 2 |
Finding out a testcase to improve algorithm does not mean that all submissions use information about tests. I have many submissions that AC, but the code is not based on specific test cases. At least adding strong test and rejudge is OK, removing totally - no. Edited by author 28.01.2026 09:30 |
| Can you give me some "extra" test or smth like that... My prog passed all my tests but i get wa#3... | Dottik[Lviv NU] | 1028. Звёзды | 27 янв 2026 23:03 | 4 |
Can you give me some "extra" test or smth like that... My prog passed all my tests but i get wa#3... Thnx! he he... finaly i passed this test you should be carefull with 32000 its better to use 32002 :) Good Luck! thaa..........anks a lo..........ot! |
| WA 27 | kostan3 | 1952. Убить дракона | 26 янв 2026 22:49 | 1 |
WA 27 kostan3 26 янв 2026 22:49 Accepted:) Edited by author 18.02.2026 21:32 |
| overrated | 👑TIMOFEY👑`~ | 2021. Страшно интересно! | 22 янв 2026 17:06 | 4 |
|
| Если кому интересно... | Ivanov Alexander (HSE) | 1083. Факториалы!!! | 21 янв 2026 21:17 | 32 |
тест 1: n=9 k=2 тест 2: n=1 k=1 тест 3: n=10 k=1 тест 4: n=8 k=1 тест 5: n=10 k=2 тест 6: n=7 k=2 тест 7: n=1 k=2 тест 8: n=2 тест 9: n=10 k=5 тест 10: n=9 k=5 n=3,4,5,6 не встречается... тест 8 - к по условию не может быть меньше 1. В единственной строке сначала дано целое число n, 1 ≤ n ≤ 10, затем ровно один пробел, затем k восклицательных знаков, 1 ≤ k ≤ 20. про значение К в этом тесте не известно 1) 50 Очень интересно а как вы эти тесты извлекли? Edited by author 10.02.2010 23:53 Какой ответ на тест 5? 945? Тест 8 - просто супер. Явная неучтенка. И сколько еще таких тестов? Просто офигенная постановка задачи. Edited by author 16.04.2011 19:50 Скажите,пожалуйста, какой должен быть ответ в тесте номер 8? Я уже пробовала,чтобы программа не пропускала такие варианты с помощью repeat, пробовала ставить в таком случае ответ 1, ответ 0, ответ - само число. Ничего не получается! Edited by author 29.07.2014 13:12 Тест 10: 9 !!!!! = 9(9-5)(9 mod 5) = 9*4*4 = 144 Почему вылазит неправильный ответ?! N mod K — это последний больший нуля элемент ряда N - XK. В данном случае этот элемент первый и он же последний, не нужно умножать на него два раза. Иными словами, мы вычитаем K от исходного числа, и умножаем на получившееся, и повторяем так до тех пор, пока получившееся число не станет нулём или меньше. Еще вопрос: 2 !!! = ? 2 или 4? и какие вводные 11-го теста? Меня очень интересует как в примере 9 !! получилось равным 945 если разбирать описание задачи то получим: n = 9 k = 2 n mod k = 1(есть остатое от деления) тогда получаем 9!! = 9*(9-2)*1 = n(n-k)(n mod k) = 9*7*1 = 63 Ну откуда 945 невкурю???? This problem is easily solving without any precalcing or info about tests. Not more than 15-20 lines of code. I did not ask about the problem of solving the problem. I asked about the correctness of my reasoning, I can not right in the calculation of 9 !! 9 !! i 1) n:=9*(9-2) 2)n:=63*(9-4) 3)n:=315*(9-6) 4)n:=945*(9-8) This is correctness of your reasoning. In my program test 5 is correct, but system writed, that wrong. Answer - 7680 In my program test 5 is correct, but system writed, that wrong. Answer - 7680 All manual tests ok. Test 5 is also in error. I do not understand this... import java.util.*; public class Factor { public static void main(String[] args){ Scanner put=new Scanner(System.in); int n,k,fac; String ffc; n=put.nextInt(); ffc=put.next(); k=ffc.length(); fac=n; for(int i=1;i<(n/k);i++){ fac=fac*(n-(i*k)); } if(n%k!=0)fac=fac*(n%k); else fac=fac*k; System.out.print(fac); } } Edited by author 29.10.2012 17:37используя гамма функцию можно в одну строчку :) Застрял в тесте 8: #include<stdio.h> #include<string.h> int main(){ int n, i, l; char k[20]; scanf("%d%s", &n, k); l = strlen(k); int result = n; i = n - l; do{ result = result * i; i = i - l; } while (i > n % l); if (n == 1) result = 1; printf("%d", result); return 0; } Edited by author 02.12.2017 02:41 Edited by author 02.12.2017 02:41 Edited by author 25.07.2014 12:47 9 !! = 9*(9-2)*(9-2*2)*(9-2*2*2)....*1=9*7*5*3*1=945 Answers for numbers from topic: 1. 945 2. 1 3. 3628800 4. 40320 5. 3840 6. 105 7. 1 8. 2 (if in this case k = 1) 9. 50 10. 36 Моё нестандартное решение :) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class proga { public static void main(String[] args) throws IOException { BufferedReader sc = new BufferedReader(new InputStreamReader(System.in)); String[] temp = sc.readLine().split(" "); int ch = Integer.parseInt(temp[0]); int len = temp[1].length(); int ost = ch%len; int result = ch; if(ost==0){ost+=len;} while(ch!=ost) { ch-=len; result*=ch; } System.out.println(result); } } а какой ответ на тест 5 ? what's the right answer for test 5 ? who knows ? can you give a hand pls тест 1: n=9 k=2 тест 2: n=1 k=1 тест 3: n=10 k=1 тест 4: n=8 k=1 тест 5: n=10 k=2 тест 6: n=7 k=2 тест 7: n=1 k=2 тест 8: n=2 тест 9: n=10 k=5 тест 10: n=9 k=5 n=3,4,5,6 не встречается... why wrong on test 5?? #include<iostream> //#include<string> using namespace std; int main() { int n; string s; cin>>n; cin>>s; int sum=n; int len = s.size(); //cout<<len<<endl; int i =1; while((n-i*len)>1) { sum*=(n-i*len); i++; } if(n%len!=0) cout<<(sum*(n%len))<<endl; else cout<<sum*len<<endl; return 0; } 8th test is 2 !! and the answer is 2 |
| wa9 | 👑TIMOFEY👑`~ | 1257. Переносы | 16 янв 2026 12:44 | 1 |
wa9 👑TIMOFEY👑`~ 16 янв 2026 12:44 incorrectly selected transfer |