| Show all threads Hide all threads Show all messages Hide all messages |
| WA 7, WHY? | Najmaddin Akhundov | 1017. Staircases | 28 Nov 2014 12:14 | 1 |
|
| Нечётная стоимость | LDV Soft | 2015. Zhenya moves from the dormitory | 28 Nov 2014 01:41 | 3 |
Если двухкомнатная квартира стоит нечётную стоимость, как делится её цена? As like as for even cost. Если была стоимость 5, то каждый платит по 2,5. Если бы делилось как четное, то будет WA18 - проверено. Так что считайте, что могут не целые числа. Edited by author 28.11.2014 01:41 Edited by author 28.11.2014 01:41 |
| a test case for WA#4 | jieshuzheng | 1684. Jack's Last Word | 27 Nov 2014 22:11 | 2 |
ababa ababab if you use kmp, you should pay attention when your index for the first word round up. It takes hours to find the problem. As to me, the problem was with special symbols. In this test end of the first line was defined by two symbols (like Windows style: 10 and 13). |
| How to deal with this problem? | pyh119 | 1004. Sightseeing Trip | 27 Nov 2014 11:43 | 7 |
I can not solve it,please tell me how to solve it,thank you!^_^ You can do this for all edges: 1 - delete edge 2 - find shortest way (Deikstra) between 2 vertex, which are connetcted with this edge 3 - insert edge This solution (O(N^4))pass time limits P.S. It may done in N^3 with Deikstra for each vertex I don't know how to do this :( Is there anything to do with Hamiltonian circuit ? Hamiltonian circuit for n=100 ?!?!?! We will die before your program will give us an answer :O Well... it's not always true that Hamiltonian related problems are NP completed. You can always use some heuristics that will reduce it to polynomial time... so don't be so marked ^^ |
| WRONG at test #5 | cublisan | 1332. Genie Bomber | 26 Nov 2014 21:32 | 3 |
Does anyone know test no. 5? Are there any tricks? Pls HELP me!!! Radius of the bomb can be less than radius of the town. Edited by author 05.04.2006 23:10 Edited by author 05.04.2006 23:10 |
| WA5( | Sonechko | 2023. Donald is a postman | 26 Nov 2014 19:59 | 1 |
WA5( Sonechko 26 Nov 2014 19:59 Подскажите какие могут быть ошибки Please help me Edited by author 26.11.2014 19:59 Edited by author 26.11.2014 19:59 Edited by author 13.01.2015 16:12 |
| how do i submit in python | Light | 1000. A+B Problem | 26 Nov 2014 14:29 | 2 |
a = input() b = input() a = int(a) b = int(b) c = a+b print c
this should be correct isn't it ? It is correct in Python 2, though explicit cast is excessive. In Python 3, use should add brackets after 'print'. |
| why Runtime Error? | Kayzer | 1197. Lonesome Knight | 26 Nov 2014 00:07 | 1 |
import java.io.IOException; import java.util.Scanner; public class chess { static Scanner scn = new Scanner(System.in); public static void main(String args[]) throws IOException{ int n=scn.nextInt(); int[] g = new int[n]; for (int i=0; i<n; i++){ g[i]=game(i);
} System.out.println(""); for (int i=0; i<n; i++){ System.out.println(g[i]);
} } private static int game(int q) throws IOException{ int b = 0, c, f=0; b=count(b); c=scn.nextInt(); if (b-1>0 && c-2>0 && b-1<=8 && c-2<=8) f++; if (b+1>0 && c+2>0 && b-1<=8 && c-2<=8) f++; if (b+1>0 && c+2>0 && b+1<=8 && c+2<=8) f++; if (b-1>0 && c-2>0 && b+1<=8 && c+2<=8) f++; if (c+1>0 && b-2>0 && c+1<=8 && b-2<=8) f++; if (c-1>0 && b+2>0 && c-1<=8 && b+2<=8) f++; if (c+1>0 && b-2>0 && c-1<=8 && b+2<=8) f++; if (c-1>0 && b+2>0 && c+1<=8 && b-2<=8) f++; return f;
} private static int count(int x) throws IOException{ char cd; cd = (char) System.in.read(); if (cd=='a') x=1; if (cd=='b') x=2; if (cd=='c') x=3; if (cd=='d') x=4; if (cd=='e') x=5; if (cd=='f') x=6; if (cd=='g') x=7; if (cd=='h') x=8; return x;
} } |
| Done...!!! | Bahodir _ TUIT | 1110. Power | 25 Nov 2014 19:29 | 1 |
done... Edited by author 30.11.2014 01:32 Edited by author 30.11.2014 01:32 |
| Some Hint : | Adhambek | 1523. K-inversions | 25 Nov 2014 16:53 | 1 |
you can use Fenwick tree It's more useful. Edited by author 25.11.2014 17:00 |
| primeri | jjsdjfsdjfks | 1397. Points Game | 25 Nov 2014 16:00 | 1 |
primeri jjsdjfsdjfks 25 Nov 2014 16:00 plz daite neskolko primerov |
| WA 4 | Sunnat | 2041. Nanomatryoshkas | 25 Nov 2014 15:43 | 6 |
WA 4 Sunnat 15 Nov 2014 15:54 I can't understand my mistake. If you have any test give me please!!!. Re: WA 4 olpetOdessaONU [1 2/3] 15 Nov 2014 20:04 Try one of these tests. I'm sure, your program gets 'No' on exactly one of them: 6 4 4 4 4 2 4 1 5 3 3 3 3 6 2 4 2 2 2 2 3 3 3 3 1 5 answer: 6 4 4 4 4 2 4 1 5 3 3 3 3 Yes 1 4 2 5 3 6 6 2 4 2 2 2 2 3 3 3 3 1 5 Yes 4 1 5 2 6 3 Re: WA 4 olpetOdessaONU [1 2/3] 17 Nov 2014 14:16 Do you use some greedy strategy? #include <algorithm> #include <stdio.h> #include <set> using namespace std; #define _1 first #define _2 second #define mk make_pair typedef pair<int, int> PII; typedef pair<int, PII> PIII; bool cmp(PIII a, PIII b){ return a._2._1 != b._2._1 ? a._2._1 > b._2._1 : a._1 > b._1; } const int maxn = 100005; PIII a[maxn]; PII b[maxn]; int res[maxn], endres; int main(){ int n,q; set<PII>myset; scanf("%i",&n); endres = n - 1; for(int i = 0; i < n; i ++){ scanf("%i %i",&a[i]._1, &a[i]._2._1); a[i]._2._2 = i + 1; } sort(a,a + n, cmp); res[endres] = a[n - 1]._2._2; b[endres] = mk(a[n - 1]._1, a[n - 1]._2._1); endres --; for(int i = n - 2; i >= 0; i --){ if(!myset.empty()){ set<PII> :: iterator it; it = myset.lower_bound(mk(a[i]._1, 1000001)); while(it != myset.end() && (*it)._1 == a[i]._1) it --; if(it != myset.end()){ PII pr = *it; //printf("%i\n", (*it1).second) res[pr._2] = a[i].second.second; b[pr._2] = mk(a[i]._1, a[i]._2._1); myset.erase(it); continue; } } if(res[endres + 1] == 0 || b[endres + 1]._1 != a[i]._2._1){ res[endres] = a[i]._2._2; b[endres] = mk(a[i]._1,a[i]._2._1); }else { myset.insert(mk(a[i]._2._1, endres)); endres --; res[endres] = a[i]._2._2; b[endres] = mk(a[i]._1,a[i]._2._1); } endres --; } if(myset.empty()){ puts("Yes"); for(int i = 0; i < n; i ++) printf("%i ",res[i]); } else puts("No"); return 0; } can you give me any test for this code. I have got WA# 4 5 2 2 2 2 3 3 3 3 1 4 Your answer: No Correct answer: Yes, 3 1 5 4 2 |
| About test #5 | TheEnglishMajor | 1316. Electronic Auction | 25 Nov 2014 09:09 | 2 |
Could someone tell me how to input double fast in C++ ? scanf is not fast enough Edited by author 25.11.2014 08:55 |
| Why the answer is 17? | dalex | 1826. Minefield | 25 Nov 2014 01:34 | 12 |
10+1 + 5+1 + 2 = 19. And there is no other way So what happens with the person with time 2? How is that possible? M stands for mine detector. 1 2 5 10 M - empty 2 5 - 1 10 M (+10) 1 2 5 M - 10 (+1) 2 - 1 5 10 M (+5) 1 2 M - 5 10 (+1) empty - 1 2 5 10 (+2) 10 + 1 + 5 + 1 + 2 = 19 Which is 19, not 17. That's why we are asking how can it be 17? 1 2 5 10 | --- = 0 5 10 | 1 2 = 2 1 5 10 | 2 = 3 1 | 5 10 2 = 13 1 2 | 5 10 = 15 --- | 1 2 5 10 = 17 |
| a tip | fangcun | 1924. Four Imps | 24 Nov 2014 18:58 | 1 |
a tip fangcun 24 Nov 2014 18:58 You can use DFS find the tips as this. [code deleted] Edited by moderator 19.11.2019 22:57 |
| WA9 | Victor Barinov (TNU) | 1271. Sailing Directions | 24 Nov 2014 07:29 | 1 |
WA9 Victor Barinov (TNU) 24 Nov 2014 07:29 Hi, I had wrong answer on test 9. Then I found an error and got the problem accepted. My test may be useful: 1000 1000 1 1 2 1 1 2 50 50 1 10 10 11 10 10 11 69.392 |
| Still could be solved by O(n^4) algorithm | Alexander Kouprin | 1004. Sightseeing Trip | 24 Nov 2014 00:14 | 2 |
0.343 sec. Just to let you know. ;) Heh, 0.35 sec... Mine is O(N^4) and 0.078 |
| Time limit exceeded 40 | kostan3 (kostan3@spaces.ru) | 1481. Winning Chances | 23 Nov 2014 22:37 | 1 |
|
| whats wrong? test # 9 | No one knows me | 1068. Sum | 22 Nov 2014 20:19 | 2 |
#include <stdio.h> #include <math.h> #include <iostream> #include <stdlib.h> using namespace std; int main() { long int range, total = 0; cin >> range; if ( range <= 0 && abs(range) < 10000 ) { for ( int x = 1; x >= range; --x ) total += x; cout << total << endl; } else if ( range > 0 && abs(range) < 10000 ) { for ( int x = 1; x <= range; ++x ) total += x; cout << total << endl; } return 0; } Edited by author 22.11.2014 20:22 |
| Why Time limit exceeded ?!! | Pooria | 1001. Reverse Root | 22 Nov 2014 20:08 | 1 |
#include <math.h> #include <iostream> using namespace std; int main() { double *a = new double[131073]; double temp; int i = 0; while (cin >> temp) a[i++] = sqrt(temp); while (i > 0) { printf("%.4f\n", a[--i]); } delete[] a; return 0; } |