>
> is there no way we can deal with big numbers in c++?
>>
> yes the test case 1 can be run and it is giving correct output but when we 
submit the solution  we get runtime error?

*#include<iostream>*
*#include<cstdio>*
*#include<string>*
*#include<vector>*
*#include<algorithm>*
*#include<math.h>*
*using namespace std;*
*int main()*
*{*
* int t;*
* cin >> t;*
* for (int i = 0;i < t;i++)*
* {*
* long int n, l, d;*
* cin >> n >> l;*
* vector <long int> v;*
* vector <long int> x;*
* vector <long int> z;*
* vector <long int> r;*
* vector <char> w;*
* for (long int k = 2;k <= n;k++)*
* {*
* long int a = 0;*
* for (long int m = 2;m <= sqrt(k);m++)*
* {*
* if (k % m == 0)*
* {*
* ++a;*
* }*
* }*
* if (a == 0)*
* {*
* x.push_back(k);*
* }*
* }*
* d = 0;*
* for (long int j = 0;j < l;j++)*
* {*
* long int c;*
* cin >> c;*
* v.push_back(c);*
* if (j == 0)*
* {*
* for (unsigned long int b = 2;b < x.size();b++)*
* {*
* if (v[0] % x[b] == 0)*
* {*
* z.push_back(x[b]);*
* r.push_back(x[b]);*
* d = v[0] / x[b];*
* break;*
* }*
* }*
* }*
* else*
* {*
* z.push_back(d);*
* r.push_back(d);*
* d = v[j] / d;*
* }*

* }*
* z.push_back(d);*
* r.push_back(d);*
* sort(r.begin(), r.end());*
* r.erase(unique(r.begin(), r.end()), r.end());*
* for (unsigned long int f = 0;f < z.size();f++)*
* {*
* for (unsigned long int g = 0;g < r.size();g++)*
* {*
* if (z[f] == r[g])*
* {*
* w.push_back(char(g + 64));*
* }*
* }*
* }*
* cout << "Case #" << (i + 1) << ": ";*
* for (unsigned long int h = 0;h < w.size();h++)*
* {*
* cout << w[h];*
* }*
* cout << endl;*
* }*
*}*

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/5236eaf5-e30d-4568-9d9f-216a74eba40f%40googlegroups.com.

Reply via email to