KimJennie's blog

By KimJennie, history, 2 months ago, In English

Hello, Codeforces!

I was creating a problem and faced with one problem. The task is:

given n, print a, b, c, d > 1 such as a*b*c*d = n. In some cases, there are a lot of choices, how to consider all of them? For example, if n = 80, and my code prints 2*4*5*2, and user prints 10*2*2*2, my code with ncmp checker gives WA. How to fix it?

Read more »

 
 
 
 
  • Vote: I like it
  • +4
  • Vote: I do not like it

By KimJennie, history, 2 months ago, In English

Hello, Codeforces!

I want to copy one task from problemset to my mashup, not the whole contest. How can I do it?

Read more »

 
 
 
 
  • Vote: I like it
  • +1
  • Vote: I do not like it

By KimJennie, history, 2 months ago, In English

I have created mashup in gym and loaded task. But then I found mistake and fixed it in polygon and commited changes, but nothing changed in my problem in mashup. What should I do?

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By KimJennie, history, 2 months ago, In English

Hello, Codeforces!

Since I started learning digit dp, I want to solve problems for it. So, could you provide some tasks for using digit dp? Please, give me links of not so hard digit dp problems.

Thanks!

Read more »

 
 
 
 
  • Vote: I like it
  • +3
  • Vote: I do not like it

By KimJennie, history, 3 months ago, In English

Now, plenty of account photos are unavailable

Sorry for disturbing MikeMirzayanov, but maybe my post will be useful.

Read more »

 
 
 
 
  • Vote: I like it
  • +2
  • Vote: I do not like it

By KimJennie, history, 3 months ago, In English

Was trying to solve this https://codeforces.com/gym/101021/problem/1 but getting Idleness Limit Exceeded. Can you please help me? My code is here:

void solve(){
int n;
int l = 0, r = 1e6, m; cin >> n; string s;

while(l + 1 < r){
    m = (l+r)/2;      
    cout << m << endl;
    cin >> s;
    if(s == "<")
       l = m;
    else
       r = m;
}
cout << "! " << r << endl;

}

int main(){ int T = 1;

while(T--)
    solve();
return 0;

}

Read more »

 
 
 
 
  • Vote: I like it
  • -1
  • Vote: I do not like it

By KimJennie, history, 3 months ago, In English

Know, that there will be editorial, but can you pls help to solve this task from today's contest. Is the main idea bipartite graph?

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By KimJennie, history, 3 months ago, In English

Hello, Codeforces!

I have next task: given string s and t. And I have to find does s contains t, and if yes, I should print the first i that [i..i+t.size()-1] = t How can I do it? I counted hash from all t in variable(hsh += (t[i] - 'a' + 1) * ppow) and hash from s in array (h[i] = (s[i] - 'a' + 1) * p_pow[i]). So I run from 0 to s.size()-t.size() and count hash in [l;r] using formula h(s[l:r]) = (h[r]-h[l])/p^l. But when s = "ab" and i count hash where l = 0, r = 1, I got 62, not 63. Where is my mistake? Please help me

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By KimJennie, history, 3 months ago, In English

Hello, Codeforces!

I have to find MST with this algorithm, but got WA. Can you please help me? I would really appreciate that.

My submission: https://pastebin.com/P4nGmhRM Problem: https://codeforces.com/gym/100088/attachments It's in russian, but the idea is:

There are n cities. The mayor of city wants to build a roads, so you were able to visit one city from any another. And there are given n (x; y) coordinates, and you have to find minimum spanning tree. Obviously, in graph i and j (1 <= i,j <= n) are vertices, and the weight of edge is (x[i]-x[j])^2 + (y[i]-y[j])^2.

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By KimJennie, history, 3 months ago, In English

Hello, Codeforces!

I have created a task in Polygon, committed changes and added codeforces to users in "manage access"(and set "READ"). I have searched some info about it, and got that I have to become master to make it public. Are there any ways to publish my task?

Read more »

 
 
 
 
  • Vote: I like it
  • +3
  • Vote: I do not like it