# | User | Rating |
---|---|---|
1 | jiangly | 3640 |
2 | Benq | 3593 |
3 | tourist | 3572 |
4 | orzdevinwang | 3561 |
5 | cnnfls_csy | 3539 |
6 | ecnerwala | 3534 |
7 | Radewoosh | 3532 |
8 | gyh20 | 3447 |
9 | Rebelz | 3409 |
10 | Geothermal | 3408 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 174 |
2 | awoo | 164 |
3 | adamant | 163 |
4 | TheScrasse | 159 |
5 | nor | 158 |
6 | maroonrk | 156 |
7 | -is-this-fft- | 151 |
8 | SecondThread | 147 |
9 | orz | 146 |
10 | pajenegod | 145 |
0
C was a pretty cool problem. Never seen anything like it, requires some thinking, yet not too difficult. Props! Why not just pick n=2000 for D, so it can be solved in Python? Now I had to go back and rewrite my solution in C++ for no particular reason, just because the Python implementation barely times out. I actually thought it was a very nice problem other than that annoying detail. |
0
Additionally, they should get posted to Kattis, although it may take a while. |
0
Thank you so much! It's very satisfying to get an answer to this, it's very unlikely I would have figured it out myself. Indeed I just have to change a single byte to get AC. |
+16
Do you happen to know some good CF exercises to practice this? |
0
I have now implemented this solution, in submission 87661047. It gives WA, but I cannot think of a counterexample (or my code may have a bug). I cannot get the killing test case out because the test case file gets truncated. Anyone have an idea? |
0
I had the following solution to Div1D. Unfortunately I did not manage to implement it correctly in time, but I am still curious if this is the correct approach. Div1D potential solution Repeat the following until one of the end conditions is reached:
Does this work? If not, what is a counterexample? |
+6
From the examples, it seems that within { A } apply { B } means: first apply A, then apply B, then apply the inverse (adjoint) of A. |
0
Oh, damn. I proved this too, but it was a lot of tedious calculation. I didn't think to compare columns. Obvious in retrospect. |
+10
In this particular case, you can replace R1 by Z itself. :-) |
0
That's it? I can't believe I didn't get that. :') I spent pretty long on that question, too. |
+18
It put a real damper on the contest for me as well. It made me perversely happy to see the top 50 fill up with people with 17-18 solutions, because it meant I could just give up on the ML questions without feeling like I'd given up early. Fingers crossed that next year won't contain problems like that. |
0
Oh! My problem was simply that I hadn't heard of custom invocation before. That's great actually -- I'll try out this workflow tomorrow before the contest, see if that works better for me. Thanks. |
+24
So does this replace the |
+6
I had the same issue here, maybe that helps? |
0
Thanks! |
0
|
0
In my current solutions file, these are the first three cells: Jupyter notebook contents
Running all three of these cells takes about 3 seconds. To hand in the code, I copy the content of the first cell into a text file, add the correct namespace, and change the name from |
+5
I write my code in a jupyter notebook, with testing code next to it. Once I want to submit I copy the code to a new text file and submit that. This workflow is terrible and I wouldn't recommend it to anyone. :^) |
0
Sure, but if I were programming in PyTorch and my parameters weren't updating I would know how to get the gradient I am using for the update and print some statistics (max, min, mean, variance) to see if the hyperparameters are the problem or there is just a bug in my code (or something wrong with my installation of the backend). Q# is still a little arcane to me. |
0
Ah, thank you. That seems to have worked. That gives me some confidence in the contest next weekend. |
0
This post contains spoilers for D1. Spoiler I'm stuck on getting the machine learning problems to work. From the correct submissions (and the comments on this post, before that) I realize the correct solution to D1 is to have a single PauliY gate, controlled on nothing, with a parameter of pi (and possibly some bias). If I try to run the example code from this website (in particular with the Python host file), and the only change I make is that I split the json file into training and validation data (because the code assumes that the json file contains both) then after running for a long time it just... reports the initial parameters it started with, with a gigantic miss rate (near 50%). If I change the
and I hardcode the correct value for the rotation in the Python file:
it runs much quicker, but it does not change the parameter at all, yet it reports, again, a nearly 50% miss rate. Additionally, sometimes when I run host.py I get a whole bunch of errors of the form
But whether or not I get these errors seems somewhat non-deterministic: it doesn't happen every time. What is going on? |
0
|
0
Interesting. I hadn't considered recursion in Q#. I'll take a look at your submission to the problem when the contest ends. |
0
Ah, thanks, this is good to know. I often run into more problems with the non-quantum part of Q# than the actual QC knowledge. |
0
Ah, right, I failed to mention this in my post but that's another approach I had considered. Since simulating N additional qubits incurs a factor 2^N (ish) overhead to fully simulate (or does it?) I was worried that it would likely cause my code to timeout. |
0
This post may contain some spoilers for B1 and/or B2. Question about the correct approach to B1/B2 I had some trouble solving B1/B2. I couldn't think of an easy linear approach, so eventually I settled on the "quadratic" approach, where I use O(N) controlled X gates with O(N) controls each. Because I used a variable-sized set of controls, the compiler wouldn't automatically generate an adjoint for me, and I had to write it myself. Of course, I had to do this anyway, because it's the other of the two problems, but it seems against the intent of the problem, since it specifically advises you that the adjoint will be automatically generated. After using this solution (it gets AC) I googled for a better approach. The only things I found seemed very complex, and not the sort of thing I would come up with in a contest setting. (More difficult than any of the other Q# problems on this site I've tackled.) Is my approach correct/intended? Is there an easier approach I missed? Is the correct solution just very difficult to come up with from scratch? |
+5
I had the same question as Svlad_Cjelli. Thank you for the answer! Is there an easily searchable repository of Q# examples yet? If I'd seen any piece of code actually using LittleEndian I think this would have been obvious, but I don't know where to look. I don't think the documentation helps. |
0
Non-trivial quantum computing, the type where you use entanglement non-trivially, starts in 8 (real) dimensions though. A couple fewer if you only look at unit vectors and normalize the global phase in some way, but still strictly more than 3. |
+16
A Python In this particular problem, the queue never gets very long. At worst there are about 50 elements in it. As a result, the slow list operation |
+1
This round, I did everything in Python 3 except E. Last round, Python 3 was too slow for A which really messed me up (I could have just translated it to C++, but I was too stubborn). If you don't know C++ yet, it never hurts to learn. But use the right tool for the right job: if time limits aren't tight, a package like itertools can save you a lot of programming time. |
0
I don't think that's true. In your example, the innermost "else" triggers on each *, at which point curr has value 1, so x is added to the total and curr is reset to 0. |
0
Might be the width of a double that differs between the compilers? Just a guess, though. |
0
I'm guessing the problem is that you're using an f-string: those are from the most recent versions of Python, and are not supported by older versions. Try a different way to format your output string, and it should get rid of the RTE verdict. Edit: My bad, this is not the issue, see comments below. (I had this problem myself with GCJ and assumed too quickly that it was probably the same issue.) |
0
A really cool problem set. Looking forward to more. Lightly upset about the contest being unrated -- I solved Div 1 ABC, think I probably would have solved D if I'd continued, and I'm only rated 19-something, so that would've been a big boost -- but it's just numbers. |
+3
Try the mirrors, they work for me more consistently. |
+14
Can we submit solutions in 1C even if we've already made the top 1500 in another round? I wanted to participate for fun. |
Name |
---|