He_XY's blog

By He_XY, 4 months ago, In English

skl2020 sent some 'unhealthy' photos on the blog

P.S. Don't click the first link if you don't want to see that. (doge)

Does this fit the CF regulation?

Anyway, I don't want to see any abnormal thing when I'm writing comments.

MikeMirzayanov Can you check that? Thank you very much.

UPD: It is said that his account is hacked. Sorry.

UPD2: Finally they were deleted! Congratulations to CF with a clean and wonderful website!

Full text and comments »

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

By He_XY, history, 4 months ago, In English

AtCoder Beginner Contest 367 is over. Problem B this time is very good.

It says: Give you a real number to the third decimal place. Delete the unnecessary zeros and '.' .

I saw many participants using string and .pop_back(), and other ways like this:

int main(){
	cin>>s;
	int n=s.size();
	if(s[n-1]=='0')
	{
		n--;
		if(s[n-1]=='0')
		{
			n--;
			if(s[n-1]=='0')
				n-=2;
		}
	}
	for(int i=0;i<n;i++) cout<<s[i];
	return 0;
}

but I found a simpler way:

Just input and then output (C++), because it can help you delete them.

Code:

#include<bits/stdc++.h>
using namespace std;
double a;
int main(){
	cin>>a;
	cout<<a<<endl;
	return 0;
}

This takes you less time in the contest.

Thank you for reading!

Full text and comments »

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