| Show all threads Hide all threads Show all messages Hide all messages |
| Runtime 13 | Hououin`~`Kyouma | 1546. Japanese Sorting | 26 Jul 2024 17:13 | 1 |
Don't use int("smth"), because len of number can be greater than 4000 or use sys.set_int_max_str_digits() if you use python Edited by author 26.07.2024 17:14 |
| easy DFS | ~'Yamca`~ | 2096. All Inclusive | 26 Jul 2024 16:54 | 1 |
|
| If you have WA#1 | Vladimir Plyashkun [USU] | 1137. Bus Routes | 24 Jul 2024 22:36 | 3 |
be careful, you must output the number of stops in the new route k and NOT K+1 So, for example in C++ vector<int> res; ... cout << res.size() - 1 << " "; // check this. not cout << res.size() << " "; Edited by author 05.01.2014 23:39 or ... reverse(res.begin(),res.end()); |
| Much easier with Python | Keworker `~ | 1101. Robot in the Field | 24 Jul 2024 09:58 | 2 |
U can use Python `eval(expression, variablesDict)` syntax and get easy AC. If you don't want use this feature, just turn expression into binary tree and calculations will be easy. |
| Question about problem | InstouT94 | 2090. Crossroads of Destiny | 23 Jul 2024 22:17 | 1 |
Personally, I don’t understand the location of the streets and pedestrian crossings at all. It was hoped that the layout would be based on actual streets. I opened the map, and these two streets are generally parallel... The authors could at least draw a picture for the stupid... |
| Pay attention! | andreyDagger`~ | 1201. Which Day Is It? | 23 Jul 2024 18:23 | 3 |
January 1st 1600 is sunday, not monday! It's saturday, not sunday! here's the answer for 1 1 1600 mon 3 10 17 24 31 tue 4 11 18 25 wed 5 12 19 26 thu 6 13 20 27 fri 7 14 21 28 sat [ 1] 8 15 22 29 sun 2 9 16 23 30 |
| What about "aa...a" strings? | 💮meanlessnessener`~ | 1714. Mnemonics and Palindromes 2 | 23 Jul 2024 17:16 | 2 |
Why can't I construct strings like "aa...a"? There is only one palindrome (the whole string) and it's the minimum value of palindromes obviously. Where is the contradiction the the statement? u need to max complexity, but 'a...a' is an opposite. in sample complexity of solution is 3. |
| wa 7 | 👑TIMOFEY👑`~ | 2159. Essay | 23 Jul 2024 09:55 | 1 |
wa 7 👑TIMOFEY👑`~ 23 Jul 2024 09:55 |
| help, WA 44 | zerumi | 1710. Boris, You Are Wrong! | 22 Jul 2024 22:45 | 1 |
I'm the first one, who stuck on this test, my program written in Kotlin (probably, same rules applies to Java). I don't understand, what is "maximum precision"? Should I use double, float or maybe bigdecimal? My program calculates side lengths, area of the triangle (via sides), angles (via sides and acos), and result point C_2. Any help is really welcome! import kotlin.math.* class Point(val x: Int, val y: Int) { constructor(raw: String) : this(raw.split(' ')[0].toInt(), raw.split(' ')[1].toInt()) override fun toString(): String = "$x $y" } class Vector(p1: Point, p2: Point) { private val x = p1.x - p2.x private val y = p1.y - p2.y fun length(): Double = sqrt((x*x + y*y).toDouble()) } fun angle(v1: Vector, v2: Vector, v3: Vector): Double = acos( (v1.length().pow(2) + v2.length().pow(2) - v3.length().pow(2)) / (2 * v1.length() * v2.length()) ) fun triangleSquare(v1: Vector, v2: Vector, v3: Vector): Double { val halvedSideSum = (v1.length() + v2.length() + v3.length()) / 2.0 return sqrt( halvedSideSum * (halvedSideSum - v1.length()) * (halvedSideSum - v2.length()) * (halvedSideSum - v3.length()) ) } fun Double.fuzzyEquals(other: Double): Boolean = (abs(this - other) < 1e-10) fun Double.fuzzyEqualsLow(other: Double): Boolean = (abs(this - other) < 1e-4) fun main() { // input val pointA = Point(readln()) val pointB = Point(readln()) val pointC = Point(readln()) // solution val fixedPointA = Point(0, 0) val fixedPointB = Point(pointB.x - pointA.x, pointB.y - pointA.y) val fixedPointC = Point(pointC.x - pointA.x, pointC.y - pointA.y) val sideAB = Vector(fixedPointA, fixedPointB) val sideBC = Vector(fixedPointB, fixedPointC) val sideAC = Vector(fixedPointA, fixedPointC) val angleBAC = angle(sideAB, sideAC, sideBC) val angleACB = angle(sideAC, sideBC, sideAB) val angleCBA = angle(sideBC, sideAB, sideAC) // find h val h = 2.0 / sideAC.length() * triangleSquare(sideAB, sideBC, sideAC) // tan ACB = h / x val x = h / tan(angleACB) val subtractVectorLength = 2.0 * x val ratio = (sideAC.length() - subtractVectorLength) / sideAC.length() if (ratio <= 0.0 || ratio.fuzzyEquals(0.0) || ratio.fuzzyEqualsLow(1.0)) println("YES") else { println("NO") println(fixedPointA) println(fixedPointB) println( "%.20f".format(fixedPointC.x * ratio) + " ${"%.20f".format(fixedPointC.y * ratio)}") } } Edited by author 22.07.2024 22:53 |
| wa6 | 👑TIMOFEY👑`~ | 2159. Essay | 22 Jul 2024 18:23 | 1 |
wa6 👑TIMOFEY👑`~ 22 Jul 2024 18:23 a < b и p1 = q1, p2 = q2, …, pa = qa. |
| wa3 | 👑TIMOFEY👑`~ | 2159. Essay | 22 Jul 2024 18:01 | 1 |
wa3 👑TIMOFEY👑`~ 22 Jul 2024 18:01 |
| WA6 | Dmitry | 2141. Sasha Vilkin | 22 Jul 2024 17:53 | 1 |
WA6 Dmitry 22 Jul 2024 17:53 Please give me some test that can help me |
| WA 18: wrong order of points in polygone | Alex_Gu | 1215. Exactness of Projectile Hit | 22 Jul 2024 02:55 | 2 |
The test contents points entered clockwise, which doesn't respond the condition. I succeed passing the test only after applied an algo, which is not sesitive to the order of points in polygone Edited by author 29.04.2024 19:57 Edited by author 29.04.2024 19:57 For me, WA 18 fixed with replacting float to double. magic :/ |
| If WA6 | zerumi | 1131. Copying | 21 Jul 2024 23:42 | 1 |
If WA6 zerumi 21 Jul 2024 23:42 Try not to use double, probably there is something like ceil(log(n)) = ceil(1.000000000000000000000001) = 2.0 Also in test 6 N is greater than 1.000.000. I used Int and Float data types and got AC |
| why I got wa? | 👑TIMOFEY👑`~ | 1173. Lazy Snail | 21 Jul 2024 09:22 | 1 |
Type > Point =record > x,y,d :real; > ID :Integer; > end; > Var > a :array[0..1000] of point; > n,i :integer; > > function partition(first,last:integer):integer; > Var > t :point; > i,j :integer; > x :real; > begin > i:=first-1; > j:=last+1; > x:=a[first].d; > while true do > begin > repeat inc(i); > until a[i].d<=x; > repeat dec(j); > until a[j].d>=x; > if i<j then begin > t:=a[i]; a[i]:=a[j]; a[j]:=t; end > else begin > partition:=j; exit; end; > end; > end; > > Procedure qsort(first,last:integer); > Var > w :integer; > begin > if first<last then > begin > w:=partition(first,last); > qsort(first,w); > qsort(w+1,last); > end; > end; > > Function ATG(x:integer):real; > Var > dx,dy,k :real; > begin > dx:=a[x].x-a[0].x; > dy:=a[x].y-a[0].y; > if dx=0 then > k:=90 > else > k:=arctan(dy/dx)/pi*180; > if (k<0) or ((k=0) and (dx<0)) then k:=k+180; > if dy<0 then k:=k+180; > atg:=k; > end; > > begin > readln(a[0].x,a[0].y); > readln(n); > for i:=1 to n do > begin > readln(a[i].x,a[i].y,a[i].ID); > a[i].d:=ATG(i); > end; > qsort(1,n); > writeln(0); > for i:=1 to n do > writeln(a[i].Id); > writeln(0); > end. |
| wa 20, 26 | 👑TIMOFEY👑`~ | 1647. Divide an Island! | 19 Jul 2024 13:19 | 1 |
|
| WA 27 | 👑TIMOFEY👑`~ | 1773. Metro to Every Home | 19 Jul 2024 11:48 | 1 |
WA 27 👑TIMOFEY👑`~ 19 Jul 2024 11:48 |
| RE 13 | 👑TIMOFEY👑`~ | 1773. Metro to Every Home | 19 Jul 2024 11:48 | 1 |
RE 13 👑TIMOFEY👑`~ 19 Jul 2024 11:48 |
| wa29 | 👑TIMOFEY👑`~ | 1872. Spacious Office | 18 Jul 2024 14:11 | 1 |
wa29 👑TIMOFEY👑`~ 18 Jul 2024 14:11 you print Ask Shiftman for help. once again, although the correct answer is Perfect |
| wa 4 | 👑TIMOFEY👑`~ | 1633. Hippogriffs | 18 Jul 2024 13:49 | 1 |
wa 4 👑TIMOFEY👑`~ 18 Jul 2024 13:49 |