Общий форум| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | | Tests | andreyDagger`~ | 1429. Печенье | 30 май 2023 23:33 | 1 | Tests andreyDagger`~ 30 май 2023 23:33 1 0 0 1 2 2 0 -1 1 0 3 3 3 2 -1 0 1 1 0 2 4 2 0 0 5 3 0 2 3 3 0 0 6 -1 0 5 5 0 1 5 4 0 0 5 10 10 5 10 0 5 0 10 5 6 8 0 0 1 2 0 1 4 0 1 4 2 1 4 4 1 2 4 1 0 4 1 0 2 1 10 2 1 1 5 1 1 5 2 3 0 -5 6 0 0 2 0 0 4 6 | | wrong statement | Dmitrii | 1651. Кратчайшая подцепь | 29 май 2023 23:28 | 1 | i couldn't understand, why my programm got Runtime error 15. When i increased MAXN from 1e4 + 10 to 1e5 + 10, i got AC. So the vertices number are in the range [1, 1e5], but not in [1, 1e4], as written in the statement | | Hhelp | Respect1 | 1601. АнтиКАПС | 29 май 2023 02:04 | 6 | Hhelp Respect1 27 дек 2012 14:56 Как понять когда она завершила ввод сообщения? Please use english. I translated your question with google translate and it said "How do you know when it has completed writing a message?". Well, it depends on the programming language you are using. Pascal: while not(eof(input)) (not sure if it was input) C: you usualy use while(!feof(stdin)) http://www.cplusplus.com/reference/cstdio/feof/ This doesn't seem to work (for me at least). C++: I think it's !cin.eof() (I've never used this one). > C: you usualy use while(!feof(stdin)) http://www.cplusplus.com/reference/cstdio/feof/> This doesn't seem to work (for me at least). This does not work if you read lines with gets and write it with puts, but feof(stdin) is works fine. May be some problems with linefeeds. Stupid MSVS. Edited by author 07.02.2013 12:20 Edited by author 07.02.2013 12:20Re: Hhelp [TDUweAI] daminus 26 июн 2013 21:51 on pascal
while not eoln do begin read(g_string); ...... ...... end; on java: Scanner scan = new Scanner(System.in); while (scan.hasNext()){ s = scan.nextLine(); } on python message = sys.stdin.readlines() and then ctrl+D to stop input | | for wa8 | Ade | 1248. Сумма последовательности | 28 май 2023 19:02 | 1 | don't round up. or you will get wa8. Edited by author 28.05.2023 19:05 | | Ultimate hint | Kergan | 2063. Чёрные и белые | 27 май 2023 11:53 | 2 | I'll just combine two previous hints. Use bubble sort and THEN use random. Use bubble sort and THEN assert that the balls are the same color in (n / 2) and (n / 2 + 1) | | WA-1 | Malak | 1876. Утро сороконожки | 27 май 2023 02:52 | 15 | WA-1 Malak 30 окт 2011 17:12 Hi, I'm still getting WA-1, can anybody give me answers to these tests: 80 60 60 80 60 60 Thanks. My AC program writes following answers: 80 60 >> 199 60 80 >> 200 60 60 >> 160 BTW I solved this problem without any boring special cases consideration, using only stupid DP[101][101]... Re: WA-1 Oleg Strekalovsky [Retired] 30 окт 2011 19:19 My any Java solutions get's WA 1 too. i think it's problem with java, have same too. wa for any solution, which has got ac before. I saw DP[101][101], is it for dynamic programming ? I don't think we'll need it. Edited by author 31.10.2011 02:12 in this problem dont need DP. you may take max from two optimal cases ;D ...or think how to make on DP Edited by author 31.10.2011 02:21 80 60 199 60 80 200 60 60 160 Its quite easy to do. Basically, there are 2 "worst" cases: 1). We take 40 right (equals 40*2=80 secs), then throw all the rest of the right ones (2*(b-40) secs), and them take the 40 left (40 secs). The time is 80+2*(b-40)+40=120+2*(b-40). 2). We take 39 left (78 secs), take 40 left ones (40 secs), throw all the other left ones away (2*(a-40)), and take the last right one (1 sec). The time is 78+40+2*(a-40)+1=119+2*(a-40). The answer is the maximum of these two. Re: WA-1 andrescmasmas 30 апр 2012 02:42 ONU_1785 In the case two, when you say: "We take 39 left (78 secs)", why? If I take the first 39 lefts, this not is 39 secs???? one second per each slipper ONU_1785 means 39 right, it's just a typo. Edited by author 20.05.2012 15:54 In the case two, when you say: "We take 39 left (78 secs)", why? If I take the first 39 lefts, this not is 39 secs???? one second per each slipper He wanted to wright 'We take 39 right' Re: WA-1 Alexey Dergunov [Samara SAU] 3 май 2012 15:53 Very hard problem, I thought about 20 minutes and then wrote DP[101][101][41][41] :) Re: WA-1 phoenix16prep 22 янв 2015 19:58 There are 2 possible bad ways: 1) mode "putting on left slippers" |*0*|0| slippers come only for right legs |*0*|40| (time +40*2) if there are more than 40 slippers for right legs they still come |*0*|40| (time + (b-40)*2) then there are slippers only for left legs |*40*|40| (time +40); 2) mode "putting on left slippers" |*0*|0| slippers come for right legs except 1 |*0*|39| (time +39*2) then slippers come only for left legs |*40*|39| (time +40)
now mode changes to "putting on right slippers" |40|*39*| happy centipede hopes to get the last needed right slipper, she gets all slippers for left legs, which are still left |40|*39*| (time + (a-40)*2) and finally she gets the last one right slipper |40|*40*| (time +1) So, just choose the worst way according to exact input. Re: WA-1 Andre Marin C# 27 май 2023 02:52 you have 60 and 80, from where you take 39? | | WA9 | Ade | 2099. Space Invader | 25 май 2023 20:35 | 1 | WA9 Ade 25 май 2023 20:35 a-b and c-d are close, but not touching each other. -2 0 0 -1 0 0 0 1 0 0 1000000 1 | | WA8 | andreyDagger`~ | 2083. Хранитель традиций | 25 май 2023 14:13 | 1 | WA8 andreyDagger`~ 25 май 2023 14:13 In this test all numbers are big (~1e9), so it can be precision errors/overflow. You should use NTT with big modulo to avoid doubles | | WA4 | tepamid | 1890. Деньги из воздуха | 24 май 2023 15:16 | 1 | WA4 tepamid 24 май 2023 15:16 | | to admins | Ade | | 23 май 2023 17:45 | 1 | The width of the last column of ranklist, "Last AC", is a little narrower than needed. The ranklist table always displayes abnormal. Please can you take a look? And so does the bottom ranklist table in the author page. | | The difference between VC++ and g++ | ... | 1521. Военные учения 2 | 21 май 2023 15:07 | 2 | Solved the problem using segment tree. Im using VC++ 12 and it's giving the correct answer for the sample. Still while sending (VC++ 2010) im getting WA 1. Changing it to G++ C++ 11 gives AC. What's the difference and why am i getting WA 1 when i choose VC++? Code: #include <iostream> #include <vector> using namespace std; const int MAXN=100000; pair<int, int> t[4*MAXN]; int z=1; void build_tree(int v, int tl, int tr) { if (tl==tr) { t[v]=make_pair(1,z++); return; } int tm=(tl+tr)/2; build_tree(2*v, tl, tm); build_tree(2*v+1, tm+1, tr); t[v].first=t[2*v].first+t[2*v+1].first; t[v].second=-1; } int req(int v, int tl, int tr, int n) { if (tl==tr) { --t[v].first; return t[v].second; } int tm=(tl+tr)/2; t[v].first--; if (t[2*v].first>=n) req(2*v, tl, tm, n); else req(2*v+1, tm+1,tr,n-t[2*v].first); } int main() { int n, k; cin>>n>>k; build_tree(1,1,100000); int cur=k; for (int i=0; i<n; ++i) { int h=req(1,1,100000, cur); cout<<h<<" "; if (i==n-1) break; cur=(cur-1+k)%(n-1-i); if (cur==0) cur+=n-1-i; } } Edited by author 10.03.2013 07:20 Not sure, but it could be because of this t[4*MAXN] instead of t[400000] | | condition | 👑TIMOFEY👑`~ | 1521. Военные учения 2 | 18 май 2023 11:59 | 2 | He donated all the money to the poor and went to bed with a clear conscience... Yeah, he correctly thought that people will forgive him, because it is charity | | WA 25 test | mmd18cury | 1354. Палиндром. Он же палиндром | 15 май 2023 21:51 | 1 | WpKRwvgKenn output shold be "WpKRwvgKenneKgvwRKpW" not "WpKRwvgKennneKgvwRKpW" | | To admins Код должен работать. Python. RE#1 | Klim Shramko | 1100. Таблица результатов | 13 май 2023 00:34 | 1 | Этот код работает везде, кроме как на этом сайте Runtime error test 1. Почему??? import sys array4 = dict() result = "" for i in sys.stdin.read().split("\n")[1:]: array4[str(i.split(" ")[0])] = str(i.split(" ")[1]) def QSort(arr3): if len(arr3) < 2: return arr3 else: privot, do3, sered, posle = int(arr3[list(arr3.keys())[0]]), dict(), dict(), dict() for x, i in arr3.items(): if int(i) > privot: do3[x] = i elif int(i) < privot: posle[x] = i else: sered[x] = i return {**QSort(do3), **sered, **QSort(posle)} for t, y in QSort(array4).items(): result += f"{t} {y}\n" print(result.strip('\n')) | | ac | bezdarcpp | 1931. Отличная команда | 12 май 2023 16:08 | 1 | ac bezdarcpp 12 май 2023 16:08 # include <bits/stdc++.h> using namespace std; using ll = long long; #define vec vector #define int long long #define ld long double #define f first #define s second #define pb push_back #define fe(x, a) for (auto& x : a) #define pw(x) (1ll << x) #define sz(x) (int)x.size() #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() using pii = pair<int, int>; const int mod = 1e9 + 7; const ll OO = 1e16; const int N = 1e5 + 2; const ld eps = 1e-3; template<typename T> bool umn(T &a, T b) { return a > b ? (a = b, 1) : 0; } template<typename T> bool umx(T &a, T b) { return a < b ? (a = b, 1) : 0; } void solve() { int n, best = -1, ans = 0; cin >> n; set<pii> setik; for (int i = 0, x; i < n + 1; ++i) { x = -OO; if (i < n) cin >> x; if (i && x < (*setik.begin()).f) if (umx(best, i - (*setik.begin()).s - !(*setik.begin()).s)) ans = (*setik.begin()).s; setik.insert({x, i}); } cout << ans + 1; } int32_t main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int t = 1; // cin >> t; while (t--) solve(); } | | Universal test for any WA, including WA6 | mmd18cury | 1709. Пингвин-Авиа | 12 май 2023 13:54 | 2 | Input: 9 16372 24788 000010111 001111101 010010001 010011001 111100101 010100100 110011000 100000000 111110000 Possible answer (a's should be the same, d's can differ in you answer): 163720 000000000 000000d0d 0000d000d 0000dd00d 00dd00d0d 000d00d00 0d00dd000 000000000 0dddd0000 Matrix for the graph in the answer: 000010111 001111000 010000000 010000000 110000000 010000000 100000000 100000000 100000000 Edited by author 12.05.2023 13:49 Use this site to visualise the graph using matrix and firstly change enumeration from 1,2,3... to 0,1,2... : https://graphonline.ru/# Edited by author 12.05.2023 13:55 Edited by author 12.05.2023 13:55 | | Possible mistakes causing WA6 and others | mmd18cury | 1709. Пингвин-Авиа | 12 май 2023 13:53 | 1 | If you have a mistake, most likely you delete connections of the input graph in a wrong way. And most likely, because you search the connected components incorrectly. | | Tests | Igor Parfenov | 1633. О гиппогрифах | 10 май 2023 00:23 | 1 | Tests Igor Parfenov 10 май 2023 00:23 If you are solving using formula, there are some corner cases. IN 0 0 0 0 OUT 0 IN 17 0 0 17 OUT 17 And just some random test. IN 7 9 6 8 OUT 15.165177459575631 | | WA#12???? | zhangjx | 1257. Переносы | 8 май 2023 12:07 | 3 | Who can tell me………… Why got WA#12? if you have to cut a word, the word must end with string1+string2 (without '-'). Therefore I used: String h=word.toUpperCase(); String s=(string1+string2).toUpperCase(); if (h.endsWith(s)){ int z=h.lastIndexOf(s) //<-- !!! ... This helped me (in Java) to avoid WA#12. Following test helped me to pass test #12: 0 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa. | | не понимаю почему cin не считывает строку | Aho | 2138. Хороший, плохой, злой | 5 май 2023 00:20 | 1 | #include <iostream> int main() { long long int y1; int y2, y3, y4; std::cin; std::cin >> y1; y4 = y1 / 16777216; y1 = y1 % 16777216; y3 = y1 / 65536; y1 = y1 % 65536; y2 = y1 / 256; y1 = y1 % 256; y1 = y1 * 16777216 + y2 * 65536 + y3 * 256 + y4; std::cout << y1; return 0; } в данном коде есть проблема: в данном компиляторе первый cin ничего не делает и второй получает на вход строку. |
|
|