Yasuho_Hirose's blog

By Yasuho_Hirose, history, 19 months ago, In English

i'm doing this question: The equation x1 + x2 + ... + xk = n, where x1, x2, x3, ..., xk are positive integer variables satisfying the constraint: xi > = ci > 0. Given n, k,c1 ,c2 ,,…,ck, count the number of ways satisfy modulo MOD. ie: x1+x2+x3=7, c1=1, c2=2, c3=3, MOD=100, number of ways is 3. It's a normal question, i now it's is f(n-(k-sum_of_all(c))-1,n-1)%MOD but modular inverse (O(nlogn) solution) only satify when MOD is a prime number. And another O(n^2) solutions can't pass the time limit. Please give me hints or somethings, thank you senpai <3.

Full text and comments »

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

By Yasuho_Hirose, history, 21 month(s) ago, In English

I found this from main page: "We have been made aware that gmail has recently stopped accepting some emails from the USACO server -- e.g., for new accounts and password resets. If this issue is affecting you, please try adding [email protected] to your gmail contacts list. If you are still having issues, please notify the contest director, Brian Dean ([email protected]). If you have recently received an email from the USACO server such as a password reset email or an account creation email, consider starring it, so that gmail will hopefully treat USACO emails with better priority." So, how to create new USACO account?

Full text and comments »

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

By Yasuho_Hirose, history, 2 years ago, In English

give a string, count how many repeating substring in this string, in another words, count substring appear >=2 times, and characters of substring can overlap. n<=1e5 Example: aaaaa, answer is 4, substrings are: a,aa,aaa,aaaa. aabaab, answer is 5, substrings are: a,b,aa,ab,aab. I only can solve it with O(n^2) solution and of course, it gives TLE. How to solve it in < O(n^2) time complexity? You can submit in here: https://www.spoj.com/PTIT/submit/PTIT015J/

Full text and comments »

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

By Yasuho_Hirose, history, 2 years ago, In English

here is my solution: https://codeforces.com/contest/1624/submission/144304382 for this problem: https://codeforces.com/contest/1624/problem/E I think time complexity of this solution is O(n*m) is small enough, but why this still give TLE? Thanks you for read my shi* blog.

Full text and comments »

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