| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| some Test Please !!! | Arm | 1362. Одноклассники 2 | 12 ноя 2019 00:15 | 2 |
9 8 2 0 4 3 0 0 5 6 0 0 0 0 9 0 7 0 1 correct answer 4 |
| wa 10 | Michael Glushkov | 1489. Точки на параллелепипеде | 11 ноя 2019 21:39 | 1 |
wa 10 Michael Glushkov 11 ноя 2019 21:39 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _1489 { class Point { public double x; public double y; public double z; static void Main(string[] args) { int A, B, C; string S = Console.ReadLine(); string[] SS = S.Split(); A = Convert.ToInt32(SS[0]); B = Convert.ToInt32(SS[1]); C = Convert.ToInt32(SS[2]); double x1, y1, x2, y2; double[] mas = Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); x1 = Convert.ToDouble(mas[0]); y1 = Convert.ToDouble(mas[1]); double[] mas2 = Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); x2 = Convert.ToDouble(mas2[0]); y2 = Convert.ToDouble(mas2[1]); Point a = new Point();
// A - x B - y C - z // x if (x1 <= C) a.x = 0; else if (x1 <= C + A) a.x = x1 - C; else a.x = A; // y if (y1 <= B) a.y = B - y1; else if (y1 <= B + C) a.y = 0; else if (y1 <= 2 * B + C) a.y = y1 - B - C; else a.y = B; // z if (y1 <= B) a.z = 0; else if (y1 <= B + C && x1 <= C + A && x1 >= C) a.z = y1 - B; else if (x1 <= C && y1 <= 2 * B + C) a.z = x1; else if (x1 >= C + A && y1 <= 2 * B + C) a.z = A + C + C - x1; else if (y1 >= B + C + B) a.z = 2 * (B + C) - y1; else a.z = C;
Point b = new Point();
// x if (x2 <= C) b.x = 0; else if (x2 <= C + A) b.x = x2 - C; else b.x = A; // y if (y2 <= B) b.y = B - y2; else if (y2 <= B + C) b.y = 0; else if (y2 <= 2 * B + C) b.y = y2 - B - C; else b.y = B; // z if (y2 <= B) b.z = 0; else if (y2 <= B + C && x2 <= C + A && x2 >= C) b.z = y2 - B; else if (x2 <= C && y2 <= 2 * B + C) b.z = x2; else if (x2 >= C + A && y2 <= 2 * B + C) b.z = A + C + C - x2; else if (y2 >= B + C + B) b.z = 2 * (B + C) - y2; else b.x = C;
double difx = (a.x - b.x); double dify = (a.y - b.y); double difz = (a.z - b.z); //if (difx * difx + dify * dify + difz * difz > 0) Console.WriteLine((Math.Sqrt(difx * difx + dify * dify + difz * difz))); //else Console.Write(0); } } } |
| WHY WA 5 | JAVATO | 1638. Книжный червь | 11 ноя 2019 10:35 | 7 |
I'm also getting WA5. Please help. try this tests: 1)in: 10 1 2 1 ans: 22 2)in: 10 1 1 1 ans: 10 thank you very much:)))))))))))))))))))))))))))))))))))))))))))))))))))))) |
| Whats wrong? C | Sanchir | 1001. Обратный корень | 10 ноя 2019 22:27 | 2 |
#include <stdio.h> #include <math.h> main(void) { long long i; while(scanf("%lli", &i) != EOF) printf("%.4f\n", (double)sqrt(i)); } You have print the integers in reverse order of the input sequence. |
| Why Runtime Error (Access Violation)?? | Labib Bin Mohtaram | 1001. Обратный корень | 10 ноя 2019 22:25 | 2 |
[code deleted] Edited by moderator 19.11.2019 23:31 Your array size is not enough to hold all the integers. |
| Why Runtime error on test 4?? | FromNothingToFinal | 1020. Ниточка | 10 ноя 2019 19:07 | 2 |
public class Problem { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int r = sc.nextInt(); double l = 0; if (n != 1) { double x1 = sc.nextDouble(); double y1 = sc.nextDouble(); double memoryX = x1, memoryY = y1; for (int i = 1; i <= n; i++) { if (i == n) { l += Math.sqrt((memoryX - x1) * (memoryX - x1) + (memoryY - y1) * (memoryY - y1)); continue; } double x = sc.nextDouble(); double y = sc.nextDouble(); l += Math.sqrt((x - memoryX) * (x - memoryX) + (y - memoryY) * (y - memoryY)); memoryX = x; memoryY = y; } } l += 2*Math.PI*r; System.out.printf("%.2f", l); sc.close(); } } radius can be float number |
| Advices with RE and WA | roman velichkin | 1020. Ниточка | 10 ноя 2019 19:07 | 1 |
Radius and coords can be float N can be 1 |
| Some test cases | Smilodon_am [Obninsk INPE] | 2143. Victoria! | 9 ноя 2019 01:18 | 1 |
Below test cases helped me to check the program: 2 3 .**|_|**. **.|_|*** ans: [good test] POBEDA 1A 2C 1F 5 6 ...|_|*** ...|_|*** ...|_|*** ...|_|*** ...|_|*** ans: POBEDA 1A 1C 3A 3C 5A 5C 5 12 ...|_|... ...|_|... ...|_|... ...|_|... ...|_|... ans: POBEDA 1A 1C 3A 3C 5A 5C 1D 1F 3D 3F 5D 5F 6 6 *..|_|*** ...|_|*** ...|_|*** ...|_|*** *..|_|*** ..*|_|*** ans: POBEDA 1C 2A 3C 4A 5C 6A 6 6 *..|_|*** ..*|_|*** ...|_|*** ...|_|*** *..|_|*** ...|_|*** ans: POBEDA 1C 2A 3C 4A 5C 6A 6 6 *..|_|*** *.*|_|*** ...|_|*** ...|_|*** *..|_|*** ...|_|*** ans: PORAZHENIE |
| Is 1001 unlucky or 1010? | roman velichkin | 1608. Счастливые билеты 2008 | 8 ноя 2019 10:25 | 1 |
I didn't get this task. Is 1001 unlucky number or 1010? |
| I know there O(N^3) solution, but how to get 0.001s ?? | xurshid_n | 1146. Maximum Sum | 7 ноя 2019 21:19 | 2 |
There a[i][j] in [-127..127] and n <= 100 -- May be there bitmask tricks, or other tricks???? There's one hard solution with quick matrix multiply |
| Can anyone please explain the sample solution given in the problem | anupam ghosh | 2111. Платон | 7 ноя 2019 15:22 | 1 |
Can anyone please explain the sample solution given in the problem |
| No subject | дед инсайд | 2144. Уборка комнаты | 7 ноя 2019 13:32 | 1 |
Edited by author 09.11.2019 20:00 |
| Don't know what to do | Rodrigo Morales [UTEC] | 1014. Произведение цифр | 7 ноя 2019 02:42 | 2 |
I have tried everything. Here are some testcases from my algorithm: 0: 10 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 25 12: 26 14: 27 15: 35 16: 28 18: 29 20: 45 21: 37 24: 38 25: 55 27: 39 28: 47 30: 56 Some big numbers: 16859136: 267778888 16875000: 3555555589 16934400: 355778889 16941456: 277777789 17006112: 48999999 17010000: 555567899 17146080: 256778999 17150000: 1555557778 17203200: 155788888 17210368: 177777888 17222625: 355579999 17280000: 555568889 17287200: 455777789 17294403: 177777777 17360406: 67799999 17364375: 555577799 17418240: 256788899 17496000: 355588999 17500000: 4555555578 17503290: 257777999 17561600: 455777888 17578125: 5555555559 17635968: 67889999 17640000: 555577889 17647350: 556777777 17694720: 256888889 17714700: 255699999 17718750: 2555555799 long long int minimoentero3(long int num) { long long int nf=result; return nf; } int main() { long int n; cin >> n;
cout<<minimoentero3(n); <- Here the result is sent. } Edited by author 26.10.2017 18:28 test 17294403: 177777777 17294403 != 177777777 (5764801) also 77777777 < 177777777 right answer for this test 377777777 |
| TL test 2. Why?????????????? | DimaLahtin`~ | 1590. Шифр Бэкона | 5 ноя 2019 21:36 | 1 |
#include <bits/stdc++.h> using namespace std; int main() { map<string, int> d; string s; cin >> s; string c = ""; int n = s.size(); for (int i = 0; i < n; i++) { c = s[i]; d[c]++; for (int j = i + 1; j < n; j++) { c += s[j]; d[c]++; } } cout << d.size(); } |
| Test 47 | Shirokov Alexander | 2112. Полевые логи | 5 ноя 2019 11:39 | 1 |
Test 47 Shirokov Alexander 5 ноя 2019 11:39 |
| It is a very easy problem!!!!!!!! | XiangGuangTe | 1264. Трудовые будни | 5 ноя 2019 09:06 | 9 |
yeah, it's mega simple problem... Yeah, it's simple but why my answer was wrong? anyone can help? Give me your code and I will help you Edited by author 31.01.2015 13:34 Edited by author 31.01.2015 13:34 why "N*(M+1)" i can't understand pls help "For each integer from 0 to M the function would calculate how many times this number appears in the N-element array..." Let's say N=2, so you have two-element array. Let's M=4, so you have to check whether there is any 0,1,2,3 or 4 (since from 0 to M) in each array... So total lines = 2*(4+1) Hope, it helped. how could 3 or 4 in the n? cause n = 2 so 3 or 4 are not in the array....for this reason why we don't use if else statement to see whether m is bigger than n or not...but we calculate it straightly?...can you please describe? because, a box is given as a clue ..... and you have to solve the problem according to that.. i guess :/ |
| TL in test 5 | oto | 1316. Биржа | 4 ноя 2019 22:16 | 2 |
I got time limit in test#5 and I can't find out why if you are using G++ 7.1 try using visual studios 2017 compiler. Apparently one works faster than the other |
| TLE22 | Kogut.Ivan | 2102. Миша и криптография | 4 ноя 2019 22:16 | 7 |
TLE22 Kogut.Ivan 20 ноя 2016 14:02 I get TLE on 22 test. What can you advise? 1)In solution you must find all primes <= 10^7. 2)You must use that n<=10^18. 1. find all primes up to 2 millions 2. if remainder > 2 millions, check if it is a prime Why do you take this number? big number N = X*Y*(p1*p2*p3*....*p18) = X*Y*(A) A = at least 2^18 = 262144 So, X*Y = at most 10^18 / 2^18 = 3 814 697 266 000 So either X or Y is less than 10^7 Edited by author 05.11.2019 20:56 Edited by author 05.11.2019 20:57 |
| A closer look! | Robert Otome | 1002. Телефонные номера | 4 ноя 2019 15:27 | 8 |
Each number maps to several letters of the alphabet. However, notice that several letters map to a single digit. If you can't go to the mountain, bring the mountain to you. Convert the words found in the dictionary for each case into digits, using the given map. Looking up which digit a letter maps to can be done in constant time if you use the right data structure. Then all that is left is to compare against the phone number given. Each number maps to several letters of the alphabet. However, notice that several letters map to a single digit. If you can't go to the mountain, bring the mountain to you. Convert the words found in the dictionary for each case into digits, using the given map. Looking up which digit a letter maps to can be done in constant time if you use the right data structure. Then all that is left is to compare against the phone number given. Can't believe!!!! Excellent idea!!!! If you can't go to the mountain, bring the mountain to you....wow what a statement! nice, but you must check such events: 1) word contains "ij" -> "11"(simple going letter by letter algorythm), that is not right it must transform into "1"( in dict "1":"ij"), but if word contains "ii" it must transform into "11". 2) if one word ends on some digit and another starts on it. we have words with "18" code and "89" code. Number "189". It depends, what letters words contain. There three alternatives: take both words, take with "18" or with "89". |
| Idea O(N) | Felix_Mate | 1056. Центры сети | 4 ноя 2019 15:11 | 2 |
I got AC! It's nice problem! My algo works at O(3*N)=O(N). 1)BFS from any vertex and find the most remote vertex (let V); 2)BFS from V and find the most remote vertex (let U); 3)Create path from U and V; vertex(vertexes) in the middle is answer. Edited by author 04.08.2015 12:56 |