Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

Comments
+19

The question probably would be anybody not facing this issue...

On ditolyCodeforces Round #511, 6 years ago
+3

You wrote if(i!=n); so it generates an extra space at the end of the second line.

Each input must be in the form of i n since node n will fall into one of the parts after erasing an edge. If i n exists multiple times, add nodes with smaller indices between them.

Hi, lewin. Can I ask a question on how to define the potential? It's still not very clear to me. My guess of the procedure is:

Let the potential to be f(k), p and q to be the numbers of followers for two selected startups. Then the difference of the potentials after a step is: [p * f(0) + f(q + 1) + q * f(0) + f(p + 1)] / 2 - f(p) - f(q)

And we want to the difference to be constant, so we can choose f(k) = 2k - 1. Is this similar to what you think?

Maybe the better way is to stop searching and write one by yourself...

You can use the codeforces API to do so, use contest.list to get the id of div.2 contests, problemset.problems to get the problem details. In case some problems are returned by div.1 ID instead of div. 2 ID in the second API, the data I collected might be helpful to you.

On EbraM96I'm having ads on CF ?, 7 years ago
+3

Yes, actually ISP hijacking is the most powerful reason for some websites to enable https.

On codeniousSave as PDF , 7 years ago
+1

If you want a PDF, I think Javascript is useful and more convenient in this case, try the following code in the console of the developer tool and save the page as PDF:

https://gist.github.com/TianyiChen/329edfd7c02327c2a0c9e1307816abb8

On kefaaIOI format in mashups, 7 years ago
0

Thanks for pointing that out. I read the documentation which said about the range 0-200. Maybe the documentation is not up to date or such restriction only applies in some cases.

On kefaaIOI format in mashups, 7 years ago
0

I have no idea on the scoreboard part.

On kefaaIOI format in mashups, 7 years ago
+15

So far as I know, partial score is possible as long as the checker provides a corresponding response.(and the mushup is in IOI mode)

Use quitp(_pc(SCORE),"OK"); in the checker with testlib.h included. (0<=SCORE<=200) and the score for a test will be 16+SCORE (according to my test). And the score for a problem will be the sum for all test cases.

On EbraM96I'm having ads on CF ?, 7 years ago
+3

Looks like these ads are placed by a network provider. Maybe you should contact your ISP to stop the ads.

When I tried to view the onsite results, I got an error says "You do not have view access to non-public contest".

Edit: It's available to me now.

If the issue is related to uninitialized st. That's a reasonable explanation. (I can't be sure since I failed to find doesn't imply g++ couldn't initialize it somewhere and the assembly is obtained under linux which may differ from what we have under windows.)

In the assembly level, consider st as a pointer, if it's uninitialized, the memset was called to an invalid address.

It seems g++ didn't initialize the variable st in the runtime error case. When compiling with a struct name, I can see:

st:
        .zero   3200160
n:
        .zero   4

at the bottom, so st is clearly initialized as expected, but without a struct name, there's no such thing, I cannot find where st is initialized. Also the address printed at runtime has large difference.

This is an unnamed class, not an anonymous one. See http://stackoverflow.com/a/14248127/4879303 for their differences. Unnamed classes are explicitly permitted in C++: A class-specifier whose class-head omits the class-head-name defines an unnamed class. (§ 9.0.1, P231, n4618). Note that class and struct are the same in C++, except for the default permission.

Would you please share the data for test 7 so others can try to reproduce this issue easier?

On approMiller Rabin Primality Test , 7 years ago
0

By big numbers, I meant the numbers that can't be directly handled using native types(such as long long). According to my understand, the wiki is talking about this kind of numbers. Usually they are split into parts and saved in an array. For example if base=100, x=1234. Then the array may be a[0]=34, a[1]=12.

Multiplying two big numbers in a naive way looks like:

const unsigned MAXN=100;
const long long base=10000;
unsigned lena,lenb,lenc;
long long a[MAXN],b[MAXN],c[MAXN];

for(unsigned i=0;i<lena;++i) {
	for(unsigned j=0;j<lenb;++j) {
		c[i+j]+=a[i]*a[j];
		c[i+j+1]+=c[i+j]/base;
		c[i+j]%=base;
	}
}
//update lenc

So the complexity is O(len2), which is . By using FFT, the complexity can be reduced to , result the in the wiki.

On approMiller Rabin Primality Test , 7 years ago
+1

The complexity of multiplying two big numbers in a naive way is square of the length of these numbers. So I think x ← x^2 mod n should be

Yes. Maybe my previous comment isn't clear. I meant generating different hash for an object in an execution is a bug. Hash collision, although only looks part of a string is weird, isn't a bug.

The issue isn't "different hash-codes for the same objects during one execution" which is a library bug. It's the same hash value for different objects, in other words, hash collision. The string "idcvexvhgtyyvplfr" and "idcvexvhgtyyvplfrl" generates the same hash value for the compiler you selected.

Since the standard doesn't specify the implementation of hash functions, the output is environment-dependent. Actually std::hash can even produce different hash values for the same input in different executions.(Since C++14)

If the checker uses testlib, then the source code used is available at GitHub.

