Tornad0's blog

By Tornad0, history, 8 years ago, In English

http://acm.uestc.edu.cn/#/problem/show/1296

please help on a graph problem, thanks! I dont know from where to think about it.

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Is there anyone play overwatch on codeforces? or Starcraft. Lets' play together before the next codeforces round :D

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Hello everyone, I am a student who like to take contests in codeforces. I usaully visit this site before.

However, from last month, I fall in love with a girl. So I have no time to visit codeforces:(((

How are you guys? Have you had a girlfriend like me? Wish you happy coding and high rating:)))) I will go out with her for dinner tonight.

PS: the following is my girlfriend:)))

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

I upgrated my windows 7 to windows 10. After a month, there is always internet connection problem on windows 10. anyone have the same issue? any solution? However I can't go back to windows7 now:( damn it win10

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Hi, today I learned Trie:D and I solved a easy problem. Here is my code on the problem

include

int const N = 1000002; int const BITS = 31;

int link[N * BITS][2]; int a[N], num[N * BITS];

int main() { int n, k; //read the cutest data:D scanf("%d%d", &n, &k); for(int i=1;i<=n;i++)scanf("%d",&a[i]); for (int i = 1; i <= n; i++) a[i] ^= a[i — 1]; int freak = 2; int root = 1; long long ans = 0; for (int i = 0; i <= n; i++) { int v = root; //get all that less than K :D for (int b = BITS — 1; b >= 0 && v > 0; b--) { int curAi = (a[i] >> b) & 1; int curK = (k >> b) & 1; if (curK == 1) { if (link[v][curAi] > 0) { ans += num[link[v][curAi]]; } } v = link[v][curAi ^ curK]; } v = root;

//insert a[i] to trie:D
for (int b = BITS - 1; b >= 0; b--) {
  num[v]++;
  int cur = (a[i] >> b) & 1;
  if (link[v][cur] == 0) {
    link[v][cur] = freak++;
  }
  v = link[v][cur];
}
num[v]++;

} //ans get those less than K:D printf("%I64d\n", (long long) n * (n + 1) / 2 — ans); }

That's all. **** I will be back:D

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Hello:D

Today I tried to create another account on codeforces (because I have too many downvote on this account, -100 now:D).

However I can't enter in captcha:( what a awful site:D Anyone know how to fix this problem? thanks:D

That's all, I will be back

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Hi all,

How to detect odd circle?

Edit:I find how to do it now:D downvote me if you are too stupid to solve this.

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Hi all, I have a problem when I want to do conjunction on a union without overflow. My problem is:

(1) let ans = empty

(2) for i from 1 to n do:

How to prove that

?

Edit: now I can prove it:D give me downvote if you are too stupid to solve this problem:D

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Announcement

Hi all, this time we don't have editorial for Codeforces Round #364 because the editorial was eaten.

That's all, wish you high rating.

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Announcement

Hi all, this time we don't have editorial for Codeforces Round #364 because the editorial was eaten.

That's all, wish you high rating.

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Hi all,

I have difficulty on a problem on codeforces http://codeforces.net/problemset/problem/691/D

my submission is : http://codeforces.net/contest/691/submission/19308291

I think my idea is right, I used dsu to group several numbers and downsort numbers inside the groups. But I don't know why I am still wrong answer at test21. The idea is simple, but I can't find what's wrong. Anyone please help me, thanks:D

How to find bugs when you think your algorithms and implementation is correct,BTW?

Edit: Bug found:)))

I should calculate p[i]=parent(i) before I use p[i] . I thought it was automatically done by merging, however it is not :DDDD

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

http://codeforces.net/problemset/problem/698/C

Hi codeforces, though read the tutorial, I still don't understand it. Please anyone explain how to solve it in detail?why we can look backwards? What is the idea?

Btw, what math should I know to understand it?(i can know the dp,bitmask)

Thank you:D

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Hi codeforces, I have a great idea:D

when I read others code in codeforces, I always meet some #define term:

#define pb push_back
#define ppb pop_back
#define FOR(i,a,b) for (int _n(b), i(a); i <= _n; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;i--)
#define all(c) (c).begin(), (c).end()

Can anyone please make a automatic translator to translate the original simplified code into it's full form? So that people who are not familiar with that can read the code more easily :D

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Hi, all

I have a problem wich may solved greedily.

Background: Here is a group G of a people, one maybe another's friend. How to select least number of people to be a leader of a subgroup, so that everyone in the group G has a friend as a leader?

Translate: find least number of radial-subgraph of a graph. By radial-subgraph, it means a subgraph which has at least one point which connects all the other point in the subgraph.

Thanks!

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Hi, all, I have a great assumption:

the total number of upvotes in codeforces is more than that of the downvotse in codeforce

Thank you:D

Full text and comments »

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

By Tornad0, 8 years ago, In English

Is it a good idea to use scala as a language to use in codeforces and why?

I find the language has its beauty of simplicity and fun, so I am wondering whether it is good enough for practice on codeforces. Thank you for your opinions!

(Btw, I really look forward anwsers from anyone who use or have treid scala in codeforces.) (Please don't downvote it if you think it is a silly question. I am just beginner of this language. Thanks)

Edit — to those who downvote me: You are just a bit of St, no thanks:)

Full text and comments »

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

By Tornad0, history, 8 years ago, In English

Hi all,

Is it a good idea to use scala as a language to use in codeforces and why?

I find the language has its beauty of simplicity and fun, so I am wondering whether it is good enough for practice on codeforces. Thank you for your opinions!

(Btw, I really look forward anwsers from anyone who use or have treid scala in codeforces.) (Please don't downvote it if you think it is a silly question. I am just beginner of this language. Thanks)

Edit — to those who downvote me: You are just a bit of S

Full text and comments »

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

By Tornad0, history, 9 years ago, In English

A problems are simple, and I tried to submit once without testing, but I always failed to accept at once. Sometimes I get stuck in very simple mistakes. I feel that programming is so hard because of those mistakes, so I even don't have confidence to think about harder problems with advanced algorithm. Any advice please? Maybe I should change from C to another language? (But sometimes I really enjoy graspping the idea of hard problems. There are so many difficulties and exceptions for me to communicate with my computer.)

Full text and comments »

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