Общий форумSee title I can currently solve problems under a rating of 50(I am a newbie) comfortably but I don't quite get how the difficulty scales really with some problems having a rating of 15000 which seems confusing. I just would like someone who has some knowledge to explain how difficulty scales numerically relative to some standard problems take codeforces or any major competitive programming competition as a reference Edited by author 08.01.2026 08:49 The incorrect test 12 was fixed (coordinates were exceeding 10000). New tests were added to the problem. The tests target a wide range of problems in geometry algorithms, accuracy issues, and performance. All solutions have been rejudged. 229 authors (40%) lost, and 2 other authors gained the Solved status for the problem. Thanks for the New Year present (had to resolve the problem just before the 2026) :))) I'm expected brute force solution will accepted on C++, because N * 10^D integer divisions might work in 1 sec, but this solution work even on Python3. Why is work? Is there a math prove that answer will be very small or in this problem weak tests? Edited by author 14.02.2023 17:29 N * 10^D is 10^7 operations which easily runs in time A bug was fixed in the checker program that incorrectly skipped most of the checks for some tests. The most affected tests are: 1, 3-8, 11, 17. All solutions have been rejudged. The verdict changed for 40% of solutions (typical change patterns: WA5 -> WA4, WA9 -> WA7, AC -> WA11). 10 authors lost the Solved status for the problem. how to know when there are no more inputs Just use a while loop like this: while( cin >> a ) and then push_back it in a vector and output the solution. #include<stdio.h> #include<math.h> int main(){ unsigned long long int a,b,c,d; double Sqrt,Sqrt1,Sqrt2,Sqrt3; scanf("%llu %llu %llu %llu",&a,&b,&c,&d); Sqrt=sqrt(a); Sqrt1=sqrt(b); Sqrt2=sqrt(c); Sqrt3=sqrt(d); printf(" %0.4lf %0.4lf %0.4lf %0.4lf",Sqrt,Sqrt1,Sqrt2,Sqrt3); } Edited by author 23.06.2022 13:46 Edited by author 23.06.2022 13:46 there is nowhere mentioned only 4 inputs are there so while(cin>>x) would be the conditional i hope it helps A bug fixed in the checker program that allowed passing arbitrary expressions as a first argument to the substring function. According to the problem statements only variables are allowed to be passed there. Accepted solutions have been rejudged. 26 authors lost the Solved status for the problem. a , b , c = list(map(int , input().split())) A , B , C = list(map(int , input().split())) if a+c >= A: if a >= A: c =c a-=A else: c=A-a a-=A-c if b+c >= B: if b >= B: c =c b-=B else: c=B-b a-=A-c if a + b + c >= C: print('It is a kind of magic') else: print('There are no miracles in life') else: print('There are no miracles in life') else: print('There are no miracles in life') Thanks i rewirte in java 1.8 that helps me a lot, thank you so much The missing condition added to the English version of the statement: The cell in which the minus remains should not change. The Russian version of the statement was correct. import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { String a = "Emperor Penguin"; String b = "Macaroni Penguin"; String c = "Little Penguin"; int countA = 0; int countB = 0; int countC = 0; Scanner sc = new Scanner(System.in); int n = sc.nextInt(); List<String> list = new ArrayList<>(n); sc.nextLine(); for (int i = 0; i < n; i++){ list.add(sc.nextLine()); } for (String item: list){ if (item.equals(a)){ countA++; } else if (item.equals(b)) { countB++; } else if (item.equals(c)) { countC++; } } int max = Math.max(Math.max(countA,countB),countC); if (max == countA){ System.out.println(a); } else if (max == countB) { System.out.println(b); } else if (max == countC) { System.out.println(c); } } } Edited by author 18.11.2017 03:29 Thanks to AI. After 15 years since the first submission, I finally know how to solve this problem. If you got WA #28 - check int64 overflow The limitation on N was changed to reflect the actual test data. Instead of the old N < 10^600 the limitation was set to 0 < N < 10^300. Note that this is not the limitation on the input, but rather on the output. The number given to the input has about twice as many digits, previously up to ~1200 digits, now up to ~600 digits, but the actual test data was always only up to ~600 digits. Edge case N=0 was also missing in the test data, and is now explicitly disallowed by the limitation. New thorough tests were added within the new limitations. The time limit was reduced from 2.0 sec to 1.0 sec. All solutions have been rejudged. 192 authors lost, and 12 other authors gained the Solved status for the problem. Bugs fixed in the checker program. 1. The total length of dangerous segments was not always correctly verified against the canonical answer. Most prominently, the following output was previously accepted for the sample input (test 1), which has the total dangerous length 1.0 with the optimal one being 0.8: 2 1.0 1.5 0.0 1.5 2. Precision issues were fixed that were causing solutions with certain output rounding strategies being rejected (most commonly, WA8). The limitation on the number of pieces of furniture N was updated in the problem statements from N >= 0 to N >= 1 to reflect the actual test data. Additionally, the time limit was reduced from 2.0 sec to 1.0 sec. All solutions have been rejudged. 21 authors lost, and 2 other authors gained the Solved status for the problem. import java.io.IOException; import java.util.Scanner; public class Main { public static int rent = 100; public static void main(String[] args) throws IOException { Scanner scanner = new Scanner(System.in); int numberOfFriends = Integer.parseInt(scanner.nextLine()); int totalGuests = 2; for (int i = 0; i < numberOfFriends; i++) { String answer = scanner.nextLine(); if (answer.contains("+")){ totalGuests += 2; }else{ totalGuests++; } } if (totalGuests == 13){ totalGuests++; } int total = totalGuests*rent; System.out.println(total);
scanner.close(); } } #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int k , n; cin >> k >> n; int sum = 0; while(n--) { int a; cin >> a; sum += a; sum -= min(sum , k); } cout << sum; } the solution is n-th fibonaci number write every option for evidence #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; //the answer is F[n] - fibonnaci number //76 > 3 vector <long long> dp(n + 2); dp[1] = 2; dp[2] = 2; for(int i = 3; i <= n; i++)dp[i] = dp[i - 1] + dp[i - 2]; cout << dp[n]; } All the trouble are caused by precision. The first submittion includes the code: angle_ACB = math.acos((x1*x2+y1*y2+z1*z2) / (len_CA*len_CB)) Then I got RE#8 in python, WA#8 in C++. Next I change the code to: angle_ACB = math.acos(0.5*(CA_sqr + CB_sqr - len_AB**2) / (len_CA*len_CB)) in python angle_ACB = acos(0.5* (CA_sqr + CB_sqr - sqr(len_AB))/(len_CA*len_CB)) in C++ Then I got RE#48 in python, WA#48 in C++. So I am sure the trouble is caused by the precision because of the function sqrt()! Sometimes, the cos(angle_ACB) is smaller than -1. Then the problem occurred by using acos(x) if x<-1. You need to handle this situation. |
|