Common Boardhelped for me 3 17 answer 1 3 3 18 17 I can't find mistake, and have WA on test 7. Someone can give some cases? Edited by author 13.11.2011 18:38 try 5 4 1 2 3 4 5 1 2 3 4 asn = 1 //pseudo code divider = first_input-1; dividend = second_input-1; result: divider + dividend - FindCrossesOnTheWay(dividend,divider) *FindCrossesOnTheWay if(divider < dividend) swap() for(i=1;i<=divider;i++) if((dividend * i) % divider == 0) crosses++ I've implemented this problem two different ways and I have WA9 on both of them. I'm possibly interpreting the problem wrong, but I've read the problem over and over again and I cannot come up with an alternative interpretation. Can someone please shine some light? Если у кого ещё такая проблема есть, то это,как вариант, связано с нечетным n (последний человек ни разу не дежурит) #include <iostream> #include <string> using namespace std; int main() {string s; int o=0; getline(cin, s); string b1 = "adgjmpsvy. "; string b2 = "behknqtwz,"; string b3 = "cfilorux!"; for (int k=0; k<s.size();k++) { if (b1.find(s[k]) != string::npos) o++; if (b2.find(s[k]) != string::npos) o+=2; if (b3.find(s[k]) != string::npos) o+=3; } cout<<o; return 0; } Which algorithm?? Help I need help also. As i see you have solved it. Could you please help me? Try this: 3 2 of sweets 5 of milk 1 of sausage 4 6 of milk 3 of milk 1 of milk 3 of sweets Correct answer is: 8 Good luck! i have used long long and scanf still wa who can help me?plz 0.0 Below test helped me to pass test 5 after WA verdict: 5 6 4 0 6 0 3 0 7 0 8 department 1 10 1 department 2 10 1 department 3 10 1 department 4 10 1 department 0 7 10 department 0 500000000 1000000000 As you can check manually, correct answer is: 1000000014 1000000017 1000000014 1000000018 1000000019 it really helps,thanks bro I have 2 questions. 1. As AI Cash asked, can each design have two or more points with the same location? 2. "the pre-jury wants to find the designs which only differ in rearrangement of points and their affine transformation that doesn't change the orientation" does it mean that two designs (P1, P2, P3, ..., Pm) and (Q1, Q2, Q3, ..., Qm) will be considered same if there is an affine transformation Qi=A*Pi+b for all i such that A is matrix 2x2 that detA>0 ? Thank you from Thailand. :) Edited by author 22.09.2019 20:01 Hello, today i'm gonna tell ya how to solve this easy task! We can notice: 1 has places 0,1,3,6,10 etc. 0*8+1 = 1; 1*8+1 = 9; 3*8+1 = 25; 6*8+1 = 49; 10*8+1 = 81; I gave you the advice! So, it's easy! Good luck! If i hepled you, you may subscribe to my VK, Facebook, Instagram, Odnoklassniks, Patreon, Twitter, Twitch, Steam, Battlenet, Goggle+ and Youtube channel, there you'll find more solutions for problems! "If there is a problem, we solve it!" (c). Every rights are reserved. what is wrong with test #27 ? try 1 10000 answer 25007071.3178118650 25007071.3178118655 for 1 10000. Accurate enough, but still wrong answer on test case #27. try 10000 1 may be In #27 system checks output format I changed my python solution print FLOATANS to print "%0.6f" % FLOATANS and get AC Edited by author 08.05.2013 14:10 I had wrong answer on test 27, but corrected it by using "long double" type There's my code [code deleted] Edited by moderator 23.10.2019 22:04 just a joke Edited by author 18.09.2019 20:08 My full search say that solution exist for n<=22292 There is solution for all n <= 10^5 though I still can not fast enough generate answer I've solved this problem using DP. Hint: The maximum sum of numbers for required sequence does not exceed 1568617. According to my calculations the largest such sequence can be 344001 for the constraints of the problem. answer for every n exists there is no possibility to output “impossible” class Program { public static void Mod(int N, int M, int Y) { int f = 0, t = -1; for (int i = 0; i < M; i++) { int X = i; long y = X; for (int j = 2; j < N + 1; j++) { y = y * X; y = y % M; } if (y == Y) { if (f > 0) Console.Write($" "); Console.Write($"{X}"); f++; } } if (f == 0) Console.Write($"{t}"); Console.WriteLine(); } } Edited by author 17.09.2019 02:10 I've got WA on 4th test. Can anyone tell me some tests to check my solution? You have to use BigInteger, you can't simply use Long Long bc the answer can go up to 2^(1600) Just for information. On September 19 this site will be under maintenance, so it will be unavailable for about 5 hours starting from 10:00 GMT+5. Sorry for inconvenience. Edited by author 16.09.2019 15:55 Note, the required algorithm is known as the Kadane's algorithm and runs in O(n). ive googled that the answer for all n except 1 is 1 + 1/sin(PI/n), can smb explane me why? Centers of circles form a regular polygon with side length 2. Now, consider the formula to find circumradius of a regular polygon and add 1 because you were connecting circle centres, but not their tangent points to the circle. |
|