| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| для тех, кто не знает геометрии | Vyacheslav Kim | 1874. Футбольные ворота | 1 авг 2018 00:37 | 3 |
Если вы такой же идиот в геометрии, как и я, то сделайте 2 вложенных тернарных поиска по углам и все пройдет :). Удачи FFFUUUU This is a bad solution. There is just a formula for maximum area Nah. Ternary search on coordinates works well too |
| How to solve this problem with 150KB?? | Victor Barinov (TNU) | 1378. Искусственный интеллект | 31 июл 2018 22:36 | 8 |
Some authors solved this problem with very good time and very small memory. But if we store input data without compressing it is necessary near 1Mb. Maybe there exist solution without storing input at all? Who can help me to understand how it is possible? You just calculate frequencies of appearing black cells for every row and column. This requires only ~10Kb of memory, and at the same time allows to recognize the figure Thank you for your answer. But I still don't know how to use frequencies for recognition figures... Just think how density functions of projection of every of these figures look like. Circle recognition is easy even by one projection. For some bad cases of squares and triangles you need both projections. wow! beautifull idea :) My solution use symmetric of figures. In fact, better solution than Sergei said is possible. I think if done in assembly under MS-DOS, solution could use less than half of kilobyte of memory. I save only 8 points which enough for solution |
| Wa3 + some advices | Gleb Koveshnikov | 1159. Fence | 31 июл 2018 20:29 | 1 |
Wa3 - answer is 0.00. there you should check the longest block ;) I counted radius with precision 1e-10, upper bound is 1e6. P.s. dont forget cases there center of circle is outside(like sample) |
| Statement lies: there are test cases when crosses needs two moves to win | Burakov Vladyslav | 1195. Крестики-нолики | 31 июл 2018 00:32 | 3 |
Statement lies: there are test cases when crosses needs two moves to win. That pisses me off, because it's always a great challange to understand the right meaning of a statement, but this one just doesn't give you a chance to do that. I think, there is no cases when crosses win in two moves I think, there is no cases when crosses win in two moves There are at least 3 cases that I found in the discussions: #X# #OX XOO #X# O#O XOX X## O#X XOO |
| WA test 5 | Chuyan Dmitry | 1414. Астрономическая база данных | 30 июл 2018 21:39 | 3 |
please give me some tests.All test that I found in other topic my programm pass. When the program is launched, the database contains a single word "sun". >>If the length of the resulting list exceeds 20, then you should output the first 20 names only. So, this was my mistake, I initially ignored this statement. Trie with pointers, std::string and std::cin/std::cout gets AC in 0.31 with 10 372 KB used. |
| what is test 6????? Please Heeeeelp!!! | Yusufjon | 1131. Копирование | 30 июл 2018 19:16 | 1 |
I can't find mistake, help!! #include <iostream> #include <cmath> using namespace std; int main() { __int64 n,k; int s = 0; cin>>n>>k; int step; step = log(k)/log(2); if(n-pow(2,step+1)>=0) { n -= pow(2,step+1); s = (step+1)+ceil(n*1./k); } else { s = ceil(log(n)/log(2)); } cout<<s; } |
| I didn't thoght it would be so easy | Aleksei Kumarin [Samara SAU] | 1573. Алхимия | 29 июл 2018 22:56 | 3 |
just the rule of multiplication in combinatorics... just one problem - the sequence of colors, but many 'if's will save the World! Use set data structure Add each color from input to a set Check the set for red, blue and yellow |
| I have one formula but WA8. Give me some tests pls | Feriter | 1131. Копирование | 29 июл 2018 12:58 | 1 |
Formula: ceil(log2(min(n, k))) + ceil((double)(n - (1 << (int)(ceil(log2(min(n, k))))))/ k) Edited by author 29.07.2018 13:01 Edited by author 09.09.2018 17:50 |
| WA16 | Gleb Koveshnikov | 1358. Провода | 28 июл 2018 19:48 | 1 |
WA16 Gleb Koveshnikov 28 июл 2018 19:48 This test helped me to get ac after wa16: 5 1 2 1 3 2 5 3 4 |
| DELETE SOLUTION | mNT | 1545. Иероглифы | 28 июл 2018 15:42 | 1 |
Edited by author 28.07.2018 15:42 |
| LOL I solved but don't know how.. | IlushaMax | 1683. Холодильник | 28 июл 2018 13:19 | 2 |
sol.push_back(ceil((double)n/2)) (sol is vector in c++) If you solved it using such code, please explain why it works. Basically, it's a greedy algorithm: the maximum length you can fold is CURRENT_LENGTH / 2. So, you just fold it in half until it's of length 1. |
| Если будет ошибка на тесте 11 (WA11) | Diversus | 1493. В одном шаге от счастья | 27 июл 2018 20:01 | 2 |
Проверяйте пограничные ситуации, когда номер билета на входе 000000 или 999999 номера 000000 и 999999 проверять не надо,потому что сумма первых трёх цифр не отличается на единицу от суммы последних трёх цифр(по условию). |
| wa3 | Denis | 1890. Деньги из воздуха | 26 июл 2018 18:45 | 3 |
wa3 Denis 24 окт 2012 14:01 double check lazy calculations Edited by author 25.10.2012 03:55 Re: wa3 Gilles Deleuze 26 июл 2018 18:45 Had a problem here as well. In my code I do the following void apply_push(int64 postponed) { sum += (r - l) * postponed; lazy += postponed; } The following function is called when node range is contained within update range. And at first I had the following code that caused WA3 which caused same update to be performed several times. void apply_push(int64 postponed) { lazy += postponed; sum += (r - l) * lazy; } Re: wa3 Gilles Deleuze 26 июл 2018 18:45 Edited by author 26.07.2018 18:46 |
| . | Viktor Krivoshchekov`~ | 2056. Стипендия | 25 июл 2018 00:45 | 2 |
. Viktor Krivoshchekov`~ 18 янв 2018 14:31 deleted Edited by author 26.10.2021 22:50 Сделай так, запиши все элементы в массив, а затем выводи их с условием: if (massiv[i] == 3) a++(ну или a = a+1), я просто не знаю, на каком языке ты работал. Далее, если а больше 0, значит нет стипендии, ибо есть тройка. Потом также с 5 и 4. Если больше 4 так то так то, если 5 аналогично, а если нет троек и кол - во 4 равно кол - во 5, то так то так то |
| Help Please WA30!!!! I 'm waiting !! thank you!!! | Yusufjon | 1837. Число Исенбаева | 25 июл 2018 00:22 | 1 |
I think my idea completely right What's wrong?????? import java.util.Scanner; public class Main { public static void main(String [] args) { Scanner in = new Scanner(System.in); int n; n = in.nextInt(); String s[][] = new String[n][3]; for(int i=0;i<n;i++){ for(int j=0;j<3;j++){ s[i][j] = in.next(); } } boolean all[][] = new boolean[n][3]; String ss[][] = new String[3*n][3*n]; ss[0][0] = "Isenbaev"; int []index = new int[3*n]; for(int i=0;i<n;i++){ index[i] = 0; } index[0] = 1; int d = 1; for(int i=0;i<n;i++){ for(int j=0;j<3;j++){ if(s[i][j].equalsIgnoreCase("Isenbaev"))all[i][j] = true; } } boolean BOR = false; for(int i=0;i<n;i++){ for(int j=0;j<3;j++){ if(s[i][j].equalsIgnoreCase("Isenbaev"))BOR = true; } } for(int q=0;q<3*n;q++){ boolean bormi = false; for(int i=0;i<n;i++){ boolean bor = false; for(int j=0;j<3;j++){ for(int t=0;t<index[d-1];t++){ if(ss[d-1][t].equalsIgnoreCase(s[i][j])){ bor = true; break; } }if(bor)break; } if(bor){ for(int j=0;j<3;j++){ if(!all[i][j]){ ss[d][index[d]++] = s[i][j]; all[i][j] = true; bormi = true; for(int g=0;g<n;g++){ for(int h=0;h<3;h++){ if(s[g][h].equalsIgnoreCase(s[i][j]))all[g][h] = true; } } } } } } if(bormi)d++; } String []sss = new String[3*n]; int []son = new int[3*n]; for(int i=0;i<3*n;i++){ son[i] = -1; } int koef = 0; for(int i=0;i<d;i++){ if(i==0){ if(BOR){ BOR = false; }else i++; } for(int j=0;j<index[i];j++){ sss[koef] = ss[i][j]; son[koef++] = i; } } for(int i=0;i<n;i++){ for(int j=0;j<3;j++){ if(!all[i][j]){ boolean top = true; for(int p=0;p<koef;p++){ if(sss[p].equalsIgnoreCase(ss[i][j]))top = false; } if(top)sss[koef++] = s[i][j]; } } } n = koef; for(int i=0;i<n-1;i++){ if(sss[i].compareTo(sss[i+1])>0){ String S = sss[i]; sss[i] = sss[i+1]; sss[i+1] = S; int SS = son[i]; son[i] = son[i+1]; son[i+1] = SS; i=-1; } } for(int i=0;i<koef;i++){ if(son[i]!=-1)System.out.println(sss[i] + " " + son[i]); else System.out.println(sss[i] + " undefined" ); } } } Edited by author 25.07.2018 00:30 Edited by author 27.07.2018 23:09 |
| You can find test cases here | Gilles Deleuze | 1695. Работа для роботов | 24 июл 2018 19:04 | 1 |
You can make this problem even harder by setting TL to 1s. My current solution runs in 0.96s and there are two optimizations that aren't too hard to come up with that can speed up program significantly (probably sub 0.1s). Firstly, for any complete graph on N vertices the answer is 2^N. Secondly, if you program has TL issues look up 3-regular graphs, they are the worst case of my algorithm. My solution uses no random, there is a nice deterministic solution, i.e. no hashes or shuffling. The following tests should be enough to get rid of all WAs Tests: 3 001 000 100 Answer: 5 6 000001 001001 010000 000001 000000 110100 Answer: 11 6 010010 101010 010100 001011 110100 000100 Answer: 15 4 0011 0000 1001 1010 Answer: 9 4 0110 1011 1101 0110 Answer: 12 4 0001 0000 0000 1000 Answer: 6 10 0001111111 0011111111 0101111111 1110111101 1111011110 1111100111 1111100111 1111111000 1110111001 1111011010 Answer: 195 7 0111101 1011110 1100111 1100111 1111000 0111001 1011010 Answer: 39 Edited by author 24.07.2018 19:09 |
| WA #5 Could you please give some hints? | Accepted | 1846. НОД 2010 | 24 июл 2018 03:13 | 3 |
> I use the segment tree,but I can't find anything wrong... > Could you please give me some tests so that I can find out my program's problem? > Thank you. But now I got WA #5,and I have considered the following tests: 6 + 9 - 3 - 3 + 3 + 3 + 3 And I think the answer is: 9 9 9 9 9 3 But I still WA #5,Could someone can give me some hints or some tests? Edited by author 20.06.2013 10:52 Edited by author 20.06.2013 10:52 6 + 9 - 3 - 3 + 3 + 3 + 3 It`s impossible. Read the task again. Edited by author 15.08.2013 13:41 May be you don't use Long long |
| an example for those,who also didn't understand task condition | nikita20031405 | 1925. О заслуге британских учёных | 23 июл 2018 21:14 | 1 |
#include <iostream> using namespace std; int main(){ int n(0),m(0),last(0),temp_f(0),temp_s(0),end_(0); cin >> n >> m; for(int i = 0;i<n;++i){ cin >> temp_f >> temp_s; last += temp_f-2-temp_s; } end_ = last + (m - 2); if(end_ < 0)cout << "Big Bang!"; else cout << end_; return 0; } |
| import numpy | ura | | 23 июл 2018 13:25 | 1 |
can I import the numpy library |
| WHAT? TIME LIMIT EXCEEDED. PLEASE HELP! | mNT | 1021. Таинство суммы | 23 июл 2018 12:30 | 1 |
type a = array[1..50000] of integer; b = array[1..50000] of integer;
Var c,d,i,k,g: integer; Var n: a; Var p: b;
begin d:= 0; read(c); for i:= 1 to c do read(n[i]); read(k); for i:= 1 to k do read(p[i]);
for i:=1 to c do for g:=1 to k do begin if (n[i] + p[g] = 10000) then begin writeln('YES'); exit; end else if (i = c) and (g = k) and (n[i] + p[g] <> 10000) then begin writeln('NO'); exit; end; end; end. |