| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| test | >>> | 1900. Машина счастья | 4 ноя 2021 15:46 | 1 |
test >>> 4 ноя 2021 15:46 |
| What's the correct solution | Celebrate | 1895. Бифштексы на борту | 4 ноя 2021 08:16 | 1 |
My solution is O(n^3T),and how to solve it faster? |
| Hint | Takanashi Rikka | 2066. Простое выражение | 4 ноя 2021 06:32 | 3 |
Hint Takanashi Rikka 23 фев 2016 12:50 Answer is a - b - c or a - b * c Re: Hint Minos Skistonrak 4 апр 2018 18:50 Is this answer after sort? |
| Help! TLE19. What's wrong? | Maxim Afripov | 1510. Порядок | 3 ноя 2021 23:29 | 1 |
using System; using System.Collections.Generic; namespace Order { class Banknotes { public long value = 0; public int count = 0; public Banknotes(long value) { this.value = value; } } class Program { public static Banknotes FindMaxValue (List<Banknotes> list) { int _maxValue = list[0].count; Banknotes _maxBanknote = list[0]; for (int index = 1; index < list.Count; index++) { if (list[index].count > _maxValue) { _maxBanknote = list[index]; _maxValue = list[index].count; } } return _maxBanknote; } public static void Main (string[] args) { List<Banknotes> banknotes = new List<Banknotes>(); int length = Convert.ToInt32(Console.ReadLine()); if (length == 0) return; banknotes.Add(new Banknotes(Convert.ToInt64(Console.ReadLine()))); banknotes[0].count = 1; for (int iterable = 1; iterable < length; iterable++) { long number = Convert.ToInt64(Console.ReadLine()); for (int jterable = 0; jterable < banknotes.Count; jterable++) { // Console.WriteLine($"{number} is {numbers[jterable].value}?"); if (number == banknotes[jterable].value) { banknotes[jterable].count++; // Console.WriteLine("yes"); break; } else if (jterable + 1 == banknotes.Count) { // Console.WriteLine("no"); banknotes.Add(new Banknotes(number)); } } } Console.WriteLine(FindMaxValue(banknotes).value); } } } |
| Why WA1? | ivan.filippov201608@gmail.com | 1223. Chernobyl’ Eagle on a Roof | 3 ноя 2021 00:00 | 1 |
Why WA1? ivan.filippov201608@gmail.com 3 ноя 2021 00:00 pls give me some tests,i don't know,what's wrong with my code #include<iostream> #define endl '\n' #define ll long long # define ld long double using namespace std; ll d[1100][1100]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifdef LOCAL freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif // LOCALfr int n,m; for (int i=1;i<=1000;i++) { for (int j=1;j<=1000;j++) { d[i][j] = d[i][j-1] + d[i - 1][j - 1] + 1; } } n=1;m=1; while (n && m) { cin>>n>>m; if (n &&m) { int l=1,r=m+1000,mi; while (l<r) { mi=(l+r)/2; if (d[n][mi]>=m) { r=mi; } else l=mi+1; } cout<<l<<endl; } } return 0; } Edited by author 03.11.2021 00:01 Edited by author 03.11.2021 00:01 Edited by author 03.11.2021 00:01 |
| Some tests | Nedyalko Borisov | 1432. Двойное счастье | 2 ноя 2021 07:27 | 1 |
Here are some tests that helped me figure out what was wrong with my program: 316496 out => 317559 317560 318533 out => 318659 318660 945999 out => 950509 950510 055099 out => 055109 055110 00510059 out => 00504999 00505000 00450010 out => 00460019 00460020 00504010 out => 00504999 00505000 0019 out => 4509 4510 00510059 out => 00510059 00510060 945999 out => 950509 950510 008359 out => 009449 009450 3000 out => 4509 4510 4509 out => 4509 4510 4099 out => 4509 4510 9999 out => No solution 373730020389 out => 373730021389 373730021390 373730030290 out => 373730031289 373730031290 373730030289 out => 373730031289 373730031290 Good luck! |
| C# | Maxim Afripov | 1601. АнтиКАПС | 2 ноя 2021 00:08 | 1 |
C# Maxim Afripov 2 ноя 2021 00:08 1) Input text 2) Compare each character with: letter punctuation 3) Output with changes using System; using System.Collections.Generic; namespace AntiCAPS { public class Program { public static void Main(string[] args) { bool _newSentence = true; string message = Console.In.ReadToEnd().ToLower(); List<char> punctuation = new List<char>(new char[] { '!', '.', '?' }); for (int iterable = 0; iterable < message.Length; iterable++) { if ((int)message[iterable] >= 97 && (int)message[iterable] <= 122) { if (_newSentence) { Console.Write(Char.ToUpper(message[iterable])); _newSentence = false; } else Console.Write(message[iterable]); } else if (punctuation.Contains(message[iterable])) { _newSentence = true; Console.Write(message[iterable]); } else Console.Write(message[iterable]); } } } } Edited by author 02.11.2021 00:10 |
| Please help. Python 3.8 | ok_SYS | 1293. Эния | 1 ноя 2021 23:09 | 1 |
N = input().split() res = int(N[0]) * int(N[1]) * int(N[2]) * 2 NVM... forgot to use print Edited by author 01.11.2021 23:13 |
| If you have WA 9 | Tapti | 1208. Соревнование легендарных команд | 1 ноя 2021 21:13 | 1 |
Try this 4 a b c a p d b e w b t y ans:2 |
| hint | >>> | 1356. Чего бы попроще | 1 ноя 2021 14:44 | 3 |
hint >>> 1 ноя 2021 14:30 / Edited by author 01.11.2021 14:38 / Edited by author 01.11.2021 14:38 просто while() и проверка на prime() а насчет доказательства не знаю, но существует утверждение о том, что любое чётное число, начиная с 4, можно представить в виде суммы двух простых чисел. ( Проблема Гольдбаха ). Хотя пока она не доказана. Но В 1966 году Чэнь Цзинжунь доказал, что любое достаточно большое чётное число представимо или в виде суммы двух простых чисел, или же в виде суммы простого числа и полупростого |
| Stupid problem | andreyDagger | 1179. Числа в тексте | 31 окт 2021 15:58 | 2 |
This is an example of how you shouldn't make the problem |
| Using OOP (C#) | Maxim Afripov | 1404. Легко взломать! | 31 окт 2021 14:59 | 1 |
using System; namespace EasyHack_ { class Coder { private short[] unicode; private string word; public static readonly string alphabet = "abcdefghijklmnopqrstuvwxyz"; public string GetCoderWord() { this.UnicodeToCoder(); this.SetUnicode(); return this.word; } public string GetOutCoderWord() { this.UnicodeOutCoder(); this.SetUnicode(); return this.word; } public Coder(string word) { this.word = word.ToLower(); this.unicode = new short[word.Length]; this.GetUnicode(); }
public string GetWord () { return this.word; } public short[] GetWordUnicode () { return this.unicode; } private void GetUnicode () { for (int iterable = 0; iterable < unicode.Length; iterable++) { this.unicode[iterable] = (short)Coder.alphabet.IndexOf(this.word[iterable]); } } private void SetUnicode () { this.word = ""; for (int iterable = 0; iterable < unicode.Length; iterable++) { this.word += Coder.alphabet[unicode[iterable]]; } } private void UnicodeToCoder () { if (unicode[0] == 21) unicode[0] = 0; else this.unicode[0] = (this.unicode[0] + 5 > 25) ? (short)(this.unicode[0] + 5 - 25) : (short)(this.unicode[0] + 5); for (int iterable = 1; iterable < this.unicode.Length; iterable++) { this.unicode[iterable] = (this.unicode[iterable] + this.unicode[iterable - 1] > 25) ? (short)((this.unicode[iterable] + this.unicode[iterable - 1]) % 26) : (short)(this.unicode[iterable] + this.unicode[iterable - 1]); } } private void UnicodeOutCoder () { for (int iterable = 1; iterable < this.unicode.Length; iterable++) { while (this.unicode[iterable] < this.unicode[iterable - 1]) this.unicode[iterable] += 26; } short _lastUnicode = this.unicode[0]; if (this.unicode[0] == 0) this.unicode[0] = 21; else this.unicode[0] = (this.unicode[0] - 5 < 0) ? (short)(25 + this.unicode[0] - 5) : (short)(this.unicode[0] - 5); for (int iterable = 0; iterable < this.unicode.Length - 1; iterable++) { short element = this.unicode[iterable + 1]; this.unicode[iterable + 1] -= _lastUnicode; _lastUnicode = element; } } } class Program { public static void Main(string[] args) { string coderWord = Console.ReadLine(); Coder word = new Coder(coderWord); Console.WriteLine(word.GetOutCoderWord()); } } } Edited by author 31.10.2021 14:59 Edited by author 31.10.2021 15:11 |
| note for WA#7 | hoan | 1205. На метро или пешком? | 31 окт 2021 02:31 | 6 |
in this test the footspeed is lower than one. sorry for my poor english. GOOD LUCK!!! What does this actually mean? I think it doesn't change anything! (speed < 1 but more that 0) Even I found that footseed is 0.5 in test 7. But what then? It doesn't change my solution and i can not understand if it actually does... :( and speed of underground is 50 in test 7 and some of the coordinates are in scientific notation, I mean it looks like 6.000000e-14 Edited by author 31.10.2021 02:32 |
| If you're using segment tree and getting TLE | andreyDagger | 2062. Амбициозный эксперимент | 28 окт 2021 17:41 | 1 |
Use Fenwick tree instead of segment tree |
| I think it in this way. | CodeChomper | 1017. Лестницы | 28 окт 2021 03:44 | 6 |
Considering that d[i][j] indicate the number of i bricks divided into j columns steps.So if we cut away the downmost brick of every steps, and we can get d[i][j] = d[i-j][j-1](if the 1st step only have one brick) + d[i-j][j](if the 1st step have more than one brick). Thus q = d[n][2->max_j] really smart! how can you get that dude? Hello, Thank you for your hint, it was very useful for me
and yes, your solution is awesome! really nice idea, i like it. But how does this transition ensures that the next column always has more bricks than the current column? |
| WA Test#7 | Vladimir | 1563. Баяны | 27 окт 2021 17:08 | 1 |
What is in this Test? What is the difference from previous ones? There are no big numbers, no special cases - as far as I get the task... |
| i dont know why wa3.. | >>> | 1362. Одноклассники 2 | 27 окт 2021 08:09 | 3 |
окей это было связано с тем как я неверно пытался сделать корнем узел тани |
| WA on test #13 | rlac | 1835. Болотный доктор | 27 окт 2021 05:59 | 3 |
Hi. I'm getting WA on test 13 and I can't find my error. Can somebody get me some tricky cases?. Thanks in advance... My solution fail in the test aa@a a a@ab Edited by author 27.10.2021 06:00 |
| Couple of test cases which helped me | Smog | 1515. Финансовая реформа | 26 окт 2021 00:20 | 1 |
7 1 2 3 4 5 6 22 answer is 44 2 1 3 answer is 2 |
| if you have WA#5 try to use long arithmetics | KALO | 1029. Министерство | 24 окт 2021 22:31 | 4 |
There is no reason to use long arithmetic.. Read the hint. Though may be you store something amazing to solve the task in more effecient way... In any case, the problem is solvable without long arithmetic WTF REALLY IT HELPS ME!!! THANKS YOU. Я ТУПО СИДЕЛ И НИЧЕГО НЕ ПОНИМАЛ ПОЧЕМУ НЕ РАБОТАЕТ, ЛОНГИ ПОМОГЛИ!! только я не понял почему вообще инт не залетел) |