Common Board What is the criterion of optimality of the partition ? Minimum of maximum of 4 numbers, read problem Also, instead of «The i-th number in the j-th row» there should be «The j-th number in the i-th row» (unless, judging by the title, this is intended, haha) По условию может быть так(.-пробел):.........aaa.bbb.ссс. .....xxx.aaa.bbb.ccc. или .........aaa.bbb.ссс........ .....xxx.aaa.bbb.ccc........??????? И вообще,как в ЭТОЙ задаче считывать данные(на Паскале)? Edited by author 08.07.2016 21:27 Не может. В начале пробелов нет, между каждой группой ровно один пробел. Я делаю так: readln(s); i:=1; while i <= length(s) do begin //process [i], [i + 1], [i + 2] inc(i, 4); end; I tested my prog but I not found mistake Did you receive my email from a month ago? public class AB { public static void main(String [] args) { int a = 1; int b = 5; System.out.println((a+b)); } } В общем она требует ввод данных, а не определение переменных Edited by author 15.03.2016 20:58 Edited by author 15.03.2016 20:58 Тогда в чем проблема?))) public class Math{ public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int a = scanner.nextByte(); int b = scanner.nextByte(); System.out.print(a + b); } } import java.util.*; делал??? var m,n:word; i:word; begin readln(m,n); for i:=1 to n do begin write(i,' '); end; writeln; for i:=1 to m do begin write(i*n+1,' '); end; end. What test is wrong with it? Edited by author 07.07.2016 17:05 import re fl = re.compile('[+-]?[1234567890]*\.[1234567890]*([Ee][+-]?[1234567890]+)?') lf = re.compile('[+-]?[1234567890]+([Ee][+-]?[1234567890]+)?') nums = [] while True: first = input() if first == '#': break nums.append((first, int(input()))) for num in nums: num0 = num[0] if not (re.fullmatch(fl, num0) or re.fullmatch(lf, num0)): print('Not a floating point number') continue try: e_pos = num0.index('e') exp = int(num0[e_pos + 1:]) num0 = num0[:e_pos] except: try: e_pos = num0.index('E') exp = int(num0[e_pos + 1:]) num0 = num0[:e_pos] except: exp = 0 pm = num0[0] if pm in ['+', '-']: num0 = num0[1:] else: pm = '+' if pm == '+': pm = '' if exp > 0: num0 += '0' * exp elif exp < 0: num0 = '0' * (-exp) + num0 try: dot_pos = num0.index('.') except: dot_pos = len(num) num0 += '.' new_dot_pos = dot_pos + exp num0 = num0[:dot_pos] + num0[dot_pos + 1:] num0 = num0[:new_dot_pos] + '.' + num0[new_dot_pos:] while num0.startswith('0'): num0 = num0[1:] if num0.startswith('.'): num0 = '0' + num0 num0 += '0' * num[1] num0 = num0[:num0.index('.') + num[1] + 1] if num0.endswith('.'): num0 = num0[:-1] print(num0) My program (with error, I know where it is, but I will not write about it): import sys text = sys.stdin.readlines() text = ''.join(text) for symbol in ',;:-\n': text = text.replace(symbol, ' ') text = text.replace('!', '.').replace('?', '.') import re text = ' '.join(text.split()) text = text.replace('. ', '.') text = '.'.join(text.split('.')) text = text.replace(' .', '.') count = 0 for sentence in text.split('.'): if sentence != '': if sentence[0].islower(): count += 1 for word in sentence.split(): for letter in word[1:]: if letter.isupper(): count += 1 print(count) Edited by author 06.07.2016 19:17 I wrote 1009 and had AC, then I added long arifmetics, changing nothing and now I have WA#1. All test from 1009 are simmilar to 1012. What is test 1. Is it possible because of using stringstream out; out << k-1; mas[1] = out.str(); ? I did the same as you. Help us! Edited by author 05.07.2016 21:07 just need examples. I have no idea where is my mistake Can the knight run back and forward on the segment? Does it count as run up? Example: The monster is at (1,3), the knight is at (1,1) If the knight does (1,1) -> (1,2) -> (1,1) -> (1,2) -> Strike the strike force is 4 or 2? Thanks in advance If your algo is correct, then maybe the problem is the way you build the tree. Try this test: 5 2 3 1 1 4 1 10 2 3 20 3 5 20 Hope this test can help you. GC.Collect(); on each iteration has helped why my O(N * M) solution works for 2.65 seconds? I think 9 * 10^6 operstions should be done faster... Because reading 3000 x 3000 integers takes a lot of time. Give me some test, please!!! If N = M = 1, then 1 ≤ K ≤ min(M*N-1, 1000) = 0. I noticed that all primes in factorization of N are also strong pseudoprimes to base just 2 or 3. Added some tests on that. Thanks. Well, it's strange, but my program with primality test that checks for strong pseudoprimes to base 2 and 3 still gets AC. N = 25326001 The answer is 3, my program with weak primality test answers 2. Thanks, your tests have been added. 3 authors have lost their AC. Sorry, but can you give me 97 test, please? Forecoding, i guess i can help. Email me your TL97 code. I think it will be too hard to understand my code :) I don't really need to understand it too deeply to help, but oh well, as you wish. I get tired, so I send my code. Good luck :) Had some issues implementing the heap, and then realised had a nice Access Violation (didn't bother to check we weren't exceeding the bounds on the heaps underlying array). Now I'm stuck on Test #8 - but I've tried every test I've seen suggested in the comments....Anyone got a nice test to try ??? I've even tried generating up to about 190000 random numbers < 2^31-1 in Excel (3 columns) and my median always agrees with theirs.... I've Also tried the same number of ordered numbers (incrementing by 1) as well as random but sorted numbers in a single column (sorted in both directions). I suspect I have some silly output issue (rather than a logic issue - but that might just be because I;m arrogant). Ok, for those who have trouble with test 8. Apparently 0 is a valid value in the tests (I'd assumed that POSITIVE meant "strictly greater than 0" - I would have thought including 0 is NON-NEGATIVE rather than POSITIVE). Once I catered for the possibility of 0 in the heap, everything was happy.... In my case I was getting wrong one of the elements for the semi-sum. use cin.sync_with_stdio(false) Btw, WA5 was due to int instead of int64_t why did i use scanf still wa? |
|