We will explain in the following order:
C
C++
C#
Java
NodeJS, TypeScript
PHP
Python
Scala
Perl
Ruby
Go
Swift
Kotlin
Rust
[Important] Why you must follow these instructions
The execution environment connected from the Web Editor is different from the actual scoring environment.
If you install the library with instructions other than as described below, the library will be installed only in the execution environment to which the Web Editor browser session is connected, and not in the actual scoring environment.
Therefore, the library will not be installed at the time of scoring. In order to install the library in the scoring environment, please be sure to follow the instructions below.
How to install libraries
C
Additional libraries are not supported.
C++
Additional libraries are not supported.
C##
If you want to use external libraries, do the following:
Add dependencies in
MainApp.csproj
.You can also update
MainApp.csproj
file bydotnet add package
command.
Example
<ItemGroup>
<PackageReference Include="RestSharp" Version="106.13.0" />
</ItemGroup>
Java
If you want to use external libraries, do the following:
Add dependencies in
pom.xml
.
Example
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.9</version>
</dependency>
</dependencies>
NodeJS, TypeScript
If you want to use external libraries, do the following:
Add dependencies in
package.json
.
Example
"dependencies": {
"lodash": "4.17.15",
"underscore.string": "3.3.5"
}
PHP
If you want to use external libraries, do the following:
Add dependencies in
composer.json
.
Example
"require": {
"guzzlehttp/guzzle": "6.5.0",
"nesbot/carbon": "2.35.0"
}
Python
If you want to use external libraries, do the following:
Add dependencies in
requirements.txt
.
Example
numpy
requests
You can explicitly specify a library version as follows. If an error occurs when installing a library please try changing or not specifying a library version.
numpy==1.26.0
requests==2.22.0
Perl
If you want to use external libraries, do the following:
Add dependencies in
cpanfile
. Dependencies will be installed by using Carton.
Example
requires 'Plack', '1.0'; # 1.0 or newer
requires 'JSON', '>= 2.00, < 2.80';
recommends 'JSON::XS', '2.0';
conflicts 'JSON', '< 1.0';
on 'test' => sub {
requires 'Test::More', '>= 0.96, < 2.0';
recommends 'Test::TCP', '1.12';
};
on 'develop' => sub {
recommends 'Devel::NYTProf';
};
feature 'sqlite', 'SQLite support' => sub {
recommends 'DBD::SQLite';
};
Ruby
If you want to use external libraries, do the following:
Add dependencies in
Gemfile
.You can also use the
bundle add
command to install libraries.
Example
source 'https://rubygems.org'
# Write the library name and version to the following
gem 'diff-lcs', '1.4'
gem 'rspec', '3.9.0'
⚠️ [Caution]
Don't use the gem install
command to install libraries. That command doesn't update Gemfile
.
Go
If you want to use external libraries, do the following:
Add dependencies in
go.mod
.If you want to use the latest version of a library, you don't have to edit go.mod by yourself. Just adding an
import
statement tomain.go
is enough.
Example
require (
github.com/huandu/xstrings v1.3.2
github.com/shopspring/decimal v1.2.0
)
Swift
If you want to use external libraries, do the following:
Add dependencies in
build.gradle
.
Example
import PackageDescription
let package = Package(
name: "app",
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"),
],
targets: [
.target(
name: "app",
dependencies: ["NIO"]
)
]
)
Rust
If you want to use external libraries, do the following:
Add dependencies in
Cargo.toml
.
Example
serde = "1.0.113"
rand = "0.7.3"
[Caution] Using HTTP client libraries
You cannot compile libraries that depend on openssl
because OpenSSL is not installed in the Rust runtime environment. Some libraries can be compiled with features by using rustls
instead of openssl
. Here are examples shown below:
reqwest
reqwest = { version = "0.10", default-features = false, features = ["rustls-tls"] }
attohttp
attohttpc = { version = "0.13", default-features = false, features = ["tls-rustls"] }
FAQ
Library does not work.
It may not work due to an older version, etc. If external libraries are not added correctly, please make sure if the version is correct then change the version and retry it.
After specifying a version, the program is executed without specifying a version, but it does not return to the latest version.
You can revert to the latest version by reloading the page.