source_code stringlengths 26 62k | lang_cluster stringclasses 11
values | src_uid stringlengths 32 32 | code_uid stringlengths 32 32 | difficulty int32 -1 3.5k ⌀ | exec_outcome stringclasses 1
value |
|---|---|---|---|---|---|
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static int findMax(int arr[],int a,int b) {
int max=0;
int idx=-1;
for(int i=a;i<=b;i++) {
if(arr[i]>max) {
max=arr[i];
idx=i;
}
}
return idx;
}
public static node buildTree(int arr[],int a,int b,int dep) {
if... | Java | a564017f9c411b39f8d4b69e629ae3bc | 0bc6a48b07a97dd554f7528bd664b001 | 1,200 | PASSED |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0) {
int n = sc.nextInt();
int[] a = new int[n];
for(int i = 0; i < n; i++) {
a[i] = sc.nextInt();
}
... | Java | a564017f9c411b39f8d4b69e629ae3bc | 7ff38032ec2d8f63dead0a2fccff3003 | 1,200 | PASSED |
import static java.lang.Math.*;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.StringTokenizer;
... | Java | a564017f9c411b39f8d4b69e629ae3bc | c44bd5cf57ce9cccda9e2b8c8dd9cef8 | 1,200 | PASSED |
import java.util.*;
import java.io.*;
import java.lang.*;
public class Main{
static HashMap<Integer,Integer>hash=new HashMap<>();
public static void recur(int arr[],int left,int right,int level)
{
if(left>right)
{
return;
}
int max=Integer.MIN_VALUE;
... | Java | a564017f9c411b39f8d4b69e629ae3bc | 93f05d9150f55ba16f37522d16902a04 | 1,200 | PASSED |
import java.util.Scanner;
public class D {
static Scanner sc;
static void kt(int a[],int d[],int i,int j,int s)
{
if(i>j)
return;
if(i==j)
{
d[i]=s+1;return;
}
int max=a[i],f=i;
for(int k=i;k<=j;k++)
{
... | Java | a564017f9c411b39f8d4b69e629ae3bc | 6f86938cdeec663d43d159907922925f | 1,200 | PASSED |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
private final static FastScanner sc= new FastScanner();
private static int t,n;
public static void main(String[] args) {
t= sc.nextInt();
... | Java | a564017f9c411b39f8d4b69e629ae3bc | 0fa4fac6327c5b6f288c5ca6a4b28991 | 1,200 | PASSED |
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debu... | Java | a564017f9c411b39f8d4b69e629ae3bc | 1e4a59b1b7b875b859c39c6cb2173c86 | 1,200 | PASSED |
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class D {
static int[] ary, depth;
static boolean[] v;
static StringBuilder sb;
static int l;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in... | Java | a564017f9c411b39f8d4b69e629ae3bc | b1b3c23352e020c1d6007636a3c34bc1 | 1,200 | PASSED |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
public class Permutacao {
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Scanner sc = new Scanner(System.in);
... | Java | a564017f9c411b39f8d4b69e629ae3bc | 9e991fbcc557d92d70a50cfa1f5e1e7f | 1,200 | PASSED |
import java.util.*;
public class JavaApplication126 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
long a[]=new long [10000];
for(int i =0;i<a.length;i++){
a[i]=(long) Math.pow(i+1,3);
}
int n =input.nextInt();
... | Java | b4ca6a5ee6307ab2bcdab2ea5dd5b2b3 | 887d9b63cda0ff49c5274e930b93e40d | 1,100 | PASSED |
import java.util.*;
public class JavaApplication126 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
long a[]=new long [10000];
for(int i =0;i<a.length;i++){
a[i]=(long) Math.pow(i+1,3);
}
int n =input.nextInt();
... | Java | b4ca6a5ee6307ab2bcdab2ea5dd5b2b3 | c7a365711863b9cf14b4813285a6e420 | 1,100 | PASSED |
import java.util.*;
public class cubes{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
long n=sc.nextLong();
long y=1;
long x=(long)Math.pow(n,1.0*1/3);
x+=2;
int p=0;
for(long i=1;i<x;i++){
long k=(long)Math.round(M... | Java | b4ca6a5ee6307ab2bcdab2ea5dd5b2b3 | 0f1d6e074b89a1c355a7cf59db42d33f | 1,100 | PASSED |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.StringTokeniz... | Java | b4ca6a5ee6307ab2bcdab2ea5dd5b2b3 | 889bd8564c1d24c62268385721894d81 | 1,100 | PASSED |
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] Args) {
Scanner sc = new Scanner(System.in);
var testcase = sc.nextInt();
var result = new String[testcase];
... | Java | b4ca6a5ee6307ab2bcdab2ea5dd5b2b3 | 7d0fdfddec9e6f776a36c88403e24bc3 | 1,100 | PASSED |
import java.util.*;
import java.io.*;
public class A2oj2 {
static FastReader sc;
static PrintWriter out;
static int mod = 1000000007;
public static void main(String[] args) throws IOException {
if (System.getProperty("ONLINE_JUDGE") == null) {
File f1 = new File("input.... | Java | b4ca6a5ee6307ab2bcdab2ea5dd5b2b3 | 17be92c97d5e1aaad6e5f380014a0544 | 1,100 | PASSED |
import java.util.Scanner;
public class C_SumOfCubes {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int t = in.nextInt();
var sum = new C_SumOfCubes();
for (int i = 0; i < t; i++) {
long x = in.nextLong();
System.out... | Java | b4ca6a5ee6307ab2bcdab2ea5dd5b2b3 | 56885643730221afa21a9218cb5223ac | 1,100 | PASSED |
import java.util.Scanner;
public class C_SumOfCubes {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int t = in.nextInt();
for (int i = 0; i < t; i++) {
long x = in.nextLong();
System.out.println(new C_SumOfCubes().solve(x));... | Java | b4ca6a5ee6307ab2bcdab2ea5dd5b2b3 | 042633924df8749888ecf1900ab932e4 | 1,100 | PASSED |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class Main {
private final static FastScanner sc= new FastScanner();
private static final Long mx= 1000000000001L;
... | Java | b4ca6a5ee6307ab2bcdab2ea5dd5b2b3 | 63a17c7fdd579f8e221515a906a6b41f | 1,100 | PASSED |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class Main {
private final static FastScanner sc= new FastScanner();
private static final Long mx= 1000000000000L;
... | Java | b4ca6a5ee6307ab2bcdab2ea5dd5b2b3 | 09d642920396fa83c27cda3b261aa8b0 | 1,100 | PASSED |
//@author->.....future_me......//
//..............Learning.........//
/*Compete against yourself*/
import java.util.*;
import java.io.*;
import java.lang.*;
public class B {
static FastReader sc = new FastReader();
static PrintWriter out = new PrintWriter(System.out);
public static void main(Stri... | Java | e0de8a6441614d1e41a53223b5fa576b | 43f7b4c65692fc773ef06d97d8db5470 | 1,000 | PASSED |
//@author->.....future_me......//
//..............Learning.........//
/*Compete against yourself*/
import java.util.*;
import java.io.*;
import java.lang.*;
public class B {
static FastReader sc = new FastReader();
static PrintWriter out = new PrintWriter(System.out);
public static void main(Stri... | Java | e0de8a6441614d1e41a53223b5fa576b | 6409b318826f3ccfe64e870d23292586 | 1,000 | PASSED |
import java.io.DataInputStream;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.*;
public class CodeChef {
public static void main(final String[] args) throws IOException {
int t = console.nextInt();
StringBuilder sb = new StringBuilder();
while (... | Java | e0de8a6441614d1e41a53223b5fa576b | f71575c3d71661c1bba149d6cc6d11d8 | 1,000 | PASSED |
import java.io.DataInputStream;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.*;
public class CodeChef {
public static void main(final String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-... | Java | e0de8a6441614d1e41a53223b5fa576b | 1a7999d289c0c48c4c84be6a0219fca6 | 1,000 | PASSED |
import java.io.DataInputStream;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.*;
public class CodeChef {
public static void main(final String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while... | Java | e0de8a6441614d1e41a53223b5fa576b | c044b27615d93c33310abf38f20d42e7 | 1,000 | PASSED |
import java.io.*;
import java.util.*;
public class Main {
static long TIME_START, TIME_END;
public static class Task {
public void solve(Scanner sc, PrintWriter pw) throws IOException {
int testCase = sc.nextInt();
while(testCase-- > 0) {
int n = sc.nextInt();
... | Java | e0de8a6441614d1e41a53223b5fa576b | c2d7fe09bdd8d6f6fa137ee628105363 | 1,000 | PASSED |
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
/**
*
* @author eslam
*/
public class IceCave {
static class FastReader {
BufferedReader br;
... | Java | e0de8a6441614d1e41a53223b5fa576b | 5fcd7f115f2d57422b879475ad42be85 | 1,000 | PASSED |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
/**
*
* @author eslam
*/
public class BalancedRemainders {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader()
... | Java | e0de8a6441614d1e41a53223b5fa576b | da425d7c67f12a9409acbfb52cb7e0ef | 1,000 | PASSED |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
/**
*
* @author eslam
*/
public class BalancedRemainders {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader()
... | Java | e0de8a6441614d1e41a53223b5fa576b | dc1716aec0517e3bc22f30fb0feee0fe | 1,000 | PASSED |
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
static class FastReader{
BufferedReader br;
StringTokenizer st;
public FastReader(){
br=new BufferedRe... | Java | e0de8a6441614d1e41a53223b5fa576b | 6f241d0e43187a3fd3cbf808089752a8 | 1,000 | PASSED |
import java.util.Scanner;
public class polycarps{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int i=0;i<t;i++){
int n = sc.nextInt();
int arr[] = new int[n];
for(int j=0;j<n;j++){
arr[j] = sc.nextInt();
}
... | Java | a544dd9fd96379f66a960de6f973dd50 | ac04c78087045dd44f6704f62ba81855 | 800 | PASSED |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int T = scn.nextInt();
while(T > 0) {
int n = scn.nextInt();
int[] arr = new int[n];
for(int i = 0; i < n; i++)
... | Java | a544dd9fd96379f66a960de6f973dd50 | 738298bf09a5388be991db279572a6e3 | 800 | PASSED |
import java.util.*;
//import java.io.*
import java.io.*;
public class Solution_1 {
public static void main(String[] args) {
// solution start :-)
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-->0) {
ArrayList<Long> al = new ArrayList<>();
StringBuilder sb = new StringBui... | Java | a544dd9fd96379f66a960de6f973dd50 | 3645ea51a45e9cbed8b2aeaf1f5b91d9 | 800 | PASSED |
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- != 0){
int n = sc.nextInt();
int arr[] = new int[n];
for(i... | Java | a544dd9fd96379f66a960de6f973dd50 | 266a8bc005814006edffc3a7030050df | 800 | PASSED |
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and... | Java | a544dd9fd96379f66a960de6f973dd50 | 42ffa60e44e1978073f14475dd0ec1f0 | 800 | PASSED |
import java.util.Scanner;
import java.util.*;
public class CP {
public static void main(String[] args) {
{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for (int w = 0; w <t; w++) {
int n=sc.nextInt();
int[] arr=new int[n];
for(int i=0; i<n;i+... | Java | a544dd9fd96379f66a960de6f973dd50 | 6169b9e933c4d3721a958c156d41c3f2 | 800 | PASSED |
import java.util.Scanner;
public class A {
static Scanner sc;
static long num(long u,long v)
{
if (2*u>=v)
{
return 0;
}
long c=-1;
while(u<v)
{
c++;
u*=2;
}return c;
}
static void work(){
... | Java | a544dd9fd96379f66a960de6f973dd50 | da2aaf16c0c88e2bfec2e4646d75acb7 | 800 | PASSED |
import java.util.Scanner;
public class A {
static Scanner sc;
static long num(long u,long v)
{
if (2*u>=v)
{
return 0;
}
long c=-1;
while(u<v)
{
c++;
u*=2;
}return c;
}
static void work(){
... | Java | a544dd9fd96379f66a960de6f973dd50 | 798423326b5b8969fa6f853fe4991473 | 800 | PASSED |
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
while(n>0) {
int m = sc.nextInt();
int[] z=new int[m];
ArrayList<Integer> z2 = new ArrayList<Integer>()... | Java | a544dd9fd96379f66a960de6f973dd50 | b68480533608de4fb89ee8a3c65e90c9 | 800 | PASSED |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.lang.Math;
import java.util.Arrays;
public class Main
{ static class FastReader
{
BufferedReader br;
StringTokenizer st;
... | Java | a544dd9fd96379f66a960de6f973dd50 | d05b33172646383848b28d0376f9b808 | 800 | PASSED |
# include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<numeric>
#include<map>
#include<deque>
#include <fstream>
#include <cmath>
#include <math.h>
using namespace std;
#define ll long long
#define int long long
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
const... | C++ | ecc9dc229b5d1f93809fb676eb6235c1 | 6f39f09c67dd38ac56e5b788cdf1895e | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
const int OO = 1e9 + 50;
void doWork() {
int n, m; cin >> n >> m;
vi v(n), pre, Index;
int sum = 0;
f... | C++ | ecc9dc229b5d1f93809fb676eb6235c1 | 3c53f836a0fea1aa7c8d0e95ba47a401 | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
const int OO = 1e9 + 50;
void doWork() {
int n, m; cin >> n >> m;
vi v(n), pre, Index;
int sum = 0;
f... | C++ | ecc9dc229b5d1f93809fb676eb6235c1 | 8ee0caa9d5c58051be78179d80f7ed83 | 1,900 | PASSED |
#include <bits/stdc++.h>
#define mp make_pair
#define ff first
#define ss second
#define sz(x) (ll)(x).size()
#define all(x) x.begin(),x.end()
#define all_r(x) x.rbegin(),x.rend()
#define clr(a) memset((a),0,sizeof(a))
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf pus... | C++ | ecc9dc229b5d1f93809fb676eb6235c1 | ac8240417c2b12aab18c0fa260091815 | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
int n, m;
cin >> n >> m;
vector<int> s(n + 2);
for (int i = 1; i <= n; i++)
{
cin >> s[i];
s[i] += s[i - 1];
}
int sum = s[n];
for (int i = 1; i <= n; i++)
{
s[i] = max(s[i... | C++ | ecc9dc229b5d1f93809fb676eb6235c1 | 7615aefc1994181f45e4c29d658ee08e | 1,900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
///PBDS Starting.......
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
///PBDS_SET
///Index of Value - .order_... | C++ | ecc9dc229b5d1f93809fb676eb6235c1 | a50c987813253c9581c7f89bbbccde89 | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef pair<LL,LL> PLL;
const int INF = 0x3f3f3f3f, N = 2e5 + 10;
inline int lc(int u) {return u << 1;}
inline int rc(int u) {return u << 1 | 1;}
inline int lowbit(int x) {return x & (-x);}
LL max_s[N], s[N];
inline void so... | C++ | ecc9dc229b5d1f93809fb676eb6235c1 | 8ddff8fc662f7230732b59f9dc61ab22 | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef pair<LL,LL> PLL;
const int INF = 0x3f3f3f3f, N = 2e5 + 10;
inline int lc(int u) {return u << 1;}
inline int rc(int u) {return u << 1 | 1;}
inline int lowbit(int x) {return x & (-x);}
LL max_s[N], s[N];
inline void so... | C++ | ecc9dc229b5d1f93809fb676eb6235c1 | 3129228e4d0f63d24e5e087557bf24b4 | 1,900 | PASSED |
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<unordered_set>
#include<map>
#include<algorithm>
#include<cmath>
#include<math.h>
#include <iomanip>
#define ll long long
#define hilight(x) std::cout << "==========(" << (x) << ")==========\n"
#define line(x)... | C++ | ecc9dc229b5d1f93809fb676eb6235c1 | 8554794ea42bba2e5e950c883fe22e5f | 1,900 | PASSED |
//:::: Alien :::://
// Muhammad Eid //
#include <bits/stdc++.h>
using namespace std;
void Alien35() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
#ifndef ONLINE_JUDGE
freopen("test.in", "rt", stdin);
freopen("test.out", "wt", stdout);
#endif
}
const int N = 1e5 + 5, OO ... | C++ | ecc9dc229b5d1f93809fb676eb6235c1 | 37a9a98046333a566d9f215b4a0f97f4 | 1,900 | PASSED |
#![allow(dead_code, unused_macros, unused_imports)]
import java.io.BufferedReader
import kotlin.math.*
fun main() {
val br = System.`in`.bufferedReader()
val sb = StringBuilder()
var t = 1
t = br.readInt()
repeat(t) {
val n = br.readInt()
val a = IntArray(n) { br.readInt(... | Kotlin | 224a0b09547ec1441474efbd8e06353b | 01e385c9b92de3fd7ac4ff51c6489a89 | -1 | PASSED |
#![allow(dead_code, unused_macros, unused_imports)]
import java.io.BufferedReader
import kotlin.math.*
fun main() {
val br = System.`in`.bufferedReader()
val sb = StringBuilder()
var t = 1
t = br.readInt()
repeat(t) {
val n = br.readInt()
val a = IntArray(n) { br.readInt(... | Kotlin | 224a0b09547ec1441474efbd8e06353b | a938c4a8f6824fee9a24281c594a176c | -1 | PASSED |
#![allow(dead_code, unused_macros, unused_imports)]
import java.io.BufferedReader
//import kotlin.math.*
fun main() {
val br = System.`in`.bufferedReader()
val sb = StringBuilder()
var t = 1
t = br.readInt()
repeat(t) {
val n = br.readInt()
val a = IntArray(n) { br.read... | Kotlin | 224a0b09547ec1441474efbd8e06353b | e7b64cfc4b38ff5842e628f29a336fea | -1 | PASSED |
import java.io.BufferedReader
import kotlin.math.max
import kotlin.math.min
fun main() {
val br = System.`in`.bufferedReader()
val sb = StringBuilder()
var t = 1
t = br.readInt()
repeat(t) {
val n = br.readInt()
val a = IntArray(n) { br.readInt() }
val freq: Mut... | Kotlin | 224a0b09547ec1441474efbd8e06353b | af78b5a45c454b3c2a487c3f39dff9a9 | -1 | PASSED |
import java.util.*
fun main(args: Array<String>) {
val input = Scanner(System.`in`)
val numTestCases = input.nextLine()
while (input.hasNextLine()) {
val length = input.nextLine()
val array = input.nextLine().split(" ").map(String::toInt)
val index = findIndex(array)
... | Kotlin | 224a0b09547ec1441474efbd8e06353b | 5631d3f295c2615f6df4c910012f427e | -1 | PASSED |
import java.util.Scanner
fun main() {
val scanner = Scanner(System.`in`)
val testCase: Int = scanner.nextInt()
var numLength: Int
var getPosition = 0
var nums: IntArray
for (i in 0 until testCase) {
numLength = scanner.nextInt()
nums = IntArra... | Kotlin | 224a0b09547ec1441474efbd8e06353b | 1b37faf786bc594e25db2f239f111548 | -1 | PASSED |
fun main() {
fun readInt() = readLine()!!.toInt()
fun readInts() = readLine()!!.split(' ').map { it.toInt() }.toIntArray()
var t = readInt()
repeat(t) {
var n = readInt()
val a = readLine()!!.split(' ')
var ok = 0
for (i in 1 until n - 1) {
if (a[i] !... | Kotlin | 224a0b09547ec1441474efbd8e06353b | ffbce546bebf64172d9854b1f03afc86 | -1 | PASSED |
fun main() {
repeat(readLine()!!.toInt()) {
readLine()!!
val output = findUnique(readLine()!!.split(' '))
println(output)
}
}
fun findUnique(inputArray: List<String>): Int {
val first = inputArray[0]
val second = inputArray[1]
val remaining = inputArray.drop(2)
... | Kotlin | 224a0b09547ec1441474efbd8e06353b | 64029cb200100f7147cbd48ff2ac4ae5 | -1 | PASSED |
import java.lang.AssertionError
private fun readLn() = readLine()!! //string line
private fun readInt() = readLn().toInt() //single int
private fun readLong() = readLn().toLong() //single long
private fun readDouble() = readLn().toDouble() //single double
private fun readStrings() = readLn().split(" ") /... | Kotlin | 224a0b09547ec1441474efbd8e06353b | 7e012f2b575eaa672f7a4c90417249fa | -1 | PASSED |
private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() // single long
private fun readDouble() = readLn().toDouble() // single double
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts... | Kotlin | 224a0b09547ec1441474efbd8e06353b | 8a492e4293cc3af09fe3f6074c70155f | -1 | PASSED |
fun main() {
val y = readLine()
val str = readLine()
var s=1
var x = Integer.parseInt(y)
var i = 0;
while(i < x)
{
print(str?.get(i))
i+= (s++)
}
} | Kotlin | 08e8c0c37b223f6aae01d5609facdeaf | 7766403150a356297fcfce60c8229085 | -1 | PASSED |
import java.util.*
fun main() {
val scan = Scanner(System.`in`)
val n = scan.nextInt()
val encrypted = scan.next()
scan.close()
var counter = 1
var count = 1
var decrypted = ""
for (i in 0 until n) {
if (i == 0) {
decrypted += encrypted[i]
co... | Kotlin | 08e8c0c37b223f6aae01d5609facdeaf | 252fe2b65889a9279865bdbe9eb96a1d | -1 | PASSED |
fun main(args: Array<String>) {
RepeatingCipher().main()
}
class RepeatingCipher {
private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
fun main() {
val size = readInt()
val encrypted = readLn()
var decrypted = ""
... | Kotlin | 08e8c0c37b223f6aae01d5609facdeaf | 07ac96c75455a625cb99e9ec7ddb3e11 | -1 | PASSED |
fun main() {
val lookup = arrayOf(0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55)
val encryptedSize = readLine()!!.toInt()
val encryptedString = readLine()!!
val decryptedString = buildString {
for (i in lookup) {
val decryptedChar = encryptedString.getOrNull(i)
if... | Kotlin | 08e8c0c37b223f6aae01d5609facdeaf | e46ff4c9c644d9fc23d79f2922578bf9 | -1 | PASSED |
fun main() {
val lookup = arrayOf(0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55)
val encryptedSize = readLine()!!.toInt()
val encryptedString = readLine()!!
for (i in lookup) {
val decrypted = encryptedString.getOrNull(i)
if (decrypted == null) {
break
} else {
... | Kotlin | 08e8c0c37b223f6aae01d5609facdeaf | 94d4c1a0d0bd76ddd23d5cd1a8b2776e | -1 | PASSED |
fun main(args: Array<String>) {
val firstLine = readLine()!!
val total = firstLine.toInt()
val secondLine = readLine()!!
val chars: MutableList<Char> = emptyList<Char>().toMutableList()
var index = 0
var count = 0
for (i in 0 until total) {
if (index == count) {
... | Kotlin | 08e8c0c37b223f6aae01d5609facdeaf | 7750e2553e8530c5783dd58e4928f88d | -1 | PASSED |
import kotlin.io.readLine
import kotlin.io.print
import kotlin.math.sqrt
fun main() {
val limit = readLine()?.toIntOrNull() ?: return
val encrypted = readLine() ?: return
print(buildString {
val end = ((sqrt(limit * 8 + 1.0) - 1) / 2).toInt()
for (k in 0 until end) {
v... | Kotlin | 08e8c0c37b223f6aae01d5609facdeaf | 8cf81b466b72d5f32a1d185a3e0f14fc | -1 | PASSED |
fun main() {
val n = readLine()!!.toInt()
val s = readLine()!!
var c = 1
var i = 0
while (i != n) {
print(s[i])
i += c
c++
}
} | Kotlin | 08e8c0c37b223f6aae01d5609facdeaf | e79588a4bf983c2fb88439817164ebc9 | -1 | PASSED |
fun main() {
val n = readLine()!!.toInt()
val s = readLine()!!
var i = 0
for (c in 1..n) {
if (i == n) break
print(s[i])
i += c
}
} | Kotlin | 08e8c0c37b223f6aae01d5609facdeaf | 7df53606f863a8b590cb96dddb1a15c9 | -1 | PASSED |
//package com.github.ferinagy.kotlinheroes.practice9
fun main(args: Array<String>) {
val n = readLine()!!.toInt()
val encrypted = readLine()!!
var index = 0
var jump = 1
while (index < n) {
print(encrypted[index])
index += jump
jump++
}
println()
} | Kotlin | 08e8c0c37b223f6aae01d5609facdeaf | 902c06ea9204e4da22019e6b2a5b6c8e | -1 | PASSED |
#include <iostream>
#include <cmath>
#include <vector>
#include <set>
#include <chrono>
#include <random>
#include <queue>
#include <cassert>
#include <map>
#include <algorithm>
#define ll long long
using namespace std;
ll gcd (ll x, ll y) {
if (min(x,y) == 0) return max(x,y);
return gcd(max(x,y... | C++ | db8855495d22c26296351fe310281df2 | 7837b5af1758d76d28b085e4e3093442 | 2,300 | PASSED |
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, b) for(int i=a; i<=b; i++)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define f first
#define s second
#define nl "\n"
#define pb push_back
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
const int... | C++ | db8855495d22c26296351fe310281df2 | 9afc11e627fe1e43d15746e868c1ce09 | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N = 2e7 + 5;
vector<int> P;
bool primes[N] ;
int cnt[N] ;
long long dp[N] ;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0) ;
int n ;
cin >> n ;
// to get smallest prime that divides x, prime = prime[x] || x
for (int i = 2 ; ... | C++ | db8855495d22c26296351fe310281df2 | cc89aa9b3712bab0e71203a63c89e958 | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N = 2e7 + 5;
vector<int> P;
bool primes[N] ;
int cnt[N] ;
long long dp[N] ;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0) ;
int n ;
cin >> n ;
// to get smallest prime that divides x, prime = prime[x] || x
for (int i = 2 ; ... | C++ | db8855495d22c26296351fe310281df2 | 5e79ef03c5f0410cba4cd8aacbefca41 | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N = 2e7 + 5;
vector<int> P;
int primes[N] ;
int cnt[N] ;
long long dp[N] ;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0) ;
int n ;
cin >> n ;
// to get smallest prime that divides x, prime = prime[x] || x
for (int i = 2 ; i... | C++ | db8855495d22c26296351fe310281df2 | cf55aa3970f6b426105c09a3ef30e350 | 2,300 | PASSED |
#include <bits/stdc++.h>
using i64 = long long;
constexpr int N = 2E7;
std::vector<int> primes;
bool isprime[N + 1];
int cnt[N + 1];
i64 dp[N + 1];
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
primes.reserve(1270607);
int n;
std::cin >> n;
st... | C++ | db8855495d22c26296351fe310281df2 | 7600a20746b898dfa7ce228011ffb3c6 | 2,300 | PASSED |
// oooo
/*
har chi delet mikhad bebar ~
gitar o ba khodet nabar! ~
;Amoo_Hasan;
*/
#include<iostream>
//#pragma GCC optimize("O3,no-stack-protector,unroll-loops,Ofast")
//#pragma GCC target("avx2,fma")
using namespace std;
typedef long long ll;
typedef long double ld;
#define Sz(x) int((x).size())
#define All(x)... | C++ | db8855495d22c26296351fe310281df2 | 32e8d13a7cdcd997621dca8457d15f86 | 2,300 | PASSED |
#include <iostream>
//#define int long long
#define endl '\n'
#define pi 3.141592653589793
using namespace std;
int mod=1000000007;
const int N=20000010;
long long dp[N];
long long p[N];
void solve()
{
int n,x;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d",&x);
... | C++ | db8855495d22c26296351fe310281df2 | 7b9e318290a456f4a4bc8420b9e19b86 | 2,300 | PASSED |
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <algorithm>
#include <iomanip>
#define LL long long
#define ULL unsigned long long
#define PII pair<int,int>
#define PLL pair<LL,LL>
#defin... | C++ | db8855495d22c26296351fe310281df2 | 90e36f7716e685c68b2c367a77c66950 | 2,300 | PASSED |
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <algorithm>
#include <iomanip>
#define LL long long
#define ULL unsigned long long
#define PII pair<int,int>
#define PLL pair<LL,LL>
#defin... | C++ | db8855495d22c26296351fe310281df2 | fb82c503d154859edbfa862a50996d66 | 2,300 | PASSED |
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define _upgrade \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define FOR(i, a, b) for (int i = a; i <= b; i++)
#define FORB(i, a, b) for (int i = a; i >= b; i--)
#define REP(i, a) for (in... | C++ | a240eefaf9f3f35de9ea9860302b96d9 | a5b408e9de5b2dea90737dcc0112de28 | 2,100 | PASSED |
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define _upgrade \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define FOR(i, a, b) for (int i = a; i <= b; i++)
#define FORB(i, a, b) for (int i = a; i >= b; i--)
#define REP(i, a) for (in... | C++ | a240eefaf9f3f35de9ea9860302b96d9 | 8f477fa135d894dd65d3d2b850e21446 | 2,100 | PASSED |
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define _upgrade \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define FOR(i, a, b) for (int i = a; i <= b; i++)
#define FORB(i, a, b) for (int i = a; i >= b; i--)
#define REP(i, a) for (in... | C++ | a240eefaf9f3f35de9ea9860302b96d9 | 87756e102fae67608d943839fae9c3dd | 2,100 | PASSED |
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define _upgrade \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define FOR(i, a, b) for (int i = a; i <= b; i++)
#define FORB(i, a, b) for (int i = a; i >= b; i--)
#define REP(i, a) for (in... | C++ | a240eefaf9f3f35de9ea9860302b96d9 | 85c6e2428a4b468d472bebaded4b78da | 2,100 | PASSED |
//श्रमं विना न किमपि साध्यम्
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define all(a) (a).begin(),(a).end()
#define rev(p) reverse(p.begin(),p.end());
#define v vector
#define sortt(a) sort(all(a))
#define pll pair<ll,ll>
#define sz(c) (int)c.size()
#define fr first
#define sc second
#def... | C++ | a240eefaf9f3f35de9ea9860302b96d9 | 04ee0cce64c73105d50f2058cf92c8d5 | 2,100 | PASSED |
//श्रमं विना न किमपि साध्यम्
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define all(a) (a).begin(),(a).end()
#define rev(p) reverse(p.begin(),p.end());
#define v vector
#define sortt(a) sort(all(a))
#define pll pair<ll,ll>
#define sz(c) (int)c.size()
#define fr first
#define sc second
#def... | C++ | a240eefaf9f3f35de9ea9860302b96d9 | b6d2d475fa91e4dd8fe0a3ad2d53f794 | 2,100 | PASSED |
//श्रमं विना न किमपि साध्यम्
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define all(a) (a).begin(),(a).end()
#define rev(p) reverse(p.begin(),p.end());
#define v vector
#define sortt(a) sort(all(a))
#define pll pair<ll,ll>
#define sz(c) (int)c.size()
#define fr first
#define sc second
#def... | C++ | a240eefaf9f3f35de9ea9860302b96d9 | b014063ff1e7466ff87d8a35ec36e072 | 2,100 | PASSED |
#include<bits/stdc++.h>
using namespace std;
long long dp[50000005],ton[50000005];
int main(){
int n;
long long ans=0,maxx=5000000;
cin>>n;
int a;
for(int i=1;i<=n;i++){
cin>>a;
ton[a]++;
}
for(int i=1;i<=maxx;i++){
for(int j=i*2;j<=maxx;j+=i ){
ton[i]+=ton[j];
}
}
dp[1]=n;
for(in... | C++ | a240eefaf9f3f35de9ea9860302b96d9 | d73c387a3627b0cc7fa34d1a35ebbfa3 | 2,100 | PASSED |
//libary's
#include <iostream>
#include <string>
#include <string.h>
#include <math.h>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <deque>
using namespace std;
#define ll long long
typedef pair<ll, ll> pairs;
#define ... | C++ | a240eefaf9f3f35de9ea9860302b96d9 | b3db294f93b634a217ffe81c030b1912 | 2,100 | PASSED |
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std ;
const int N=5e6+7;
int c[N];
int b[N];
long long d[N];
int main()
{
int n;
scanf("%d",&n);
int maxn=0;
for(int i=1;i<=n;i++)
{
int a;
scanf("%d",&a);
c[a]++;
maxn=max(maxn,a);
}
for(int i=1;i<=... | C++ | a240eefaf9f3f35de9ea9860302b96d9 | 8f2b7d4c76a6d304b21e0adb40648594 | 2,100 | PASSED |
#include<iostream>
#include<unordered_map>
#include<unordered_set>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#include<set>
#include<bitset>
#define INF 0x3f3f3f3f
#define mod 1000000007
#define x first
#define y second
using namespace std;
typedef pai... | C++ | 17c3fad605bc50c0e7cb4c0718cde57f | 6042be0916e96204358c87f0bf827ced | 1,000 | PASSED |
#include<iostream>
#include<unordered_map>
#include<unordered_set>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#include<set>
#include<bitset>
#define INF 0x3f3f3f3f
#define mod 1000000007
#define x first
#define y second
using namespace std;
typedef pai... | C++ | 17c3fad605bc50c0e7cb4c0718cde57f | 0489a7a376be2a67f0b19c547bdf8cdc | 1,000 | PASSED |
#include<iostream>
#include<unordered_map>
#include<unordered_set>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#include<set>
#include<bitset>
#define INF 0x3f3f3f3f
#define mod 1000000007
#define x first
#define y second
using namespace std;
typedef pai... | C++ | 17c3fad605bc50c0e7cb4c0718cde57f | 400ee92bb6e3ef4a1ef72069529b136f | 1,000 | PASSED |
#include<iostream>
#include<unordered_map>
#include<unordered_set>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#include<set>
#include<bitset>
#define INF 0x3f3f3f3f
#define mod 1000000007
#define x first
#define y second
using namespace std;
typedef pai... | C++ | 17c3fad605bc50c0e7cb4c0718cde57f | 4eb325388d1a4a006f6cfde09c6921d3 | 1,000 | PASSED |
#include<iostream>
#include<unordered_map>
#include<unordered_set>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#include<set>
#include<bitset>
#define INF 0x3f3f3f3f
#define mod 1000000007
#define x first
#define y second
using namespace std;
typedef pai... | C++ | 17c3fad605bc50c0e7cb4c0718cde57f | a7eb06a61249eac8a446b4c1be20a175 | 1,000 | PASSED |
#include<iostream>
#include<unordered_map>
#include<unordered_set>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#include<set>
#include<bitset>
#define INF 0x3f3f3f3f
#define mod 1000000007
#define x first
#define y second
using namespace std;
typedef pai... | C++ | 17c3fad605bc50c0e7cb4c0718cde57f | 948855ddde5ec8e32d20da1807b8bee9 | 1,000 | PASSED |
#include<iostream>
#include<unordered_map>
#include<unordered_set>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#include<set>
#include<bitset>
#define INF 0x3f3f3f3f
#define mod 1000000007
#define x first
#define y second
using namespace std;
typedef pai... | C++ | 17c3fad605bc50c0e7cb4c0718cde57f | 019d95773bbcf3a262d642b4d0de79ca | 1,000 | PASSED |
#include<iostream>
#include<unordered_map>
#include<unordered_set>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#include<set>
#include<bitset>
#define INF 0x3f3f3f3f
#define mod 1000000007
#define x first
#define y second
using namespace std;
typedef pai... | C++ | 17c3fad605bc50c0e7cb4c0718cde57f | 9c8a6c7b61d92afd9782f4197f6be2cf | 1,000 | PASSED |
#include<iostream>
#include<unordered_map>
#include<unordered_set>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#include<set>
#include<bitset>
#define INF 0x3f3f3f3f
#define mod 1000000007
#define x first
#define y second
using namespace std;
typedef pai... | C++ | 17c3fad605bc50c0e7cb4c0718cde57f | 9df2e76558fcc726d1009c3b2c14e095 | 1,000 | PASSED |
#include<iostream>
#include<unordered_map>
#include<unordered_set>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#include<set>
#include<bitset>
#define INF 0x3f3f3f3f
#define mod 1000000007
#define x first
#define y second
using namespace std;
typedef pai... | C++ | 17c3fad605bc50c0e7cb4c0718cde57f | 0c4917773faf2378a5c7c8db3c5b8938 | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int MOD=1000000007;
long long POW(long long a,long long b){
long long res=1;
while(b>0){
if(b%2) res=res*a%MOD;
a=a*a%MOD;
b/=2;
}
return res;
}
void solve(){
int n,m;
cin>>n>>m;
int ans=0; int ... | C++ | c4ba92632e10b1710686930f0c4536fa | 95d83f0c1d64899e072d3dfaf8986a1d | 1,500 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.