| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| GOOD peoples Please help me :( | N0D1R | 1671. Паутина Ананси | 28 фев 2019 16:14 | 6 |
GOOD peoples Please help me! I have got WA#5! I used DSU!! My program gives right answer for all my tests! But again WA#5 and I can not found my mistake! I shall wait advices or tests! Thank you advance!!! What test you used to check it? 4 4 1 2 1 2 2 3 3 4 3 1 2 3 good luck!!! |
| Everybody who get confused on this problem should look at this!! | Dryad | 1067. Структура папок | 28 фев 2019 08:50 | 4 |
just consider this condiction: 2 A\A B\A the correct output is A A B A but if you are mistaken, you will output A A Of course, folders on different depths (or in different subtrees) can have equal names. (look at disk tree on your computer). Edited by author 30.10.2004 22:38 Why couldn't it be : B A A ?? All the given directory addresses start from same common root |
| TLE on #39 | Barish_Namazov | 2102. Миша и криптография | 27 фев 2019 12:56 | 4 |
Re: TLE on #39 George_Aloyan[PTS_Obninsk][MIPT][IPG][ALIGN][YANDEX] 27 фев 2019 12:56 The least prime divider in tests is less than 1.1E6 (but checking till 8E7 will still got AC) |
| My STRANGE but ACed algorithm | 198808xc | 1396. Максимум. Версия 2 | 26 фев 2019 21:39 | 2 |
I think that most people trying to solve this problem will try to deal with two problems, they are: 1. How to calculate a[n] fast? 2. How to find those n that a[n] is the maximum in [1...n]? Here is my method. 1. Calculating a[n] (without calculating a[1...n-1]). Directly calculation will lead to a long time. But, after some observation, I found that: a[4n] = a[n] a[4n + 1] = a[2n] + a[2n + 1] = 2a[n] + a[n + 1] a[4n + 2] = a[n] + a[n + 1] a[4n + 3] = a[n] + 2a[n + 1] So, a[4n] to a[4n + 3] could be presented as the linear form of a[n] and a[n + 1]. We will soon realise that, a[2^k n] to a[2^k n + (2^k - 1)] could also be presented as linear form of a[n] and a[n + 1]. So, pre-calculation is done to calculate all the linear forms of a[65536n] to a[65536n + 65535]. This will take about O(65536 * 2) time. After this pre-calc, calculation for any number K will go very fast. 2. Finding the maximum. After listing some of the 'maximum index', we found that: 1 3 5 9 11 19 21 35 37 43 ...... Maybe my math is not so good, so I could not find so useful properties in the array, but I noticed one thing: ------------------------------------------------------------------------------------------ Every 'maximunm index' could be presented as its max 2-power and some former 'maximum index'. ------------------------------------------------------------------------------------------ Sorry for my poor English, let's take a look at the examples: 1 3 = 2 + 1 5 = 4 + 1 9 = 8 + 1 11 = 8 + 3 19 = 16 + 3 21 = 16 + 5 35 = 32 + 3 37 = 32 + 5 43 = 32 + 11 ...... So, we just need to use every 2^k number to ITERATE the list of 'maximum index'. As the list is of size O(Log N), the algo runs quite fast. With above methods, I got AC in 0.046 sec. Well, if my algo is too stupid for you, don't hesitate to post your algo here. Have fun and good luck. |
| test#1. Why? | Igor | 1712. Шифровальная решётка | 26 фев 2019 13:29 | 1 |
#include <iostream> using namespace std; char paper[4][4], pass[4][4],rPass[16],TempPaper[4][4]; int v, i, j; void check(char paper[4][4], char pass[4][4]) { for (int j = 0; j < 4; j++)// X/. { for (int i = 0; i < 4; i++) { if (paper[j][i] == 'X') { rPass[v] = pass[j][i]; v++; } } } } int main() { for (int j = 0; j < 4; j++) //paper cin { for (int i = 0; i < 4; i++) { cin >> paper[j][i]; } } for (int j = 0; j < 4; j++)//зашифрованый пароль { for (int i = 0; i < 4; i++) { cin >> pass[j][i]; } } for (int j = 0; j < 4; j++)//temp { for (int i = 0; i < 4; i++) { TempPaper[j][i] = paper[j][i]; } } check(paper, pass); for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { int t=0, y; if (j == 0) { int u = 3; for (y = 0; y < 4; y++) { paper[t][u] = TempPaper[0][y]; t++; } } if (j == 1) { int u = 2; for (y = 0; y < 4; y++) { paper[t][u] = TempPaper[1][y]; t++; } } if (j == 2) { int u = 1; for (y = 0; y < 4; y++) { paper[t][u] = TempPaper[2][y]; t++; } } if (j == 3) { int u = 0; for (y = 0; y < 4; y++) { paper[t][u] = TempPaper[3][y]; t++; } } } check(paper, pass); for (int j = 0; j < 4; j++) { for (int i = 0; i < 4; i++) { TempPaper[j][i] = paper[j][i]; } } } return 0; } |
| Test 7 | Gilles Deleuze | 2107. Oppa Funcan Style | 25 фев 2019 19:25 | 1 |
Test 7 Gilles Deleuze 25 фев 2019 19:25 It contains more than 20 zeroes. |
| WA #30 | sergio74 | 1637. Игра в треугольник 2 | 25 фев 2019 12:56 | 2 |
WA #30 sergio74 21 фев 2019 01:42 Totally discouraged with it. Please give some test. Got AC. There was an unobvious but very stupid bug... |
| WA 23 .... wth is this. -_- | Ealham | 1494. Монобильярд | 24 фев 2019 01:32 | 5 |
I used a simple algo... I am just checking 3 consecutive numbers... If any 3 consecutive numbers from the given numbers are like this, n1>n3>n2 (mid one is the smallest, first one is the largest and the last one lies in between these two values) , then the sequence is invalid (Cheater) ... else , I print "Not a proof" ... Is my algo ok? If so, then please help me with some test cases... I have tried all the test cases found in the discussions and my program passed all of them... Thanks a lot for your answer. I haven't heard about "Process Modelling" ... I'll look into it asap. And my algo that I used is wrong actually. It fails in this type of cases... 4 3 1 4 2 Correct answer is "Cheater", but my program shows "Not a proof"... I wonder how it passed 22 tests... 0_O Thanks again... :) «I haven't heard about "Process Modelling" ... I'll look into it asap.» Well, it's simple. Basically you just put balls into array in a proper order, and when the last ball is a current takeout request, you take it out of the array and move to next takeout request, and repeat if needed. If at certain point the takeout ball is not the one you expect, the answer is cheater. Good luck~ |
| why wa it's ok verious input | INFINITE | 2012. Про Гришу Н. | 23 фев 2019 21:32 | 1 |
#include<bits/stdc++.h> using namespace std; int main(void) { int t_h,s_h,pb; while(cin>>pb) { s_h=0,t_h=0; if(pb>=1 && pb<=11) { s_h=12-pb; t_h=s_h*45; if(t_h<=240) cout<<"Yes"<<endl; else cout<<"No"<<endl; } } return 0; } |
| 5 test? c | Sanchir | 1243. Развод семи гномов | 23 фев 2019 17:10 | 1 |
#include <stdio.h> int main() { unsigned long long int a; scanf("%llu", &a); if (a/7!=0) printf("%llu\n", a%7); else if (a < 7) printf("%d\n", a); } |
| WA #5. Some tests is needed | Rakovets Alex | 1210. Добрые духи | 23 фев 2019 11:58 | 6 |
I`m sure that written algo is correct, but I might make stupid mistake... My solutions can pass all my tests and my friends` also. Please, give me some tricky tests! Thanks a lot! 2 2 0 1 2 0 * 2 1 1 0 2 3 0 answer 5 Here are some tests: TEST : 10 1 1 10 0 * 1 1 10 0 * 1 1 10 0 * 1 1 10 0 * 1 1 10 0 * 1 1 10 0 * 1 1 10 0 * 1 1 10 0 * 1 1 10 0 * 1 1 10 0 answer 100 TEST: 1 3 1 10 0 2 -5 0 3 -1000 0 answer -1000 Here are some tests: TEST: 1 3 1 10 0 2 -5 0 3 -1000 0 answer -1000 I think this test is wrong, because we have only 1 planet on the 0th level, So it should be: 1 3 1 10 0 1 -5 0 1 -1000 0 |
| WA #9 | Sunkyu Hwang | 1210. Добрые духи | 23 фев 2019 11:57 | 3 |
WA #9 Sunkyu Hwang 20 фев 2017 10:47 I keep getting non-zero return from WA #9 (meaning some of my scanf() fails) Could you please forward WA #9 problem so that I can check parsing is proper? Thank you, Re: WA #9 Kondarattcev Denis 3 ноя 2017 19:18 Test #9 probably contains upper limit case, when there are max possible levels with max planets in each, I can suggest you to check your array sizes. I also got WA #9 after setting wrong integer value for "unreachable" planets - I've set it too small and it affected the result at this test You're right... After changing the values to a higher value for the unreachable nodes, I got AC. Thanks. |
| Не принимает | Skrom | 1820. Уральские бифштексы | 23 фев 2019 07:46 | 5 |
import java.io.*; import java.util.*; public class task { public static void main(String[] args) { Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int n = in.nextInt(); int k = in.nextInt(); int t; if(n>=1 && k<=1000) { if((int) (n * 2.0 / k) == (n * 2.0 / k)) t = (int) (n * 2.0 / k); else t = 1 + (int) (n * 2.0 / k); out.print(t);
} out.flush(); } } Братан эту задачку на 1 вывод решить можно) зачем тебе эти условия Edited by author 29.10.2015 01:41 Я одного не пойму, как можно обжарить 3 бифа с обеих сторон за 3 минуты, если влазит на сковороду всего 2 шт???))) На первой минуте жаришь первые 2шт с одной стороны, на второй их же со второй. На третей минуте последний биф 1 сторона 4я минута 2я сторона 3го бифа!!. В итоге правильный ответ 4 минуты, а не 3 как написано в примерах. Изи. Смотри 1 и 2 это первые и вторые стороны бифов. B это номер бифа. Разделю их точкой первая минута: 1.1 1.2 вторая минута: 2.1 1.3 третья минута: 2.2 2.3 Я тоже также думал, пока не прочитал в дискуссии: http://acm.timus.ru/forum/thread.aspx?id=36182&upd=636324641214598077 1-я минута - Жарится одна сторона двух стейков.(1-я сторона) 2-я минута - Жарится один из первых стейков(2-я сторона) + третий стейк(1-я сторона) 3-я минута - Жарится второй из первых стейков(2-я сторона) + третий стейк(2-я сторона) |
| Я решил с сестрой | tima20072007 | 1197. Один в поле воин | 22 фев 2019 18:31 | 1 |
#include <iostream> #include <stdio.h> #include <vector> using namespace std; class Place { public: char x; int y; bool isOnboard() { if (x < 'a' || x > 'h' || y < 1 || y > 8) return false; return true; } Place(char x, int y) { this->x = x; this->y = y; } }; int main(int argc, const char * argv[]) { int N; cin >> N; vector<Place> places; for (int i = 0; i < N; i++) { char x; int y; cin.get(x); if (x == '\n') { i--; continue; } cin >> y; Place place (x, y); places.push_back(place); } for (int i = 0; i < N; i++) { Place place = places[i]; int moves = 0; //left 2 up 1 place.x -= 2; place.y -= 1; moves += place.isOnboard(); //left 2 down 1 place.y += 2; moves += place.isOnboard(); //right 2 down 1 place.x += 4; moves += place.isOnboard(); //right 2 up 1 place.y -= 2; moves += place.isOnboard(); //right 1 up 2 place.x -= 1; place.y -= 1; moves += place.isOnboard(); //left 1 up 2 place.x -= 2; moves += place.isOnboard(); //left 1 down 2 place.y += 4; moves += place.isOnboard(); //right 1 down 2 place.x += 2; moves += place.isOnboard(); cout << moves << endl; } } |
| Admins, cannot submit any kind of rust solution for this problem | motoras | 1081. Двоичная последовательность | 21 фев 2019 16:16 | 2 |
I get, Runtime error (non-zero exit code), even if I send a program such: fn main() { println!("{}",-1); } If I paste the solution, in the submission text box, I am able to get an answer from the judge. If I uploaded I always get "Runtime error (non-zero exit code)" |
| В чем разница | Olegkyz | 2100. Свадебный обед | 20 фев 2019 13:01 | 1 |
Когда использую циклы такого вида выдает ошибку Runtime error (non-zero exit code) i=n; while(i>0) { name[i]=calloc(1,30); scanf(" %s",name[i]); i--; } i=n; while(i>0) { char *buf=name[i]; while(*buf!='\0') { if(*buf=='+') { kol++; break; } else { buf++; } } i--; } А здесь AC for(i=0;i<n;i++) { name[i]=calloc(1,30); scanf(" %s",name[i]); } for(i=0;i<n;i++) { char *buf=name[i]; while(*buf!='\0') { if(*buf=='+') { kol++; break; } else { buf++; } } } |
| if you fucked by test#13 | tqti | 1080. Раскраска карты | 20 фев 2019 01:31 | 3 |
try 6 6 0 3 0 5 0 5 6 0 0 0 and 7 2 0 5 0 6 4 0 5 7 0 0 0 0 Well, I've passed that tests, but still getting WA 13 Any advices? When build the graph, make it undirected rather than directed one. |
| TLE 8 JAVA | Alex | 1196. Экзамен по истории | 19 фев 2019 00:34 | 1 |
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; public class Lesson { public static void main(String[] args) throws Exception { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); int countPrepod = Integer.parseInt(bufferedReader.readLine()); TreeSet<Long> prepod = new TreeSet(); for (int i = 0; i < countPrepod; ++i) { prepod.add(Long.parseLong(bufferedReader.readLine())); } int countStudent = Integer.parseInt(bufferedReader.readLine()); ArrayList<Long> student = new ArrayList(); for (int i = 0; i < countStudent; ++i) { student.add(Long.parseLong(bufferedReader.readLine())); } student.sort(((o1, o2) -> Long.compare(o1,o2))); int result=0; for (long find:prepod) { while (Collections.binarySearch(student,find)>=0) { ++result; student.remove(find); } } System.out.println(result); } } |
| No subject | FIERFoS | 1000. A+B Problem | 17 фев 2019 23:08 | 2 |
|
| Hints | Gilles Deleuze | 2085. Волшебный программист | 16 фев 2019 23:41 | 1 |
Hints Gilles Deleuze 16 фев 2019 23:41 1. This problem can be reduced to the following: Given X, find two vertices such that path weight is equal to X. 2. It probably cannot be solved with naiive DP. Use centroid decomposition. 3. std::unordered_map gets TL while std::map gets AC. |