| Show all threads Hide all threads Show all messages Hide all messages |
| Ac Pythoh !!! | eremeev.me.2012@gmail.com | 2142. Magic | 21 Dec 2025 19:52 | 2 |
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 |
| English statement corrected | Vladimir Yakovlev (USU) | 1231. Turing: One, Two, Three, … | 21 Dec 2025 05:47 | 1 |
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. |
| Java ez | Aleksandr | 1585. Penguins | 21 Dec 2025 03:18 | 1 |
Java ez Aleksandr 21 Dec 2025 03:18 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); } } } |
| What is the complexity of your solution? | mago_nn | 1762. Search for a Hiding-Place | 19 Dec 2025 21:44 | 3 |
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. |
| WA 28 | bsu.mmf.team | 2190. Match of the Millennium | 17 Dec 2025 17:25 | 1 |
WA 28 bsu.mmf.team 17 Dec 2025 17:25 If you got WA #28 - check int64 overflow |
| Problem 1153. Supercomputer rejudged | Vladimir Yakovlev (USU) | 1153. Supercomputer | 8 Dec 2025 05:11 | 1 |
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. |
| Problem 1199. Mouse rejudged | Vladimir Yakovlev (USU) | 1199. Mouse | 6 Dec 2025 19:02 | 1 |
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. |
| on java accepted | Aleksandr | 2100. Wedding Dinner | 30 Nov 2025 22:40 | 1 |
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(); } } |
| c++ accepted | Max | 1787. Turn for MEGA | 30 Nov 2025 15:49 | 1 |
#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; } |
| c++ solution | Max | 1225. Flags | 30 Nov 2025 15:39 | 1 |
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]; } |
| If you have trouble on test#8 or #48 | Rotter Tarmination | 1075. Thread in a Space | 27 Nov 2025 21:55 | 1 |
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. |
| What is Test #2 ?? | Nguyen Doan Quoc Phong | 1709. Penguin-Avia | 22 Nov 2025 19:27 | 3 |
Pls, anyone give me some hint about test #2 ! Thanks Consider this test case: 4 5 10 0000 0000 0000 0000 it helped me with WA2 |
| Solution(DSU)2025 | Md. Ishmam Zahin | 1003. Parity | 22 Nov 2025 10:52 | 1 |
be carefull you cann't create a dsu of size 10^9 given becasue max array size limit is roughly 10^7. hint: you do not need to track all the node parents instead need to track parents of those which only appears in the question. here is my soulution(c++): #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // priority_queue<type, std::vector<type>, decltype(cmp)> pq(cmp); // set/multiset<type, decltype(cmp)> s(cmp); // map<key_type, val_type, decltype(cmp)> m(cmp); // sort(v.begin(), v.end(), cmp) // cmp = custom_lamda_compare_function|syntax: [capture](parameters) -> return_type {} // typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag, // tree_order_statistics_node_update> indexed_set;
using namespace std; using namespace __gnu_pbds; using namespace std; class DSU{ private: map<int,pair<int, int>> parent; public: DSU(int size){} pair<int, int> find(int node){ if(parent.find(node) == parent.end()){ return {node, -1}; } return parent[node]; } bool union_set(int node1, int node2, int p){ auto it = find(node2); int root = it.first; int rootP = it.second; if(rootP == -1){ parent[node2] = {node1, p}; return true; } else if(root < node1){ parent[node2] = {node1, p}; return union_set(root, node1 - 1, rootP ^ p); } else if(root > node1){ return union_set(node1, root - 1, rootP ^ p); } else{ if(rootP == p) return true; else return false; } } }; int main(){ ////////////////////////////////////////////////////// ios_base::sync_with_stdio(false); cin.tie(NULL); ////////////////////////////////////////////////////// int t; // cin>>t; // int ct = 0; t = 1; while(t--){ while(true){ int n; cin>>n; if(n == -1){ break; } DSU dsu(n); int q; cin>>q; int ans = 0; bool b = false; while(q--){ int x, y, p; string str; cin>>x>>y>>str; p = (str == "even") ? 0 : 1; bool is = dsu.union_set(x, y, p); if(is && !b){ ans++; } else{ b = true; } } cout<<ans<<'\n'; } } } |
| Wtf is wrong with Test #3 ?!?!?!??! Dijkstra not working here??? | Luka Bulatovic | 1450. Russian Pipelines | 21 Nov 2025 01:28 | 5 |
I did Dijkstra algorithm for S to F, but seems to exceeds time on test #3 ? Anyone got a clue? Tnx in advance Well, I do not know what this test is, but the answer for this test is "No solution". I don't know how to solve this problem with Dijkstra algorithm. My approach is another. Perhaps one pair of tests below can help you to understand the problem more clearely: 7 7 1 2 10 2 3 10 3 4 5 1 5 1 5 6 50 6 7 50 7 3 50 1 4 ans: 156 7 7 1 2 10 2 3 10 3 4 5 1 5 50 5 6 50 6 7 50 7 3 50 1 4 ans: 205 What you need to do is to find the path with maximum weights of all edges while Dijkstra tries to find minimum. You're solving the wrong problem. I was getting TLE 16 with inversed SPFA (longest path) when using DFS. Switched to BFS (queue instead of recursion) and got AC. |
| Sample case incorrect? | guilty spark | 1160. Network | 19 Nov 2025 22:30 | 3 |
It can be done with only 3 cables with max value of 1. Got AC “You are to help Andrew to find the way to connect hubs so that all above conditions are satisfied.” So you can output any correct answer. I got an AC too, with a program outputting only 3 connections for the sample case. The only thing that actually matters is the very first value of the output - the maximum length of a cable. Generally it means the problem is much simpler than finding the optimal MST. |
| WA4 | Kelemvora | 1703. Robotic Arm | 19 Nov 2025 14:03 | 2 |
WA4 Kelemvora 31 Oct 2018 04:57 Re: WA4 Andrey_Vorobey 19 Nov 2025 14:03 idk i just love chiken wings so much Edited by author 19.11.2025 14:03 |
| WA2 in Go is because of invalid "\n" handling in fmt.Scanf | Aleksei Chernenkov | 1156. Two Rounds | 13 Nov 2025 15:19 | 1 |
In Go you should use `fmt.Scanf("%d %d\n", &a, &b)` instead of `fmt.Scanf("%d %d", &a, &b)`! Using the latter results in reading zeroes. |
| Has anyone calculated the maximum possible number of boxes? | † SiriuS † | 1589. Sokoban | 11 Nov 2025 02:31 | 2 |
My max value is 13: ######## #@ $.$.# # $.$.# #$ $.$.# #. $.$.# #$ $.$.# #. $.# ######## Has anybody found more? 34 boxes: ######## #******# #******# #******# #******# #******# #***.$@# ######## |
| Hints and Solution for late people | helloiamalive | 1100. Final Standings | 8 Nov 2025 15:43 | 1 |
Hint 1: The teams with same scores follow their original order, top to bottom. Hint 2: You can implement stable sort by yourself. Hint 3: M is given <=100. Hint 4: Group all the teams with the same score together in a container. Solution : Use an array of arrays, with size 101. You can add the input as it comes in the array with the index equal to its score. Output starting from the end, iterating over the array of arrays. C++ Code: #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<vector<int>> v(101); for(int i =0;i<n;i++) { int a,b; cin >>a >> b; v[b].push_back(a); } for(int i =100;i >= 0;i--) { if((v[i].size())) { for(auto a:v[i]) { cout << a << " " << i << "\n"; } } } return 0; } |
| Soo the problem is only math. | Shomik Shahriar | 1209. 1, 10, 100, 1000... | 8 Nov 2025 03:14 | 4 |
I tried with precalculating with map for setting up the index with 1 only rest will be auto 0 but miraculously WA at 4. so i figured out that the author only wants you to solve with his idea only. So good luck. These problems are trivial once you start thinking about things algebraically. The author made the constraints the way they are to try to force you in that direction as its an educational problem. i did what you said here and it works |