introduction to online judges
TRANSCRIPT
![Page 1: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/1.jpg)
AUTOMATIC
EVALUATIONOF JAVA PROGRAM
THROUGH ONLINE JUDGE
![Page 2: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/2.jpg)
TABLE OF CONTENTS
l What is an Online Judge?l l Difference between User-oriented
programs and Online Judge oriented programs
l l Why do we need Ojs?l l Practices to considerl l MOSS (Massive Online Software
Similarity)l
![Page 3: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/3.jpg)
WHAT IS AN OJ? Online system
Compile and execute code
Test programs with pre-constructed data
![Page 4: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/4.jpg)
Offline User Oriented Program
import java.io.*;public class Add{
public static void main(String args[])throws IOExeception{
int a, b, sum;BufferedReader br=new
BufferedReader(new InputStreamReader(System.in));
System.out.println(“Enter first number:”);
a=Integer.parseInt(br.readLine());System.out.println(“Enter
second number:”);
b=Integer.parseInt(br.readLine());sum=a+b;
System.out.println(“Sum=“ +sum);}}
Online Judge Oriented Program
import java.io.*;public class Add{
public static void main(String args[])throws IOExeception{
int a, b, sum;BufferedReader br=new
BufferedReader(new InputStreamReader(System.in));a=Integer.parseInt(br.readLine()); b=Integer.parseInt(br.readLine());
sum=a+b;
System.out.println(sum);}}
|||||||||||||||||||||||||
![Page 5: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/5.jpg)
WHY DO WE NEED OJS? Test on multiple data Optimize code:
Time complexitySpace complexity
Large Input
![Page 6: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/6.jpg)
TIME COMPLEXITY Time limit Input Constraints
![Page 7: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/7.jpg)
![Page 8: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/8.jpg)
INSTEAD OF THIS
public static void main(String args[])throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str=new String();str=br.readLine();char c;for(int i=0; i<str.length(); i++){
c=str[i];System.out.println(c);
}
}
![Page 9: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/9.jpg)
WE USE THISpublic static void main(String args[])throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str=new String();str=br.readLine();char c;int len=str.length()for(int i=0; i<len; i++){
c=str[i];System.out.println(c);
}
}
![Page 10: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/10.jpg)
SPACE COMPLEXITY
Example 1
vs
Example2
![Page 11: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/11.jpg)
PRACTICES TO CONSIDER
Input Methods:Scanner << BufferedReader <<
BufferedInputStream Output Methods:
PrintWriter, PrintStream >> System.out.print
![Page 12: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/12.jpg)
Input and Output Format
** ** * ** * * ** * * * *
** ** * ** * * ** * * * *
Expected Output
Ouput by Your Code
![Page 13: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/13.jpg)
EXAMPLES SPOJ UVa TopCoder CodeForces CodeChef HackerRank HackerEarth
![Page 14: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/14.jpg)
CODECHEF
Class name - Main DO NOT PRINT (“Enter a number”)
![Page 15: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/15.jpg)
![Page 16: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/16.jpg)
![Page 17: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/17.jpg)
MOSS – THE BOSS
Plagiarism reporter Copy Case Different Variables
![Page 18: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/18.jpg)
ANY QUESTION
S?
![Page 19: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/19.jpg)
CONTACT US
MANSI JAIN (TE IT A):l [email protected]
KRUSHI GADA (TE IT A):l [email protected]
VRISHABH LAKHANI (TE IT B):l [email protected]
![Page 20: Introduction to online judges](https://reader036.vdocument.in/reader036/viewer/2022062523/58ee70901a28ab187d8b460b/html5/thumbnails/20.jpg)
THANK YOU