Not 254==0, 254 is true.

if(can[0]==0)->if(can[0]^1)->if(254)

g++ assumes the value of bool is 0 or 1,if you look at the assemly you will find it is actually testing can[0]^1. Here, can[0] is 255 and 255^1=254, which is evaluated as true.

The above conclusion is based on default config of g++ on several Linux platforms(simplely g++ a.cpp -o a), result may change under different environment.

What's the compiler you've used?

For C++, it will try to access the corresponding memory which is undefined behavior. Maybe the code will work, maybe it will output something wrong, maybe it will crash.

On ascchrvalstrWhy did it happen?, 8 years ago
0

I resubmitted your solution in C++14 and got AC. It seems there was something wrong when judging your previous submission.

On BigBagCodeforces Round #373, 8 years ago
0

Forgot "If the answer is integer, do not print dot." in Div2.C until several minutes before the end of contest...

On dp_hunterJava vs C++, 8 years ago
0

so this difference can make you win or lose a problem during the contest.

I've heard that usually the author's Java solution is used as the criteria when determining the time limit. As a result, a proper Java solution should not fail without using some unfamiliar tricks.

On csacademyRound #10 + prizes, 8 years ago
+28

For Xor Closure, could someone please elaborate this sentence from editorial a bit more? We create a system of binary ecuations where each bit has an associated equation and each element in the input is a variable.

On P_NyagolovDeleting messages?, 8 years ago
0

For Chrome, click the page icon at the left of the address bar and edit the site permission. For other browsers, the process should be close to enabling JavaScript.

On P_NyagolovDeleting messages?, 8 years ago
+7

If you want to see all comments, temporarily disabling JavaScript is enough.

Maybe a function which allows users to paint colors on nodes and edges could be useful?

+5

This extent of difference is possible, at least on my machine (the result of running OP's program):

+5

Due to dynamic CPU frequency, server load or some other reasons, time required for processing the same data by identical program may varies. As a result, several runs of a program may result different time consumed.

Sorry for my bad English, hope this makes more sense.

+24

I guess it should just be difference between each runs. And codeforces caches your submission so if you submit one multiple times, it will return the same result.

On GlebsHPCodeforces Round #363, 8 years ago
0

Whether format about whitespaces matter depends on the checker of the problem. It's obvious that for this problem, the author needs to write a checker by himself.(The checker cannot just compare tokens like yes/no, integers or floating point numbers) And it tends to has less tolerance about wrong formatting.

Since you know each has its own advantages. Why do you want to use only one? My suggestion is to choose one which is more convenient based on the scenario.

Usually I prefer zero-based index. Because (at least for me) for(int i=0;i<n;++i) and sort(a,a+n) is more convenient than for(int i=1;i<=n;++i) and sort(a+1,a+1+n). At the same time, they are more consistent with the C++ style. But if a problem requires much use of one-based indices or I need a boundary/sentinel zero position, I would use one-based index.

If you must choose one, maybe you should use one-based index, since sometimes it would be pretty painful without the zero position.

BTW: you can use negative array index if it is really necessary (not a good idea for just to get the -1 position), to use that, you can write something like:

int _dp[2333],*dp=_dp+1111;
dp[-666]=1;

It seems the Compilation Error detail for Visual Basic (Mono 4.2.2.30) is not available.

This issue was asked before and said to be fixed in 3-4 days. http://codeforces.com/blog/entry/45869?#comment-304614

+5

Some old compilers do not recognize "%lld". In the past, using "%lld" on CodeForces would cause "Wrong Answer". But the compilers used by CF had been upgraded. And now (at least in the recent half year), I never encounter problems with "%lld".

Maybe test data from uDebug could be helpful?

Sorry but I still can't see the relationship between them. In my perspective, if the server administrators are evil, it's easy to modify the open source program and record the traffic. If they are not interested in users' data, even keeping the source code secret can't harm the security.

Since the users have no way to know what servers are running, the majority of security depends on the server administrators, rather than the server software.

I don't think open source means security since the servers can access information transmitted via HTTP and they aren't under your control.

Spending 10+ hours on a problem maybe sounds a bit extravagant. (Assuming the 1-2 days and 7-8 hours is for a problem) For myself, it usually means lacking of a problem solving pattern or I need to learn a related algorithm, not because thinking isn't enough.

Do you have a command of the knowledge required by solving the problem? If not, it would be better to refer to some related learning resources and solve some less comprehensive, easier problems first.

On PenguinTyping skill, 8 years ago
0
  1. I think you don't need to worry about typing speed unless you are really typing too slow or making too many mistakes.

  2. As mentioned above, we are not following an article but solving a problem. In my opinion, on codeforces, rushing some A, B problems would help more. For myself, I'm going to write a generator and some templates to accelerate.

  3. Have you heard of MinakoKojima who uses a lot of macros and templates and maybe is a good reference on improving coding speed?

int pi = Integer.parseInt(ii.nextToken()), ni;

throws java.util.NoSuchElementException, it seems you are not using correct input method.

PS: In your submission history, you can click the submission No. and see details about it, in this case, you can know the exception and the line throws it.