Environment Documentation
Click on the desired question type below to open the respective environment documentation.
- Multi-threading in all major languages is supported. CPU time would account for all thread's execution time in total to determine the execution time.
- There is a limit set on the size of the code submission, which is 50kB
Language | Version | Limits | Libraries | |
---|---|---|---|---|
Time (secs) | Memory (MB) |
|||
Ada |
GNU Ada compiler 4.9 |
3 | 512 | |
BASH |
Version 4.4.23 |
1 | 512 | |
C |
GCC 8.3.0, C11 standard |
2 | 512 | Newtonsoft json library |
C# | 3 | 512 |
Newtonsoft.Json@13.0.1, System.Reactive@5.0.0 |
|
C++ |
G++ 8.3.0, C++11 standard |
2 | 512 | Math library-lm json library |
C++14 |
G++ 8.3.0, C++14 standard |
2 | 512 | Math library-lm json library |
C++20 |
G++ 8.3.0, C++20 standard |
2 |
512 |
|
COBOL |
(OpenCOBOL) 2.2.0 |
3 | 512 | |
Coffeescript |
Node.js v14.15.4 |
10 |
1024 |
axios, babel-cli, babel-preset-latest, bignumber.js, jquery, lodash, request, typescript, underscore |
Common Lisp (SBCL) |
SBCL 1.4.2 |
12 | 512 | |
D |
Version 2.084.0 |
3 | 512 | |
DB2 |
DB2 v10.5.0.1 |
60 | 512 | |
Elixir |
Version 1.8.2 (compiled with Erlang/OTP 21) |
12 | 512 | |
Erlang |
Erlang/OTP 21 [erts-10.4.4] |
12 | 1024 |
Have your
function in module
|
F# |
F# Compiler for F# 4.1, Mono compiler v5.2 |
4 | 512 | |
Fortran |
GNU Fortran 5.5 |
5 | 512 | |
GNU Octave | Version 4.4.1 | 5 | 512 | |
Go |
1.13 |
4 | 1024 |
encoding/json, encoding/csv, encoding/xml, strings, math, container/heap, container/list |
Groovy |
v2.5.5 |
5 | 512 |
JVM: 1.8.0_121 point inside an object named
|
Haskell |
ghc 8.6.5, lts-14.7 |
5 | 512 |
base-prelude, logict, pipes, hashtables, random, text, vector, aeson, lens, lens-aeson, split, bytestring, array, arrow-list, regex-applicative, regex-base, regex-compat, regex-pcre-builtin, regex-posix, regex-tdfa, parsec, unordered-containers, attoparsec, comonad, deepseq, dlist, either, matrix, MemoTrie, threads, monad-memo, memoize, base-unicode-symbols, basic-prelude, bifunctors |
Java |
Sun Java 1.7.0_80 |
4 | 512 |
TestNG, JSON Simple, Tagsoup, Google/Gson, HTTPCore, HTTPClient, XMLResolver, Jing, JUnit, Hamcrest, Commons Lang3, Commons Logging |
Java 8 |
Sun Java 1.8.0_191 |
4 | 512 |
TestNG, JSON Simple, Tagsoup, Google/Gson, HTTPCore, HTTPClient, XMLResolver, Jing, JUnit, Hamcrest, Commons Lang3, Commons Logging |
Java 15 |
OpenJDK 15.0.2 |
4 | 512 |
TestNG, JSON Simple, Tagsoup, Google/Gson, HTTPCore, HTTPClient, XMLResolver, Jing, JUnit, Hamcrest, Commons Lang3, Commons Logging, JavaFX Base |
Javascript |
node.js v18.6.0 |
512 |
axios@0.27.2, babel-cli@6.26.0, babel-preset-latest@6.24.1, bignumber.js@9.1.0, coffeescript@2.7.0, jquery@3.6.1, loadash@4.17.21, request@2.88.2, typescript@4.8.3, underscore@1.13.4 |
|
Julia |
Version 1.2.0 |
10 | 512 | |
Kotlin |
Kotlin 1.3.11 |
4 | 512 |
|
LOLCODE |
Version 1.2 with lci v0.10.5 |
5 | 512 | |
Lua |
Lua 5.3.3 |
12 | 512 | |
Microsoft SQL |
Microsoft SQL Server 2019 - 15.0.4023.6 (X64) |
60 | 2048 | |
MySQL |
Version 8.0.20 |
60 | 3072 | |
Nim |
Version 0.20.2 |
5 | 512 | |
Objective-C |
Apple LLVM version 9.1.0, Target SDK: MacOSX10.13 |
2 | 512 |
Foundation Framework |
OCaml |
ocamlopt, version 4.09 |
3 | 512 |
Jane Street OCaml core libraries |
ORACLE (PL/SQL Supported) |
11g Express, Release 11.2.0.2.0 - 64bit |
60 | 3072 | |
PASCAL |
Version 3.0.4 |
2 | 512 | |
Perl |
Perl (v5.26.3) |
9 | 512 |
JSON::XS, XML::Parser, Set::Scalar, Math::SparseVector & Math::SparseMatrix |
PHP |
PHP 7.3.13 |
9 | 512 | |
PostgreSQL |
Version 14.3 |
60 |
2048 |
|
PyPy |
PyPy2.7 v6.0.0 |
4 | 512 | |
PyPy 3 |
PyPy3.6 v6.0.0 |
4 | 512 | requests[security], beautifulsoup4 |
Python |
Python 2.7.15 |
10 | 512 |
requests[security], beautifulsoup4, pycrypto, cryptography |
Python 3 |
Python 3.9.4 |
10 | 512 |
requests[security], beautifulsoup4, pycrypto, cryptography |
R |
Version 3.6.1 |
10 | 512 |
foreach, base64enc, bayesm, Formula, class, g.data, cluster, numDeriv, scales, codetools, permute, date, spatial, psy, digest, pwt, statmod, stringr, iterators, lattice, latticeExtra, timeDate, evaluate, tseries, fastcluster, fBasics, XML, Matrix, rjson, zoo, car, plyr, sqldf, dplyr, lubridate, randomForest, survival, data.table, parallel, xts, neuralnet, e1071, caret, deepnet, tm, bit64, glmnet, forecast, reshape2, xgboost, readr |
RACKET |
Version 7.2 |
10 | 512 | |
Ruby |
Ruby 2.6.4p104 |
10 | 512 | xml-simple, http, faraday, rest-client, httpclient, httparty |
RUST |
Version 1.59.0 |
5 | 512 |
num, serde, serde_json, serde_derive, rustc-serialize, regex, time, text_io, rand |
Scala |
scala 2.13.4 |
7 | 512 |
Have your entry point inside an object named typelevel/cats |
Smalltalk |
GNU Smalltalk 3.2.5 |
5 | 512 | |
SWIFT |
Swift v5.5.1 |
2 | 512 | Foundation Framework |
Tcl |
Version 8.6 with tclsh |
5 | 512 | |
Text |
|
|||
TypeScript |
node.js v14.15.4 |
10 |
1536 |
readline, @types/node, @babel/preset-typescript, @types/jquery, @types/lodash, @types/request, @types/underscore |
VB.NET |
Mono compiler v6.4.0.198, .NET Framework 4.7.2 |
5 | 512 | |
Verilog |
Icarus Verilog 11.0 |
4 |
512 | |
Whitespace |
|
|||
Brainf**k | bf |
- Submission is run on an Ubuntu (LTS) instance, including zip, rar, unrar, vim, iputils-ping, net-tools (netstat, ifconfig) as default packages.
Question Type | Language | Os Version | Environment Includes | Additional Libraries/ Utilities |
Front end / Full Stack | AngularJS | Ubuntu 20.04 / Ubuntu 16.04* |
AngularJS 12.2.x, NodeJS v14.17.4, npm v6.14.14, yarn v1.22.11 *AngularJS 4.x.x , NodeJS v8.15.1, npm v6.4.1
|
Microsoft Typescript Language Server |
Front end / Full Stack | ReactJS | Ubuntu 20.04 / Ubuntu 16.04* |
ReactJS 17.0.x, NodeJS v14.17.4, npm v6.14.14, yarn v1.22.11 *ReactJS 16.2.x, NodeJS v8.15.1, npm v6.4.1 |
|
Front end / Back end / Full Stack | NodeJS | Ubuntu 20.04 / Ubuntu 16.04* |
NodeJS v14.17.4, npm v6.14.14, yarn v1.22.11 *NodeJS v8.15.1, npm v6.4.1 |
|
Back end / Full Stack | Django | Ubuntu 20.04 / Ubuntu 16.04* |
Python 3.8.10, Django 4, Django > 2.2.8** *Python 3.5.2, Python 2.7.1, Django 1.11.5 |
Pip/pip 3 Pipenv/pip |
Back end / Full Stack |
Ruby on Rails |
Ubuntu 16.04 |
Ruby 2.4.4 Bundler 2.0.2 |
|
Back end / Full Stack |
Java Spring Boot |
Ubuntu 16.04 |
Java 8 with Java-1.8.0-openjdk-amd64 Maven v3.3.9 Apache Tomcat v8.0.24 |
|
Back end / Full Stack |
Java 17 with Maven |
Ubuntu 20.04 |
Java 17 with Java-17.0.2-openjdk-linux-x64 Maven v3.8.4 Apache Tomcat v9.0.58 |
|
Back end / Full Stack |
Java 17 with Gradle |
Ubuntu 20.04 |
Java 17 with Java-17.0.2-openjdk-linux-x64 Gradle v7.3.3 Apache Tomcat v9.0.58 |
|
Back end / Full Stack |
.NET |
Ubuntu 16.04 |
.NET Core 3.0.101 |
|
Back end / Full Stack |
C++ |
Ubuntu 16.04 |
GCC-9.3.0 and Clang-11 with CMake v3.20 JsonCpp v1.9.4 Boost v1.75 |
|
Back end / Full Stack |
PHP |
Ubuntu 20.04 |
PHP v7.4 Apache v2.4 Composer v2.1 |
|
Back end / Full Stack |
PHP CodeIgniter |
Ubuntu 20.04 |
PHP v7.4 Apache v2.4 Composer v2.1 |
|
Back end / Full Stack |
PHP Laravel |
Ubuntu 20.04 |
PHP v7.4 Apache v2.4 Composer v2.1 |
|
Back end / Full Stack |
PHP Symfony |
Ubuntu 20.04 |
PHP v7.4 Apache v2.4 Composer v2.1 Symfony CLI v4.26 |
|
Custom |
Ubuntu 16.04 |
|||
Data Science |
Jupyter Notebook |
Ubuntu 22.04 LTS |
Python 3.9.12 R 4.1.3 Julia 1.7.3 |
|
Cloud Skills (Sudorank) |
|
|
Choice of OS includes: Ubuntu Linux 14.04/18.04 RHEL 7/8 |
|
- * supported for older questions.
-
** backward compatible
Sample Problem Statement
Here are some sample problem statements.
Given an integer N, print 'hello world' N times.
Sample Input
5
Sample Output
hello world
hello world
hello world
hello world
hello world
Solutions by language
#include <stdio.h>
int main() {
int i, n;
scanf("%d", &n);
for (i=0; i<n; i++) {
printf("hello world\n");
}
return 0;
}
#include <iostream>
using namespace std;
int main() {
int i, n;
cin >> n;
for (i=0; i<n; i++) {
cout << "hello world\n";
}
return 0;
}
using System;
namespace Solution {
class Solution {
static void Main(string[] args) {
var line1 = System.Console.ReadLine().Trim();
var N = Int32.Parse(line1);
for (var i = 0; i < N; i++) {
System.Console.WriteLine("hello world");
}
}
}
}
import java.io.*;
public class Solution {
public static void main(String args[] ) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
int N = Integer.parseInt(line);
for (int i = 0; i < N; i++) {
System.out.println("hello world");
}
}
}
#import<Foundation/Foundation.h>
int main(int argc, const char* argv[])
{
@autoreleasepool {
NSInteger n;
scanf("%lu", &n);
for (NSInteger i = 0; i < n; i++) {
/*
* Do not use NSLog to print to stdout
*/
printf("hello world\n");
}
return 0;
}
}
function processData(input) {
var i;
for (i = 0; i < parseInt(input); i++) {
console.log("hello world");
}
}
process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function (input) {
_input += input;
});
process.stdin.on("end", function () {
processData(_input);
});
N = int(raw_input())
for i in xrange(N):
print "hello world"
N = gets
1.step(N.to_i, 1) { |i| print "hello world\n" }
<?php
fscanf(STDIN, "%d\n", $number);
for ( $i = 0; $i < $number; $i++) {
echo "hello world\n";
}
N = io.read ()
for i = 1, tonumber(N), 1 do
print("hello world")
end
(let ((n (parse-integer (read-line))))
(dotimes (i n)
(format t "hello world~%")))
-module(solution).
-export([main/0]).
main() ->
{ok, [Num]} = io:fread("", "~d"),
print_hello(Num).
print_hello(0) ->
0;
print_hello(N) ->
io:format("Hello World~n"),
print_hello(N - 1).
>/* Contributed by https://www.hackerrank.com/rciovati */
package main
import (
"fmt"
)
func main() {
times := readInt()
for i := 0; i < times; i++ {
fmt.Println("hello world")
}
}
func readInt() int {
var n int
_, err := fmt.Scanf("%d", &n)
if err != nil {
panic(err)
}
return n
}
/* Contributed by https://www.hackerrank.com/dmarjenburgh */
(let [n (Integer/parseInt (read-line))]
(dotimes [_ n]
(println "hello world")))
f <- file("stdin")
on.exit(close(f))
T <- readLines(f)
T <- strsplit(T, " ")
Ti <- as.numeric(T[[1]])
for(i in 1:Ti){
write("hello world", stdout())
}
import Foundation
let n = Int(readLine()!)!
for i in 1...n {
print("hello world")
}
Writing State Information to a File
#include<stdio.h>
int main()
{
FILE *read;
FILE *write;
char *filename = "myfile.txt";
read = fopen( filename, "r" );
if( read == NULL )
{
//File doesn't exist. Have to write something
write = fopen( filename, "w" );
fprintf( write, "%s", "writesomethinghere" );
fclose( write );
}
else
{
//File exists. Read data from the file
char somedata[ 20 ];
fscanf( read, "%s", somedata );
printf( "%s", somedata );
fclose( read );
}
return 0;
}
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main()
{
ifstream readfile;
ofstream writefile;
string filename = "myfile.txt";
readfile.open( filename.c_str() );
if( readfile )
{
//I can read something from the file
readfile.close();
}
else
{
//The file doesn't exist
writefile.open( filename.c_str() );
//write something to the file
writefile << " write some data " << endl;
writefile.close();
}
return 0;
}
import java.io.*;
import java.lang.*;
public class Solution
{
public static void main( String[] args )
{
File fileName = new File( "myfile.txt" );
if( !fileName.exists() )
{
System.out.println( "this file doesn't exist " );
try
{
fileName.createNewFile();
FileWriter fileWrite = new FileWriter( fileName );
BufferedWriter bufferedWriter = new BufferedWriter( fileWrite );
//bufferedWriter.write( "write something here " );
bufferedWriter.close();
} catch ( IOException e )
{
//catch exception
}
}
else
{
//System.out.println( "this file exists " );
try
{
byte[] buffer = new byte[ 100 ];
FileInputStream inputStream = new FileInputStream( fileName );
int readLines = -1;
while( ( readLines = inputStream.read( buffer ) ) != -1 )
{
//System.out.println( new String( buffer ) );
}
inputStream.close();
} catch ( IOException e )
{
//catch exception
}
}
}
}
using System;
using System.IO;
public class Solution
{
public static void Main( )
{
string fileName = "myfile.txt";
FileStream file = new FileStream( fileName, FileMode.OpenOrCreate, FileAccess.Read );
StreamReader sr = new StreamReader( file );
string s = sr.ReadToEnd();
if( string.IsNullOrEmpty( s ) )
{
file.Close();
//The file is empty. Write something to it
//Console.WriteLine( "file doesn't exist " );
file = new FileStream( fileName, FileMode.OpenOrCreate, FileAccess.Write );
StreamWriter sw = new StreamWriter( file );
sw.Write( "Write something here " );
sw.Close();
}
else
{
//Console.WriteLine( s );
}
}
}
#!/usr/bin/python
filename = "myfile.txt"
with open( filename ) as f:
# file read can happen here
# print "file exists"
print f.readlines()
with open( filename, "w") as f:
# print "file write happening here"
f.write("write something here ")
#!/usr/bin/env ruby
filename = "myfile.txt"
if File.exist?( filename )
#puts "file read happening"
f = File.open(filename, 'r')
data = f.read
puts data
end
f = File.open(filename, 'a+')
#puts "file write happening"
f.puts "write something here"
<?php
$filename = "myfile.txt";
if(file_exists($filename)) {
$data = file_get_contents( $filename );
print $data;
$filewrite = fopen( $filename, 'a') or die('Cannot open file:'.$filename);
fwrite( $filewrite, "write something here");
fclose( $filewrite );
} else {
$filewrite = fopen( $filename, 'w') or die('Cannot open file:'.$filename);
fwrite( $filewrite, "write something here");
fclose( $filewrite );
}
?>
#!/usr/bin/env perl
$filename = "myfile.txt";
if( -e $filename )
{
unless(open FILE, $filename)
{
die "Cannot open file";
}
while(my $line = <FILE>)
{
print $line;
}
close FILE;
}
unless(open FILE, '>>'.$filename)
{
die "Cannot open file";
}
print FILE "Write something here";
close FILE;
Comments
0 comments
Article is closed for comments.