| Show all threads Hide all threads Show all messages Hide all messages |
| Python3 MLE на 11 тесте | Desserg | 1100. Final Standings | 12 Nov 2019 16:26 | 1 |
есть ли способы на питоне обойти прожорливость памяти? |
| WA#10! Help me please!!! | Pio | 1362. Classmates 2 | 12 Nov 2019 00:15 | 4 |
I also have WA10/ Help Someone! 9 8 2 0 4 3 0 0 5 6 0 0 0 0 9 0 7 0 1 correct answer 4 |
| some Test Please !!! | Arm | 1362. Classmates 2 | 12 Nov 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. Points on a Parallelepiped | 11 Nov 2019 21:39 | 1 |
wa 10 Michael Glushkov 11 Nov 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. Bookworm | 11 Nov 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. Reverse Root | 10 Nov 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. Reverse Root | 10 Nov 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. Rope | 10 Nov 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. Rope | 10 Nov 2019 19:07 | 1 |
Radius and coords can be float N can be 1 |
| Some test cases | Smilodon_am [Obninsk INPE] | 2143. Victoria! | 9 Nov 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. Lucky Tickets 2008 | 8 Nov 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 Nov 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. Plato | 7 Nov 2019 15:22 | 1 |
Can anyone please explain the sample solution given in the problem |
| No subject | дед инсайд | 2144. Cleaning the Room | 7 Nov 2019 13:32 | 1 |
Edited by author 09.11.2019 20:00 |
| Don't know what to do | Rodrigo Morales [UTEC] | 1014. Product of Digits | 7 Nov 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. Bacon’s Cipher | 5 Nov 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. Battle log | 5 Nov 2019 11:39 | 1 |
Test 47 Shirokov Alexander 5 Nov 2019 11:39 |
| It is a very easy problem!!!!!!!! | XiangGuangTe | 1264. Workdays | 5 Nov 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. Electronic Auction | 4 Nov 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. Michael and Cryptography | 4 Nov 2019 22:16 | 7 |
TLE22 Kogut.Ivan 20 Nov 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 |