| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| 1Y | Shen Yang | 1432. Двойное счастье | 25 ноя 2016 12:47 | 1 |
1Y Shen Yang 25 ноя 2016 12:47 |
| not sure about statement | Motasem AL-Kayed | 1936. Шоушилин | 25 ноя 2016 01:32 | 1 |
the statement says "You should help him determine the expected value of prize in case of his victory" but I believe it should be the case of anyone's victory. can someone who solved the problem please clarify this? thanks Edit: I got accepted assuming the original statement is wrong Edited by author 25.11.2016 17:53 |
| checker is incorrect | Shen Yang | 1536. Прелести табачного зелья | 24 ноя 2016 17:45 | 1 |
test 7 I output leading zeroes but not give WA verdict,just WA on test 9 |
| Can somebody give me the whole explanation to this problem. Thanks beforehand! | Sanatbek_Matlatipov | 1573. Алхимия | 24 ноя 2016 16:01 | 2 |
Can somebody give me the whole explanation to this problem. Thanks beforehand! If you have two different sets A = {a1, a2, a3} and B = {b1, b2, b3, b4} then we have |A| * |B| = 3 * 4 = 12 ways to choose a pair (a[i], b[j]). i\j b[1] b[2] b[3] b[4] a[1] [1,1] [1,2] [1,3] [1,4] a[2] [2,1] [2,2] [2,3] [2,4] a[3] [3,1] [3,2] [3,3] [3,4] Modern language solution looks like that: map<string, int> cnt; for (auto color : {"Blue", "Red", "Yellow"}) cin >> cnt[color]; int colors; cin >> colors; int ways = 1; for (int i = 0; i < colors; i++) { string color; cin >> color; ways *= cnt[color]; } cout << ways; Edited by author 24.11.2016 16:04 Edited by author 24.11.2016 16:07 |
| about test case 4. | Shen Yang | 1536. Прелести табачного зелья | 24 ноя 2016 12:35 | 4 |
Why number of digits of b is less than number of digits of a1 or a2, and answer is not Impossible, I output Impossible but WA. can we output leading zeroes?? oops seems you can remove all matches... what's the result of test 4: 12+4456=579 4 anyone help? I know 123+456=579, it is a reading comprehension problem.... |
| WA#5 | ILHOMJON | 2102. Миша и криптография | 23 ноя 2016 02:35 | 1 |
WA#5 ILHOMJON 23 ноя 2016 02:35 |
| The means of K and N! | HaiyangZheng | 1009. K-ичные числа | 22 ноя 2016 11:19 | 7 |
My English is poor, but I read it by a large time and I understood. N=2,K=10 ==>it's a "2 digits 10-base" 10,11,...98,99... in Chinese "2位的十进制数字" if k equal to 30 and n equal to 2 , numbers are 30 , 31 , 32 , 33 , .......,99 is it true? Edited by author 10.10.2012 23:50 Edited by author 10.10.2012 23:50 10 based notation of 10 is 10 but 2 based notation of 10 is 1010 I understand if k equal to 30 and n equal to 2 , numbers are 30 , 31 , 32 , 33 , .......,99 is it true? Edited by author 10.10.2012 23:50 Edited by author 10.10.2012 23:50 I don't understand. How can k equal to 30... In statement there is limit 2 ≤ K ≤ 10; N位数长,K进制,的所有数字中,不包含两个连续0的所有数字的个数。 oh my god!i like your answer! |
| No subject | JamesBond_007 | 1354. Палиндром. Он же палиндром | 22 ноя 2016 09:50 | 1 |
Help me WA4? #include <iostream> #include <string> #include <string.h> #include <algorithm> using namespace std; string S, ss, s; int k, l, r, mid; int main(){ cin >> S; int n = S.size(); if(n == 1){ cout << S; return 0; } for (int i = n - 1; i >= 0; i --){ k = n - i; if(i - k >= 0){ ss = S.substr(i, k); s = S.substr(i - k, k); reverse(s.begin(), s.end()); //cout << ss << ' ' << s << endl; if(ss == s){ l = i - k; mid = i; r = i + k; continue; } } k --; if(i - k >= 0){ ss = S.substr(i + 1, k); s = S.substr(i - k, k); reverse(s.begin(), s.end()); //cout << ss << ' ' << s << endl; if(ss == s){ l = i - k; mid = i; r = i + k; } } } //cout << l << ' ' << r << endl; if(!l && !r || (l == 0 && r == n - 1)){ s = S.substr(0, n - 1); cout << S; reverse(s.begin(), s.end()); cout << s; } else{ s = S.substr(0, l); reverse(s.begin(), s.end()); cout << S << s; } return 0; } |
| illegal test data | Shen Yang | 1952. Убить дракона | 22 ноя 2016 06:23 | 4 |
problem description said dragon will not use breath two times, but test 21 there is at least three breath in the input file... hope admin can fix it.. oops I misunderstood "in a row" is "in a row" means cosecutive?? I think we must use O(2^20*10) dynamic programming ,because there maybe two breath in a row brute_force will definitely got TLE |
| WA#28 | Влад | 2102. Миша и криптография | 22 ноя 2016 02:28 | 1 |
WA#28 Влад 22 ноя 2016 02:28 |
| WA#11 | Anton | 1302. Дельта-волна | 22 ноя 2016 00:01 | 2 |
WA#11 Anton 16 авг 2012 07:09 Don't know, what else to test ... Any ideas? Re: WA#11 AGrigorii [Yaroslavl SU]🔥 22 ноя 2016 00:01 |
| AllWhoWantsToSolveThisProblem | __Andrewy__ | 2109. Туризм на Марсе | 21 ноя 2016 21:45 | 2 |
I think many people can not solve this problem because they do not have enough knowledge. You should know "Problem LCA" and "Segment Tree" that to solve the problem. My algo is O(n*sqrt(n)+m*log(n)), but i can solve for O(n+m*log(n)) (LCA can be solved for O(1) with preprocess or sqrt(n) without preprocess). P.S. What is the optimal asymptotic behavior? Edited by author 20.11.2016 23:27 Edited by author 20.11.2016 23:27 Edited by author 20.11.2016 23:28 Well, there were quite a lot of LCA + segment tree problems by now, so by now people mostly should know what that is :) As for me, i just took my solution to http://acm.timus.ru/problem.aspx?space=1&num=1471 and only had to modify it very slightly. Just, in there you had to operate with only minimums, and here you need to find a minimum in a certain range of your array of minimums, so there's that additional layer of minimums. |
| WA 18 ? | bayram | 1495. Раз-два, раз-два 2 | 21 ноя 2016 20:30 | 2 |
|
| java ac | pay_all_for | 1725. Аншлаг, аншлаг! | 21 ноя 2016 12:23 | 3 |
java ac pay_all_for 3 авг 2014 07:02 import java.util.Scanner; public class Sold_Out { public static void main(String[] args){ Scanner scan = new Scanner(System.in);
int n = scan.nextInt(); int k = scan.nextInt();
if(n<3){ System.out.println(0); return; }
System.out.println(Math.max(k - 1, n - k) - 2); } } your programm works only because of weak tests. for example: 3 1 your answer is 0, but the correct one is 1. 1 _ _ 1 _ 3 1 2 3 -> there is 1 person from both sides and the distance to number 2 is equal, so in the worst case the person will hit vasya. Edited by author 13.01.2016 01:14 Edited by author 13.01.2016 01:14 |
| sample output | 140701425 | 2104. Игра с полоской | 20 ноя 2016 13:37 | 1 |
Could anyone give me some sample input and output? Thanks a lot. |
| wrong ? | Vadim | 2101. Рыцарский щит | 20 ноя 2016 11:57 | 2 |
Nope. The only inscribed rectangle with area=50 doesn't contain hole. Note, that there are only 4 possible rectangles in the solution. |
| Hint | index | 1118. Нетривиальные числа | 20 ноя 2016 01:52 | 4 |
Hint index 26 фев 2016 09:12 Calculates sum of divisors. O(lim * log(lim)). for(int i = 2; i <= lim; ++i){ ++s[i]; for(int j = i + i; j <= lim; j += i) s[j] += i; } Maybe I don't understand it clear, but I think it will get TL. Difficult of this algorithm = O(n^2) No, it's O(n log n). Learn some math. |
| long is not enough | AfraidDiablo | 1010. Дискретная функция | 20 ноя 2016 00:09 | 2 |
In C++, you'd better use "long long" instead of "long". |
| Ошибка в исходном примере? | jazator | 2104. Игра с полоской | 19 ноя 2016 18:16 | 2 |
4 BBAA BABB = Bob Почему в исходном примере выигрывает Боб? Если при первом сгибе получаем полоску АА, значит должна выиграть Алиса... Почему нет? There is information:"Если после очередного сгиба полоска стала полностью одноцветной".It's mean, both of sides needs to have one color |
| Board of directors | Emiliyan Greshkov | 2103. Корпоративная почта | 19 ноя 2016 15:45 | 2 |
Can members of the director board be subordinates? For example, is 6 a subordinate of 3? Yes, 6 is a subordinate of 1, 2, and 3. Edited by author 19.11.2016 15:45 |