| Show all threads Hide all threads Show all messages Hide all messages |
| Если кому интересно... | Ivanov Alexander | 1083. Factorials!!! | 21 Jan 2026 21:17 | 32 |
тест 1: n=9 k=2 тест 2: n=1 k=1 тест 3: n=10 k=1 тест 4: n=8 k=1 тест 5: n=10 k=2 тест 6: n=7 k=2 тест 7: n=1 k=2 тест 8: n=2 тест 9: n=10 k=5 тест 10: n=9 k=5 n=3,4,5,6 не встречается... тест 8 - к по условию не может быть меньше 1. В единственной строке сначала дано целое число n, 1 ≤ n ≤ 10, затем ровно один пробел, затем k восклицательных знаков, 1 ≤ k ≤ 20. про значение К в этом тесте не известно 1) 50 Очень интересно а как вы эти тесты извлекли? Edited by author 10.02.2010 23:53 Какой ответ на тест 5? 945? Тест 8 - просто супер. Явная неучтенка. И сколько еще таких тестов? Просто офигенная постановка задачи. Edited by author 16.04.2011 19:50 Скажите,пожалуйста, какой должен быть ответ в тесте номер 8? Я уже пробовала,чтобы программа не пропускала такие варианты с помощью repeat, пробовала ставить в таком случае ответ 1, ответ 0, ответ - само число. Ничего не получается! Edited by author 29.07.2014 13:12 Тест 10: 9 !!!!! = 9(9-5)(9 mod 5) = 9*4*4 = 144 Почему вылазит неправильный ответ?! N mod K — это последний больший нуля элемент ряда N - XK. В данном случае этот элемент первый и он же последний, не нужно умножать на него два раза. Иными словами, мы вычитаем K от исходного числа, и умножаем на получившееся, и повторяем так до тех пор, пока получившееся число не станет нулём или меньше. Еще вопрос: 2 !!! = ? 2 или 4? и какие вводные 11-го теста? Меня очень интересует как в примере 9 !! получилось равным 945 если разбирать описание задачи то получим: n = 9 k = 2 n mod k = 1(есть остатое от деления) тогда получаем 9!! = 9*(9-2)*1 = n(n-k)(n mod k) = 9*7*1 = 63 Ну откуда 945 невкурю???? This problem is easily solving without any precalcing or info about tests. Not more than 15-20 lines of code. I did not ask about the problem of solving the problem. I asked about the correctness of my reasoning, I can not right in the calculation of 9 !! 9 !! i 1) n:=9*(9-2) 2)n:=63*(9-4) 3)n:=315*(9-6) 4)n:=945*(9-8) This is correctness of your reasoning. In my program test 5 is correct, but system writed, that wrong. Answer - 7680 In my program test 5 is correct, but system writed, that wrong. Answer - 7680 All manual tests ok. Test 5 is also in error. I do not understand this... import java.util.*; public class Factor { public static void main(String[] args){ Scanner put=new Scanner(System.in); int n,k,fac; String ffc; n=put.nextInt(); ffc=put.next(); k=ffc.length(); fac=n; for(int i=1;i<(n/k);i++){ fac=fac*(n-(i*k)); } if(n%k!=0)fac=fac*(n%k); else fac=fac*k; System.out.print(fac); } } Edited by author 29.10.2012 17:37используя гамма функцию можно в одну строчку :) Застрял в тесте 8: #include<stdio.h> #include<string.h> int main(){ int n, i, l; char k[20]; scanf("%d%s", &n, k); l = strlen(k); int result = n; i = n - l; do{ result = result * i; i = i - l; } while (i > n % l); if (n == 1) result = 1; printf("%d", result); return 0; } Edited by author 02.12.2017 02:41 Edited by author 02.12.2017 02:41 Edited by author 25.07.2014 12:47 9 !! = 9*(9-2)*(9-2*2)*(9-2*2*2)....*1=9*7*5*3*1=945 Answers for numbers from topic: 1. 945 2. 1 3. 3628800 4. 40320 5. 3840 6. 105 7. 1 8. 2 (if in this case k = 1) 9. 50 10. 36 Моё нестандартное решение :) import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class proga { public static void main(String[] args) throws IOException { BufferedReader sc = new BufferedReader(new InputStreamReader(System.in)); String[] temp = sc.readLine().split(" "); int ch = Integer.parseInt(temp[0]); int len = temp[1].length(); int ost = ch%len; int result = ch; if(ost==0){ost+=len;} while(ch!=ost) { ch-=len; result*=ch; } System.out.println(result); } } а какой ответ на тест 5 ? what's the right answer for test 5 ? who knows ? can you give a hand pls тест 1: n=9 k=2 тест 2: n=1 k=1 тест 3: n=10 k=1 тест 4: n=8 k=1 тест 5: n=10 k=2 тест 6: n=7 k=2 тест 7: n=1 k=2 тест 8: n=2 тест 9: n=10 k=5 тест 10: n=9 k=5 n=3,4,5,6 не встречается... why wrong on test 5?? #include<iostream> //#include<string> using namespace std; int main() { int n; string s; cin>>n; cin>>s; int sum=n; int len = s.size(); //cout<<len<<endl; int i =1; while((n-i*len)>1) { sum*=(n-i*len); i++; } if(n%len!=0) cout<<(sum*(n%len))<<endl; else cout<<sum*len<<endl; return 0; } 8th test is 2 !! and the answer is 2 |
| wa9 | 👑TIMOFEY👑`~ | 1257. Hyphenation | 16 Jan 2026 12:44 | 1 |
wa9 👑TIMOFEY👑`~ 16 Jan 2026 12:44 incorrectly selected transfer |
| TLE #18 | imeks007 | 1491. Unreal Story | 15 Jan 2026 14:16 | 1 |
static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int[] values = new int[n]; for (int i = 0; i < n + 1; i++) { string[] str = Console.ReadLine().Split(); int a = int.Parse(str[0]) - 1; int b = int.Parse(str[1]) - 1; int c = int.Parse(str[2]); for (int j = a; j <= b; j++) { values[j] += c; } } Console.Write(string.Join(" ", values)); } It's simple algorithm. How to speed it up? Which algorithm should I use? Edited by author 21.01.2026 21:22 |
| WA6 | Timur_Kumirov | 1638. Bookworm | 12 Jan 2026 17:59 | 1 |
WA6 Timur_Kumirov 12 Jan 2026 17:59 |
| <-- Some Test Cases --> | diego.OCI.2019@gmail.com | 1837. Isenbaev's Number | 11 Jan 2026 16:14 | 3 |
Hi, I writed this post because I wanted to share with you some of the test cases* that helped me a lot at the time. I hope it helps you :) --> Test 1: 1 A B C --> Answer: A undefined B undefined C undefined ------------------------------ --> Test 2: 5 Isenbaev A B A B C D Q P C H N G N P --> Answer: A 1 B 1 C 2 D 5 G 4 H 3 Isenbaev 0 N 3 P 4 Q 5 ------------------------------ --> Test 3: 13 Fominykh Isenbaev BBB BBB CCC AAA Ayzenshteyn Oparin Samsonov Ayzenshteyn Chevdar Samsonov Dublennykh Fominykh Ivankov Burmistrov Dublennykh Kurpilyanskiy Cormen Leiserson Rivest Oparin AA AAA Isenbaev Oparin Toropov AA DD PP PP QQ RR RR SS TT TT Toropov Oparin --> Answer: AA 2 AAA 2 Ayzenshteyn 2 BBB 1 Burmistrov 3 CCC 2 Chevdar 3 Cormen undefined DD 3 Dublennykh 2 Fominykh 1 Isenbaev 0 Ivankov 2 Kurpilyanskiy 3 Leiserson undefined Oparin 1 PP 3 QQ 4 RR 3 Rivest undefined SS 3 Samsonov 2 TT 2 Toropov 1 ------------------------------ --> Test 4: 3 Isenbaev A B A B C A Q W --> Answer: A 1 B 1 C 2 Isenbaev 0 Q 2 W 2 ------------------------------ *(All test cases were made by other users, so you'll probably found them in other Posts/Topics/Discussions). Acknowledgments to: -> "Vit Demidenko" & "Nathalie" -> "Pavel Nikolov" -> "mccolt89" -> "Megakrit" -How I solved it: I solved this problem in Java, for that, I used: ->1 java.util.Scanner ->1 java.util.HashMap ->1 java.util.TreeMap ->3 java.util.HashSet ->1 java.util.LinkedList ->? java.util.StringTokenizer (or you can just simply use the Scanner method "next()"). (The structures can be declared inside loops or other structures). Hope all this helped you :)
Edited by author 08.04.2020 00:48 Edited by author 08.04.2020 00:49 Thanks, I forgot that Isenbaev might not be on the team. |
| How does difficulty work on this site as I don't quite get how the numbers scale | gigabyts | | 8 Jan 2026 08:48 | 1 |
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 |
| wa5 | 👑TIMOFEY👑`~ | 1299. Psylonians | 6 Jan 2026 13:34 | 1 |
wa5 👑TIMOFEY👑`~ 6 Jan 2026 13:34 |
| believe in yourself | 👑TIMOFEY👑`~ | 1811. Dual-SIM Phone | 1 Jan 2026 23:42 | 1 |
|
| Problem 1418. Military Story rejudged | Vladimir Yakovlev (USU) | 1418. Military Story | 31 Dec 2025 20:17 | 2 |
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) :))) |
| Why brute force not TLE? | KostyaRychkov`~ | 1539. Intelligence Data | 31 Dec 2025 06:59 | 2 |
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 |
| Problem 1536. Delights of Pipe-weed rejudged | Vladimir Yakovlev (USU) | 1536. Delights of Pipe-weed | 26 Dec 2025 22:06 | 1 |
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. |
| 1001 | bini7yam | 1001. Reverse Root | 24 Dec 2025 20:08 | 2 |
1001 bini7yam 24 Dec 2025 11:34 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. |
| What's wrong out there ? Problem 1001 | Iftekhar | 1001. Reverse Root | 24 Dec 2025 01:12 | 3 |
#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 |
| Problem 1230. Introspective Program rejudged | Vladimir Yakovlev (USU) | 1230. Introspective Program | 23 Dec 2025 03:52 | 1 |
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. |
| 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. |