| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Can anyone tell me whats wrong with this code | Programmer | 1021. Таинство суммы | 26 июл 2022 16:00 | 1 |
#include <bits/stdc++.h> using namespace std; int main(){ int n1,n2; int a[n1],b[n2]; cin>>n1; for(int k=0;k<n1;k++) cin>>a[k]; cin>>n2; for(int k=0;k<n2;k++) cin>>b[k]; sort(a,a+n1); sort(b,b+n2); int i=0,j=n2-1; bool ans=false; while(i<n1&&j>=0){ if(a[i]+b[j]==10000){ ans=true; break; } else if(a[i]+b[j]>10000){ j--; } else{ i++; } } if(ans) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; } |
| Problem 1010. Discrete Function [why i am getting wrong test case passing] | Amish jha | 1010. Дискретная функция | 23 июл 2022 22:08 | 1 |
/* :::: author:@DEANNOS at CODEFORCES 2022 :::: */ #include <bits/stdc++.h> //using policy based stl #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/trie_policy.hpp> using namespace std; #define endl "\n" #define mod 1000000007 #define ll long long #define ld long double #define vi vector<int> #define vll vector<ll> #define pll pair<ll, ll> #define pii pair<int, int> #define ld long double #define ff first #define ss second #define vs vector<string> #define vpll vector<pll> #define vb vector<bool> #define pb push_back #define bg begin() #define mp make_pair #define ed end() #define gi greater<int> () #define srt(v) (sort(all()) #define all(c) (c).begin(), (c).end() #define sz(x) (int)(x).size() #define fo(i,n) for(ll i=0;i<n;i++) #define Fo(i,k,n) for(ll i=k;i<n;i++) const int INF = 1000000000; const int MAX_N = 2e5; /* int fastpower(int x, int y, int mod) { int res = 1; x = x % mod; if (x == 0) { return 0; } while (y > 0) { if (y & 1) { res = (res*x) % mod; } y = y>>1; x = (x*x) % mod; } return res; } */ /* int GCD(int a,int b) { while(b!=0) { int rem=a%b; a=b; b=rem; } return a; } */ ll integer(ll a) { return a >= 0 ? a : -a; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; ll ans1 = 1, ans2 = 2, mx = 0; ll a; cin >> a; for (int i = 1; i < n; i++) { ll b; cin >> b; if (integr(a - b) > mx) { mx = integer(a - b); ans1 = i; ans2 = i + 1; } a = b; } cout << ans1 << ans2 << endl; return 0; } |
| Некорректное условие | Alexey Krupnitskiy | 1004. Экскурсия | 22 июл 2022 00:07 | 2 |
1. Вы пишите:найти для экскурсии кратчайший маршрут, начинающийся и заканчивающийся в одном и том же месте, т.е. количество перекрестков в маршруте должно быть N+1?. в след. абзаце: Все числа x1, …, xk должны быть различны. т.е. либо маршрут не должен заканчиваться на том же перекресте где начался либо должно быть дополнительное условие Х1=Хк. это принципиальная ошибка в условии. 2. пример который вы привели: 5 7 1 4 1 1 3 300 3 1 10 1 2 16 2 3 100 2 5 15 5 3 20 4 3 1 2 10 1 3 20 1 4 30 -1 дает результат: 1 3 5 2 No solution. а куда вы в первом тесте дели перекрестов №4? 3. Исходя из примера маршрут не должен содержать в себе все перекрестки? Ошибки очевидны. те решения, что вы приняли - частные, случайно полученные. Уточняйте условия и проверяйте свое решение. Edited by author 07.11.2014 13:33 Нужно найти минимальное кольцо графа. Но именно кольцо, то есть, охватывать не менее трёх перекрёстков. В первом тесте к 4му перекрёстку ведёт всего одна дорога, а значит, в ответ он в любом случае не попадает. |
| Условие | Davydes | 1004. Экскурсия | 22 июл 2022 00:02 | 3 |
Что-то я не совсем понял условие задачи. "M двусторонних дорог" - т.е. вроде как не ор. граф. Но пример и решение говорят, о том, что скорее это все таки ор. граф. 1 3 300 3 1 10 Так есть ориентация у ребер или нету? Написано, что возможно существование дорог, т.е. тебе нужно выбрать минимальную, а осталные проигнорировать. Два перекрёстка могут соединять несколько дорог. Но граф не ориентированный. |
| Very good test!!! | 10100 | 1004. Экскурсия | 21 июл 2022 23:34 | 3 |
6 6 1 2 1 1 3 1 2 3 10 4 5 2 4 6 2 6 5 2 -1 ANS: 4 5 6 I'm sorry, but it seems incorrect. You can go from 4 to 5 or from 4 to 6, but then you're locked. Please note that we have a directed graph. Why? You can move in both directions of road. |
| WA16 | andreyDagger`~ | 2090. Перекрёсток судьбы | 20 июл 2022 12:26 | 1 |
WA16 andreyDagger`~ 20 июл 2022 12:26 Don't calculate second probability, instead calculate probability that sergey will come to the cafe in the same time both on the first path and on the second. Using this probability you can easily calculate second answer |
| dp O(n^3) 0.078s | InstouT94 | 1900. Машина счастья | 19 июл 2022 18:39 | 1 |
|
| WA16 | andreyDagger`~ | 1751. Теория Невероятности | 19 июл 2022 14:35 | 1 |
WA16 andreyDagger`~ 19 июл 2022 14:35 Check your "strong connected components" code |
| Some tests for you guys | SpBerkut | 2054. Астрономия | 18 июл 2022 16:00 | 1 |
89 2 12 apr 17 21 jun 2 8.4874959390 22.5720084367 ----- 15.7 3 1 apr 13 21 dec 8 12 oct 17 70.5459180884 19.4871801373 10.3882860539 ----- -71 3 25 feb 5 3 aug 15 6 oct 10 3.6840008337 0.0000000000 22.5788661148 ----- 13.5 6 1 jan 15 1 mar 15 1 may 15 1 jul 15 1 sep 15 1 nov 15 33.5814351330 41.8302148985 44.0959307671 47.1958719101 46.8042204476 34.9899114970 ----- |
| Accepted C# | PI−2016-Trykoza | 1001. Обратный корень | 17 июл 2022 17:38 | 4 |
* deleted * Edited by moderator 23.07.2022 20:33 We need a ranking for the least amount of code. I think It doesn't matter. Algorithm is important! Thanx a lot! I didn't know how to read all lines from console! Edited by author 17.07.2022 17:39 |
| почему именно stable_sort? c++ | FaxriddinT | 1100. Таблица результатов | 15 июл 2022 17:23 | 4 |
почему именно stable_sort? c++ простой sort нельзя? c++ Because bubble sort (described in "Notes" chapter) is stable можно, почему нет? Заходит на AC Thanks, with stable_sort everything works. |
| Try this test if you have WA17 | so no fancy crap ok | 1085. Встреча | 15 июл 2022 16:09 | 1 |
1 1 1 1 3 100 1 0 100 1 1 0 1 0 answer: 1 0 |
| Test with bridge | RybKMU | 1419. Карта мира 40 островов | 14 июл 2022 13:47 | 2 |
27 5 O-O-O-O-O-O-O O-O-O-O-O-O-O |\ \| | | |/| |\| | | |/ /| O-O O O O O O-O O O O O O-O |/ / /| |\ \| |/ /| |\ \ \| O-O-O-O-O-O-O O-O-O-O-O-O-O Answer: Just a picture Edited by author 20.06.2023 20:06 |
| Warning | Zeardoe | 1486. Одинаковые квадраты | 14 июл 2022 13:16 | 1 |
Anti-hash tests are added. Please choose mod = 2^64 and strange p in case of being hacked. |
| WA7 | Eray | 1486. Одинаковые квадраты | 13 июл 2022 06:56 | 2 |
WA7 Eray 13 июл 2022 06:54 Maybe you can find out why you are wrong in this test if you WA on 7. 3 4 aaaa aaaa aaaa answer: 3 1 1 1 2 (or other correct coordinates) sorry for my bad English by the way, use 123 and 1789 in hashing will pass. |
| Sample test | A.Z | 1638. Книжный червь | 11 июл 2022 16:18 | 13 |
Why output is 2 , I think it should be 22 , because the worm started from the first sheet of vol 1 and goes until last sheet of vol 2 . so it's path is 10+1+1+10 = 22 if "NO COMMENTS" why you write this? information - Zero You should know, that answer "No comments" is identical to "Read the problem statement" You could have written explanation or something instead of writing no comments. Its like making fun of the guy, like jewish do. Try to put two books in a bookshelf, and see the reason for no comments :D what answer will be for test like this: 10 1 3 1 zero? >what answer will be for test like this: >10 1 3 1 Answer is 34. No for the case 10 1 3 1 Answer is 12 No for the case 10 1 3 1 Answer is 12 No. You are wrong. My ACed solusion also gave 34. Even if you solve it by hand it is the same result. Because books are [from first ][][ to last] There are 4 symbols of [ and ] that are book covers. So, three books and 4 covers of the books that worm had gnawed. You seem to be an anti-Semite! Jewish are not guilty of your stupidity Are there no moderators here? Hateful comments should be instantly removed and the idiots who post them should be temporarily or permanently banned! Think of the reputation of this otherwise great site! Ok, the problem statement doesn't clarify that this book is an LTR language (left to right, e.g. English) book.Shuch a crucial info shouldn't be left to the assumptions of the reader. |
| WA 16 | andreyDagger`~ | 1571. Переводчики | 10 июл 2022 11:42 | 1 |
WA 16 andreyDagger`~ 10 июл 2022 11:42 |
| Удаление аккаунта | ermukanov.sh | | 9 июл 2022 17:00 | 2 |
Предусмотрена ли функция удаления аккаунта? Каким образом это можно сделать? |
| Problem 1089 "Verification with the Dictionary" has been rejudged | Problemset Maintainer | 1089. Проверка со словарём | 9 июл 2022 16:58 | 1 |
The following changes have been made to the problem: - The checking program strictly checks that the initial formatting is preserved, for example it rejects outputs with additional empty lines before or after the text. - Missing limitations added to the problem statements: - The words in the text to correct are no longer than 16 characters. - The lines in the text to correct are no longer than 80 characters. - The cumulative length of all lines doesn't exceed 10000 characters. - New tests have been added. - Time limit has been reduced to 0.5 sec. - All solutions have been rejudged. 44% of authors have lost their accepted solutions. |
| What is the correct output to this test? | Yunzhong | 1071. Никифор 2 | 8 июл 2022 19:55 | 5 |
1. Input: 7122 2119 2. Input: 7122 2120 My AC program outputs next: > 1. Input: 7122 2119 Output: 4923 > 2. Input: 7122 2120 Output: 2501 > 1. Input: 7122 2119 5003 > 2. Input: 7122 2120 2501 > 1. Input: 7122 2119 5003 > 2. Input: 7122 2120 2501 I'm too ! List of posible solutions (I think) 7122 2119 Base 5003 12119 => 2119 Base 2966 21190 => 2119 Base 2965 21192 => 2119 Base 2964 21194 => 2119 Base 2963 21196 => 2119 Base 2962 21198 => 2119 (1) Base 423 16354 => 54 (2) Why 1 or 2 dont can be solutions?, there is something I am not seeing? Edited by author 08.07.2022 19:57 |