Would this be considered spam?
http://www.spoj.com/forum/viewtopic.php?f=29&t=10226&sid=bf9f53158ee5ed5cf707c135d986a0f9#p3267226
Co do testów, to ponieważ zadanie pochodzi z OI, możesz swój program sprawdzić na main.edu.pl: http://main.edu.pl/pl/archive/oi/15/pla6
Tam, dowiesz się więcej o tym, dlaczego Twój program niektórych testów nie przechodzi (masz poprawny, ale zbyt wolny algorytm).
A na przyszłość, przeczytaj sobie pkt. 15 regulaminu forum: http://pl.spoj.pl/forum/viewtopic.php?f=1&t=12148
when ever i submit my solution(in JAVA SE 6) it shows following error
2
/bin/bash: line 5: mkdir: command not found
/bin/bash: line 6: META-INF/MANIFEST.MF: No such file or directory
/bin/bash: line 7: META-INF/MANIFEST.MF: No such file or directory
/bin/bash: line 8: META-INF/MANIFEST.MF: No such file or directory
zip warning: name not matched: META-INF
zip error: Nothing to do! (try: zip -r tested.zip . -i META-INF)
can anyone tell me please!!
PFACT : Prime Factors https://www.spoj.com/problems/PFACT/1
I got tle in java while submitting this code , plz suggest me any optimization
My code is
class Main
{
public static void main (String[] args) throws java.lang.Exception
{
int[] arr=new int[100001];
for(int i=1;i<100001;i++)
{
arr[i]=-1;
}
for(int i=2;i<100001;i++)
{
if(arr[i]==-1)
{
for(int j=i;j<100001;j+=i)
{
if(arr[j]==-1)
arr[j]=i; }
}
}
for(int n=2;n<100001;n++)
{ int N=n ;
System.out.print(n+":");
while(n!=1){
System.out.print(arr[n]+" ");
n=n/arr[n];
}
System.out.println();
n=N;
}
}
}
Suggested Topics
Topic | Category | Replies | Views | Activity |
---|---|---|---|---|
PALIN - wrong answer | Online Judge System | 1 | 81 | Mar 23 |