Giter VIP home page Giter VIP logo

blog's People

Contributors

refparo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

blog's Issues

hey

你的doc是不是写的太复杂了。。。

嘛总之这是在催更啦w

Project Euler Problem 5 Smallest multiple

#include<iostream>
//Project Euler No.5
using namespace std;
int pf[21];//Prime factor
void prime(int ii) {
	if(ii==1)return;
	if(ii==2) {
		pf[2]++;
		return;
	}
	int i,j, fac=0;
	j = 2;
	i=ii;
	for(int m=2; m<=i; m++) {
		fac=0;
		while(i!=m) {
			if(i%m==0) {
				fac++;
				i/=m;
			} else break;
		}
		if(pf[m]<fac)pf[m]=fac;
		//if(i==m)pf[m]++;
	}
	fac++;
	if(pf[i]<fac)pf[i]=fac;
	return;
}
int main() {
	for (int i = 1; i <= 20; i++) prime(i);
	long long data = 1;
	for (int i = 0; i < 20; i++)
		while(pf[i]>0) {
			pf[i]--;
			data*=i;
		}
	cout << data;
	return 0;
}

Some person life exp.

Hi pr. I've read your solution to TCOC003.
Honestly, this program's complexity is too high...wwww It's needless to argue that using struct. is a kind of waste wwwwwwww
Oh, the way u use the sort function is ugly..The comparing function needs independence! (XD) U may make it a individual func.
The loop u write is Eye-breakive233
I think the cpp code u write is based on func. idea......
In the other hand, scala ver. is much betterrrr wwwwwwww
Just some small contribution, thank everyone-

Hello?

Why you are trying to solve a problem with three languages but not three algorithm?
The most program languages are the same!
Variables, Functions and Expressions are much the same.
If you going to learn Python or JavaScript and so on, how difficult will it be?
我干嘛要用英语
我在说什么

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.