Cod sursa(job #664180)

Utilizator alexalghisiAlghisi Alessandro Paolo alexalghisi Data 19 ianuarie 2012 19:24:40
Problema Mins Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 kb
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;

vector<double> v;

int main()
{
	int a,b;
	freopen("mins.in","r", stdin);
	freopen("mins.out","w", stdout);
	scanf("%d %d",&a,&b);
	
	if(a==1 || b==1) printf(0);
	else
	for(int i=1;i<a;i++)
		for(int j=1;j<b;j++)
		{
			// i=x ; j=y
			double panta=double(i)/double(j);
			bool ok=false;//nu este
			for(unsigned int k=0;k<v.size();k++)
			{
				if(v[k]==panta ){ ok=true; break; }
			}
			if(ok==false) v.push_back(panta);
		}
		
	printf("%d",v.size());
	return 0;
}