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 |
|---|---|---|---|---|---|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld; //
typedef double db; //
typedef string str; //
//
typedef pair<int, int> pi;
typedef pair<ll,ll> pl; //
typedef pair<ld,ld> pd; //
//
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ld> vd; //
typedef vector<st... | C++ | 6bceaf308c38d234ba931c13e4f70929 | 53d7e27d09317e69ff27cc2ff4e12a62 | 1,700 | PASSED |
#define _CRT_SECURE_NO_WARNINGS 1
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include <iostream>
#include <cmath>
#include<cstring>
#include <cstdio>
#include <stack>
#include<iomanip>
#include<queue>
#include <un... | C++ | 6bceaf308c38d234ba931c13e4f70929 | 18fc2ecd127a7c8df93f8c72328a21a3 | 1,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define int long long
int a[200005];
int b[200005];
pair<int, int>pr[200005];
priority_queue<int>q;
signed main()
{
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int n; cin >> n;
for (int i = 1; i <= n; ++i)
{
cin >> a[i];
pr[i].first = a[i];
}
for (int i ... | C++ | 6bceaf308c38d234ba931c13e4f70929 | d9957261dda8d0f96061237ede9229da | 1,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define int long long
map<int, int>f;
struct node
{
int a;
int b;
}; node nd[200005];
int fd(int x)
{
if (x == f[x])return x;
return f[x] = fd(f[x]);
}
void merge(int x, int y)
{
x = fd(x);
y = fd(y);
if (x == y)return;
if (x > y)f[y] = x;
else f[x] = y;
}
bool cmp(... | C++ | 6bceaf308c38d234ba931c13e4f70929 | f45a739b2bc8cab9de3be8f24d42ca59 | 1,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define M 1000000007
#define pi 3.141592653
#define exp 2.71828
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pair<int,int>>
#define vll vector<pair<ll,ll>>
#define pb push_back
#define pp pop_back
#define mp make_pair
#define in inser... | C++ | 6bceaf308c38d234ba931c13e4f70929 | c9e371fa36184524608e590b5fb14e60 | 1,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define all(v) v.begin(), v.end()
#define trace(x) cout << #x "=" << x << endl
#define int128 __int128
#define int long long
const int mod = 1e9 + 7;
const int maxn = 4e5 + 10;
int a[maxn];
int t[maxn];
pair<int, int> cate... | C++ | 6bceaf308c38d234ba931c13e4f70929 | 47c6c93316d5e20a2bb20a6c6f9d06e2 | 1,700 | PASSED |
#include <bits/stdc++.h>
#define st first
#define nd second
#define pb push_back
#define pf push_front
#define lwb lower_bound
#define upb upper_bound
#define all(a) (a).begin(), (a).end()
#define Reset(s, n) memset(s, n, sizeof(s... | C++ | 6bceaf308c38d234ba931c13e4f70929 | 30650287d2d9836c005f6fb3ec840923 | 1,700 | PASSED |
#include<cstdio>
#include<iostream>
#include<map>
#include<set>
#include<vector>
#include<cstring>
#include<cassert>
#include<cmath>
#include<unordered_map>
#include<algorithm>
#include<queue>
using namespace std;
#define _for(i,a,b) for(int i = (a);i<(b);++i)
#define _rep(i,a,b) for(int i = (a);i<=(b);++i)
#define ... | C++ | 6bceaf308c38d234ba931c13e4f70929 | 732d3ae3e83329e2d91deeea5e500db2 | 1,700 | PASSED |
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <c... | C++ | 6bceaf308c38d234ba931c13e4f70929 | 2337a5960d2cc6da01a7954c1c2d610b | 1,700 | PASSED |
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Rubanenko
*/
public class M... | Java | 0c5bc07dec8d8e0201695ad3edc05877 | e5344dfe8da3e8ae23b845b607452559 | 2,400 | PASSED |
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
public class MainClass
{
public static void main(String[] args)throws IOException
{
Reader in = new Reader();
int n = in.nextInt();
int[] A = new int[n]; for (int i=0;i<n;i++) A[i] = in.nextI... | Java | 0c5bc07dec8d8e0201695ad3edc05877 | 71d04a677873890110624ea7c1b10c94 | 2,400 | PASSED |
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Bit... | Java | 0c5bc07dec8d8e0201695ad3edc05877 | 3af8386cd3e11bb1a3d6b2cbe49d4f8b | 2,400 | PASSED |
/*Author: Satyajeet Singh, Delhi Technological University*/
import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.math.*;
public class Main{
/*********************************************Constants******************************************/
static PrintWrite... | Java | 0c5bc07dec8d8e0201695ad3edc05877 | 1a3a80fd17e6bd26da361fb5d8f9655b | 2,400 | PASSED |
/*Author: Satyajeet Singh, Delhi Technological University*/
import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.math.*;
public class Main{
/*********************************************Constants******************************************/
static PrintWrite... | Java | 0c5bc07dec8d8e0201695ad3edc05877 | d61893cccd907fe910617240f95eb404 | 2,400 | PASSED |
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static ... | Java | 0c5bc07dec8d8e0201695ad3edc05877 | 52677f8409d4318c63d908d85f8ad3bb | 2,400 | PASSED |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
public class D257 {
static final long MOD = (long)(1e9+7);
static long[] fs;
static long[][] memo;
public static void main(String[] args)... | Java | 0c5bc07dec8d8e0201695ad3edc05877 | b38de0f145eee100e5c3d5a06155c4bb | 2,400 | PASSED |
import java.math.BigInteger;
import java.util.*;
import java.io.*;
import java.text.*;
public class Main{
//SOLUTION BEGIN
//Into the Hardware Mode
void pre() throws Exception{}
void solve(int TC) throws Exception{
int n = ni(), B = 20;
long[] a = new long[1<<B];
long MOD = (long... | Java | 0c5bc07dec8d8e0201695ad3edc05877 | 656c058f7d893ecb6635495538e57b3e | 2,400 | PASSED |
import java.util.Scanner;
/**
* Created by David Lee on 2017/6/22.
*/
public class Main {
static int P = 1000000007, N = 1<<20 + 5, k = 1<<20;
static int a[] = new int [N];
static private int ksm(int a, int b)
{
int c = 1, d = a;
while (b > 0)
{
if((b & 1) != 0)
... | Java | 0c5bc07dec8d8e0201695ad3edc05877 | 5b537deb50671afcaa7605b9a71b6aa3 | 2,400 | PASSED |
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Round257Div1D {
public static long mod = (long)1e9+7;
public static void solve() {
int n = s.nextInt();
int m = 20;
int size = 1<... | Java | 0c5bc07dec8d8e0201695ad3edc05877 | ed30e843c6d29b65a986f8112904a622 | 2,400 | PASSED |
// In the Name of Allah
// AD13
#include <map>
#include <set>
#include <string>
#include <vector>
#include <numeric>
#include <iostream>
#include <algorithm>
using namespace std;
typedef vector<int> VI;
typedef long long ll;
// typedef unsigned long long ull;
typedef pair<int, int> pii;
// typedef pair<double, doubl... | C++ | ae4378fbdb863ed6c30aae5d22851531 | 197f296f81db9fe80a66ef537c1232c5 | 1,800 | PASSED |
#include <bits/stdc++.h>
#define debug(x) cout << #x << " --- " << x << endl
#define rall(x) x.rbegin(), x.rend()
#define all(x) x.begin(), x.end()
#define pb push_back
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cout.tie(0);
cin.tie(0);
long long t;
cin >> t;
w... | C++ | ae4378fbdb863ed6c30aae5d22851531 | e914815707c754842f8eb36be082fc0d | 1,800 | PASSED |
// Example program
#include <iostream>
#include <sstream>
#include <string>
#include <set>
#include <vector>
#include<cmath>
#include <algorithm>
#include <map>
using namespace std;
int main()
{
size_t t;
cin >> t;
for (size_t j = 0; j < t; ++j)
{
size_t n, k;
cin >> n >> k;
... | C++ | ae4378fbdb863ed6c30aae5d22851531 | 8d71bdc05e0b71f30383ec730b1be135 | 1,800 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define ll long long
#define int ll
#define ld long double
#defi... | C++ | ae4378fbdb863ed6c30aae5d22851531 | 734da0fd2a58f294a0d6364fd35c9e03 | 1,800 | PASSED |
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define ALL(x) x.begin(), x.end()
#define GET(i, x) get<i>(x)
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
constexpr ll MOD = 1e9 + 7;
const int maxn = 2 * 1e5;
int... | C++ | ae4378fbdb863ed6c30aae5d22851531 | 51316642ad2cec931d838b28eb5f2335 | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int maxn = 2e5 + 10;
int a[maxn], b[maxn], c[maxn], pre[maxn];
bool com(int a, int b)
{
return a < b;
}
int qian[maxn], hou[maxn];
signed main()
{
int t, n, k;
cin >> t;
while (t--)
{
cin >> n >> k;
for (int i ... | C++ | ae4378fbdb863ed6c30aae5d22851531 | 8f56649180b1a7efeb866b6ac69fab07 | 1,800 | PASSED |
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <set>
#include <cmath>
#define ll long long int
using namespace std;
const int MAXN = 2e5+10;
ll t, n, k, x[MAXN], y, ans, dp[MAXN];
struct seg {
ll c, r;
} s[MAXN];
void get_seg() {
int i = 0, j = 0, m = 0;... | C++ | ae4378fbdb863ed6c30aae5d22851531 | 0760571f4afba13fe135436f5ddc7b2e | 1,800 | PASSED |
#pragma region // {{{ by unolight
#include <bits/stdc++.h>
#include <unistd.h>
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-function"
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x),end(x)
#define RALL(x) rbegin(x),rend(x)
#define REP(i,n) for ( int i=0; i<int(n); i+... | C++ | ae4378fbdb863ed6c30aae5d22851531 | 52a0f47429d33838229174947e6a995c | 1,800 | PASSED |
#include <bits/stdc++.h>
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
int n, k;
std::cin >> n >> k;
std::vector<int> x(n), y(n);
for (int i = 0; i < n; ++i)
std::cin >> x[i];
for (int i =... | C++ | ae4378fbdb863ed6c30aae5d22851531 | c1f0fe74c705e4b900085e4a5422cf21 | 1,800 | PASSED |
#pragma region // {{{ by unolight
#include <bits/stdc++.h>
#include <unistd.h>
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-function"
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x),end(x)
#define RALL(x) rbegin(x),rend(x)
#define REP(i,n) for ( int i=0; i<int(n); i+... | C++ | ae4378fbdb863ed6c30aae5d22851531 | c1b4b7b32d771aa4ecd37f3ef24cdeb2 | 1,800 | PASSED |
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for (int j = 0; j < t; j++) {
int n = sc.nextInt();
int aaa = 0;
int numOdds = 0;
int numEvens = 0;
for (int i = 0; i < n; i++) {
aaa = sc.next... | Java | 2e8f7f611ba8d417fb7d12fda22c908b | 4d1dd17a56ca79c7f79a42843b3ac2e5 | 800 | PASSED |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
for (int i = 0; i < n; i++) {
int odd = 0 , ev = 0 ,sum = 0 ;
int p = input.nextInt();
for (int j = 0; j <p; j++) {
int x = inpu... | Java | 2e8f7f611ba8d417fb7d12fda22c908b | 7e01e2aad5530723c3ec168fa10ef13a | 800 | PASSED |
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args)throws IOException{
Scanner sc = new Scanner (System.in);
int cont = sc.nextInt();
while(cont > 0){
int tam = sc.nextInt();
int[] arr = new int[tam];
... | Java | 2e8f7f611ba8d417fb7d12fda22c908b | 34adc87eeb0d6a7ddfae02171b7248a1 | 800 | PASSED |
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args)throws IOException{
Scanner sc = new Scanner (System.in);
int cont = sc.nextInt();
while(cont > 0){
int tam = sc.nextInt();
int[] arr = new int[tam];
... | Java | 2e8f7f611ba8d417fb7d12fda22c908b | add1941952bcc500db965053b872a123 | 800 | PASSED |
/**
* @author : Kshitij
*/
import java.io.*;
import java.util.InputMismatchException;
public class Main {
public static void main(String[] xps){
InputReader in = new InputReader(System.in);
OutputWriter out = new OutputWriter(System.out);
StringBuilder stringBuilder = new StringBuilder();... | Java | 2e8f7f611ba8d417fb7d12fda22c908b | 62fe949f2495ed054bfc73e989b7a5a6 | 800 | PASSED |
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int testCase = scan.nextInt();
for(int i = 0; i < testCase; i++){
int odd = 0;
int even = 0;
int num = scan.nextInt... | Java | 2e8f7f611ba8d417fb7d12fda22c908b | 9151a086a4ea5ca80399a50eab4bd472 | 800 | PASSED |
import java.util.Scanner;
public class Array_Odd_Sum {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int test = in.nextInt();
for (int i = 0; i < test; i++) {
int size = in.nextInt();
int sum = 0;
int se = 0;
in... | Java | 2e8f7f611ba8d417fb7d12fda22c908b | 150fc78593c194982351c53a8f6f5530 | 800 | PASSED |
import java.util.Scanner;
import java.util.Arrays;
import java.lang.*;
import java.io.*;
import java.util.*;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.*;
import java.util.function.Function;
public class ArrayWithOddSum {
public static void main(String[] args)throws IOException {
Scanne... | Java | 2e8f7f611ba8d417fb7d12fda22c908b | bd7900fb58c5d987ef83533a4c3a7e02 | 800 | PASSED |
import java.util.Scanner;
/**
*
* @author Tonmoy
*/
public class Array_with_Odd_Sum_1296A {
public static void main(String[] args) {
Scanner In=new Scanner(System.in);
int t=In.nextInt();
for (int i = 0; i < t; i++) {
int n=In.nextInt();
int sum=0;
i... | Java | 2e8f7f611ba8d417fb7d12fda22c908b | afc4825d4e308900658af01ef5365a85 | 800 | PASSED |
/* package codechef; // don't place package name! */
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 Codechef
{
static int a =0;
static int b =0;
public static void main (String[] args) throws java.lang.Exception
{
... | Java | 2e8f7f611ba8d417fb7d12fda22c908b | 14e362b4a975b67d1236f1848ad367e0 | 800 | PASSED |
import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;
public class ff {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in=new Scanner(System.in);
HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();
HashMap<Integer,Integer> mp=new HashMap<In... | Java | f4bb0b8f285b0c8cbaf469964505cc56 | 535c09a8b4e2e9a5c479b0d49ba790f4 | 1,200 | PASSED |
import java.util.*;
public class a
{
static int mod = (int) 1e9 + 7;
static int Infinity=Integer.MAX_VALUE;
static int negInfinity=Integer.MIN_VALUE;
public static void main(String args[])
{
Scanner d= new Scanner(System.in);
int n,x,i,z;
n=d.nextInt();
x=d.nextInt();... | Java | f4bb0b8f285b0c8cbaf469964505cc56 | fdd4f0de54f6889c41c59b84b7564bf2 | 1,200 | PASSED |
import java.io.*;
import java.util.*;
public class CFB {
BufferedReader br;
PrintWriter out;
StringTokenizer st;
boolean eof;
private static final long MOD = 1000L * 1000L * 1000L + 7;
private static final int[] dx = {0, -1, 0, 1};
private static final int[] dy = {1, 0, -1, 0};
private... | Java | f4bb0b8f285b0c8cbaf469964505cc56 | 5f53dab0254a466d9e0c00c7d4796b60 | 1,200 | PASSED |
//package codeforces.Round500;
import java.util.HashMap;
import java.util.Scanner;
public class And {
private static HashMap<Integer, Boolean> visited;
private static HashMap<Integer, Boolean> visitedAnd;
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n ... | Java | f4bb0b8f285b0c8cbaf469964505cc56 | 44d3edf191999f51e3524356996f493f | 1,200 | PASSED |
import java.io.*;
import java.lang.*;
public class CF1013B {
public static void main(String args[]) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] s = br.readLine().split(" ");
int n = Integer.parseInt(s[0]);
int x = Integer.par... | Java | f4bb0b8f285b0c8cbaf469964505cc56 | 37ecae2f73bff34e7a836c687b2e3712 | 1,200 | PASSED |
import java.io.*;
import java.util.StringTokenizer;
public class And {
public static void main(String[] args) {
FastReader input = new FastReader();
OutputStream ob = System.out;
PrintWriter out = new PrintWriter(ob);
int n = input.nextInt();
int x = input.nextInt();
... | Java | f4bb0b8f285b0c8cbaf469964505cc56 | 7766750ef62e1da5d42329f11c2f50cc | 1,200 | PASSED |
import java.util.*;
import java.math.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
//--------------->>>>IF YOU ARE HERE FOR QUICKSORT HACK THEN SORRY NO HACK FOR YOU<<<-------------------
public class a{
static int[] count,... | Java | f4bb0b8f285b0c8cbaf469964505cc56 | c09001dc608b22ac12b5b54391acfb00 | 1,200 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
InputStream inpu... | Java | f4bb0b8f285b0c8cbaf469964505cc56 | 79a681c648f919af2a0bcf171431b085 | 1,200 | PASSED |
import java.util.Scanner;
public class CF1012B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int x = sc.nextInt();
int[] arr = new int[n];
int[] freq = new int[100100];
for(int i=0; i<n; i++) {
arr[i] = sc.nextInt();
freq[arr[i]]++;
}
boole... | Java | f4bb0b8f285b0c8cbaf469964505cc56 | 10d42c42b0c268d419a084a894037862 | 1,200 | PASSED |
import java.util.*;
import java.io.*;
public class Main
{
public static void main(String[] args) {
InputReader in = new InputReader(System.in);
OutputWriter out = new OutputWriter(System.out);
int n = in.nextInt();
int k = in.nextInt();
int[]a= new int[n];
int[]nums... | Java | f4bb0b8f285b0c8cbaf469964505cc56 | 9ab36e45a28a220b7bf3e6de7e058539 | 1,200 | PASSED |
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <iostream>
#include <ctime>
using namespace std;
#define fr(i,a,b) for(int i=a;i<b;++i)
vector<int> inc[100100];
int v[100100];
bool rem[100100]... | C++ | c4c85cde8a5bb5fefa4eb68fc68657d5 | d3e7babf4beef64b45064ef0c347eb20 | 2,400 | PASSED |
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <iostream>
#include <ctime>
using namespace std;
#define fr(i,a,b) for(int i=a;i<b;++i)
vector<int> inc[100100];
int v[100100];
bool rem[100100]... | C++ | c4c85cde8a5bb5fefa4eb68fc68657d5 | 50b49d2dcd410d5b3209efc6916016a1 | 2,400 | PASSED |
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <vector>
#include <ctime>
using namespace std;
typedef long long lint;
set<pair<int, int> > used;
int main()
{
int n, m;
scanf("%d %d", &n, &m... | C++ | c4c85cde8a5bb5fefa4eb68fc68657d5 | 664381ae864b0379acf3a6e1cd36ee80 | 2,400 | PASSED |
#include<cstdio>
#include<cstring>
#include<queue>
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
vector<int>g[110000];
int u[110000],v[110000],n,m;
int cnt[110000];
bool three()
{
if(m>1) return false;
printf("%d %d\n",u[0],6-u[0]-v[0]);
return true;
}
bool four()
{
if(m>3) ... | C++ | c4c85cde8a5bb5fefa4eb68fc68657d5 | ae2ab5b2462d0bd248f80518b8987e99 | 2,400 | PASSED |
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <memory.h>
#include <ctime>
using namespace std;
#define ABS... | C++ | c4c85cde8a5bb5fefa4eb68fc68657d5 | 9a0be7ce2b2f012b35456568dd6427b3 | 2,400 | PASSED |
//#define OSW
#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
using namespace std;
int x1[100005];
int x2[100005];
int flag[100005];
bool cmp(const list<int> &l1, const list<int> &l2) {
int s1 = l1.size();
int s2 = l2.size();
int ss1 = (x1[l1.back()]==l1.fron... | C++ | c4c85cde8a5bb5fefa4eb68fc68657d5 | e8a9dfa0ec74dcae7f5693dd727f56f3 | 2,400 | PASSED |
#include <iostream>
#include <sstream>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <functional>
#include <numeric>
#include <iomanip>
#include <utility>
using namespace std;
bool f[222222],first[222222],ful... | C++ | c4c85cde8a5bb5fefa4eb68fc68657d5 | 76412ee89cc6becb85da7a4219055692 | 2,400 | PASSED |
#include <iostream>
#include <vector>
#include <algorithm>
#define M 100100
#define mp make_pair
using namespace std;
int n,m,x[M];
pair<int,int> p[2*M];
void read(void){
cin>>n>>m;
for (int x,y,i=0; i<m; ++i){
cin>>x>>y;
p[2*i]=mp(x,y);
p[2*i+1]=mp(y,x);
}
sort(p,p+2*m);
}
... | C++ | c4c85cde8a5bb5fefa4eb68fc68657d5 | 49e10d60f877a1a73c1bcde3ad105e7c | 2,400 | PASSED |
#include <iostream>
#include <vector>
#include <algorithm>
#define M 100100
#define mp make_pair
using namespace std;
int n,m,x[M];
pair<int,int> p[M];
void read(void){
cin>>n>>m;
for (int x,y,i=0; i<m; ++i){
cin>>x>>y;
p[i]=mp(x,y);
}
sort(p,p+m);
}
void kill(void){
for (int i=... | C++ | c4c85cde8a5bb5fefa4eb68fc68657d5 | 8512bee4bd4d5c31b6e73f103c21e598 | 2,400 | PASSED |
// in the name of God
#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define ll long long
#define ld long double
#define s(a) scanf("%d" , &a)
#define p(a) printf("%d " , a)
#define mem(A) memset(A , 0 , sizeof A)
using namespace std;
typedef pair<int , int> pii;
const int MAXN = 1e5... | C++ | c4c85cde8a5bb5fefa4eb68fc68657d5 | f3cfb373e52fa92f69eeb756351664f8 | 2,400 | PASSED |
//ssense
#include<bits/stdc++.h>
#include<string.h>
#define startt ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef unsigned long long ull;
typedef long long ll;
using namespace std;
#define FOR(n) for(int i=0;i<n;i++)
#define vt vector
#define sz(a) (int)a.size()
#define MOD 1000000007
#define MOD2 99... | C++ | d3c10d1b1a17ad018359e2dab80d2b82 | 1c0a791826e8679ac60a07bc9b5d9257 | 1,400 | PASSED |
#include<cstdio>
#include<cstdlib>
#include<iostream>
//#include<fstream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<set>
#include<string>
#include<map>
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int, int> P;
typedef long long ll;
#define fi first
#define se scond
#d... | C++ | d3c10d1b1a17ad018359e2dab80d2b82 | b445eb5cb787997759ae198f3e866f12 | 1,400 | PASSED |
#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
#define gcd(a,b) __gcd(a,b)
#define ll long long
#define ms(x,a) memset(x,a,sizeof(x))
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repp(i,a,b) for(int i=a;i>=b;i--)
#define sd(x) scanf("%d",&x)
#define sdd(x,y) scanf("%d%d",&x,&y)
#define debug() cout<<"***"<<endl;
us... | C++ | d3c10d1b1a17ad018359e2dab80d2b82 | 02e97a7e0ab9486c0449321b4368274f | 1,400 | PASSED |
/* *****fireice**** */
#include<bits/stdc++.h>
#define ll long long int
#define vi vector<int>
#define vc vector<char>
#define vl vector<ll>
#define vii vector<pair<int,int>>
#define vll vector<pair<ll,ll>>
#define pii pair<int,int>
#define pb push_back
#define el '\n'
#define N 1000000007
#define re return
#define F... | C++ | d3c10d1b1a17ad018359e2dab80d2b82 | 4ef071bccc8f343ebf549bd3d0b25757 | 1,400 | PASSED |
#include <bits/stdc++.h>
#define int long long
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define rep(i,A,B) for(int i=A;i<=B;i++)
#define mod 10007
#define v1d vector<int>
#define v2d vector<vector<int>... | C++ | d3c10d1b1a17ad018359e2dab80d2b82 | 8b54e6d3767f2aca63f642e404b47aab | 1,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
int months[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
const int M = (int)1e5 + 1... | C++ | d3c10d1b1a17ad018359e2dab80d2b82 | db12d919c15b7b1d9275dd45847f2dfc | 1,400 | PASSED |
/**********************************************************
* Code written by Akikaze *
* Duy-Bach Le, #Team4T's Chief Executor *
* #Team4T Tertiary Flagship - Oblivion *
* *
* Written by a ... | C++ | d3c10d1b1a17ad018359e2dab80d2b82 | b3a78dd74d986489c53e87158c1fefe0 | 1,400 | PASSED |
#include <bits/stdc++.h>
#define fto(i, x, y) for(auto i = (x); i <= (y); ++i)
#define fdto(i, x, y) for(auto i = (x); i >= (y); --i)
#define ftoa(i, x, y, a) for(auto i = (x); i <= (y); i += a)
#define ftoit(it, var) for (auto it = var.begin(); it != var.end(); ++it)
#define ii pair<int, int>
#define mp make_pair
#d... | C++ | d3c10d1b1a17ad018359e2dab80d2b82 | a0ac5fc30b816fb7a70fe9ec74d0d682 | 1,400 | PASSED |
/*//DJ aka Dvij Joshi
************** *********************
**************** *********************
****** ****** *****
****** ****** *****
****** ****** *****
... | C++ | d3c10d1b1a17ad018359e2dab80d2b82 | 5a07ae09b1bd86761c9e57ab1edb91d7 | 1,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define vs vector<string>
#define vll vector<ll>
#define ii pair<int, int>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define vii vector<ii>
#define vvi vector<vi>
#define vvii vector<vii>
#define ld long double
#define... | C++ | d3c10d1b1a17ad018359e2dab80d2b82 | e9454146f145ec867de33d6ffb5d0c8f | 1,400 | PASSED |
#include <bits/stdc++.h>
#define PI 3.14159265358979323846264338327950288419
using namespace std;
const int ITER = 3;
const int LOWER = 100000000;
const int UPPER = 300000000;
int pr[ITER];
int tc, n, m;
int ohash[500005];
int edges[500005][2];
bool in_image[500005];
long long val[500005];
int ran_num[500005];
m... | C++ | 59ec1518d55bf81ee7cadba3a918c890 | 3e913a0c9e35fdd95218d957941b11bc | 2,300 | PASSED |
#include<bits/stdc++.h>
#define pi 3.1415926535897932384626
using namespace std;
struct P{
int x,y;
bool operator < (const P &a )const{
//if(y!=a.y)
return y<a.y;
};
};
int a,b,c,d,i,k,n,m,e,dx[10]={1,0,-1,0,1,1,-1,-1},dy[10]={0,1,0,-1,1,-1,1,-1};
int o[500101];
long long l[500101];
long long j[50... | C++ | 59ec1518d55bf81ee7cadba3a918c890 | 119d42b45ed0b751ba659fc747baf5cd | 2,300 | PASSED |
#include<bits/stdc++.h>
#define pi 3.1415926535897932384626
using namespace std;
struct P{
int x,y;
bool operator < (const P &a )const{
//if(y!=a.y)
return y<a.y;
};
};
int a,b,c,d,i,k,n,m,e,dx[10]={1,0,-1,0,1,1,-1,-1},dy[10]={0,1,0,-1,1,-1,1,-1};
int o[500101];
long long l[500101];
long long j[50... | C++ | 59ec1518d55bf81ee7cadba3a918c890 | 46257938f4f21770fcd908f1c353b515 | 2,300 | PASSED |
#include<bits/stdc++.h>
#define pi 3.1415926535897932384626
using namespace std;
struct P{
int x,y;
bool operator < (const P &a )const{
//if(y!=a.y)
return y<a.y;
};
};
int a,b,c,d,i,k,n,m,e,dx[10]={1,0,-1,0,1,1,-1,-1},dy[10]={0,1,0,-1,1,-1,1,-1};
long long o[500101];
long long l[500101];
long lon... | C++ | 59ec1518d55bf81ee7cadba3a918c890 | e2cfa507eb4b06e8e37682bbf80446b9 | 2,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,a,b) for(int i=(a),_end_=(b);i<=_end_;i++)
#define DREP(i,a,b) for(int i=(a),_end_=(b);i>=_end_;i--)
#define EREP(i,u) for(int i=start[u];i;i=e[i].next)
#define fi first
#define se second
#define mkr(a,b) make_pair(a,b)
#define SZ(A) ((int)... | C++ | 59ec1518d55bf81ee7cadba3a918c890 | 7bcb9575e8f13356d78e9db34458e88d | 2,300 | PASSED |
#include <iostream>
#include <fstream>
#include <algorithm>
#include <iomanip>
#include <random>
#include <ctime>
#include <bitset>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <cstring>
#include <queue>
#include <deque>
#include <list>
#include <stack>
/////... | C++ | 59ec1518d55bf81ee7cadba3a918c890 | d81987e60305aef2038a894dcd4c2358 | 2,300 | PASSED |
#include <iostream>
#include <fstream>
#include <algorithm>
#include <iomanip>
#include <random>
#include <ctime>
#include <bitset>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <cstring>
#include <queue>
#include <deque>
#include <list>
#include <stack>
/////... | C++ | 59ec1518d55bf81ee7cadba3a918c890 | 596c99cbe3a488b465260af947a03693 | 2,300 | PASSED |
#include <iostream>
#include <fstream>
#include <algorithm>
#include <iomanip>
#include <random>
#include <ctime>
#include <bitset>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <cstring>
#include <queue>
#include <deque>
#include <list>
#include <stack>
/////... | C++ | 59ec1518d55bf81ee7cadba3a918c890 | 0658461e63231ccf1f497441836ca5f8 | 2,300 | PASSED |
// 1322C https://codeforces.com/problemset/problem/1322/C
#include <bits/stdc++.h>
using namespace std;
#define f(i,a,b) for (int i = a; i < b; i++)
#define fr(i,a,b) for (int i = (b)-1; i >= a; i--)
#define IN(i,a,b) (a<=i&&i<=b)
#define mp make_pair
#define mt make_tuple
#define sz(a) a.size()
using ld = long doubl... | C++ | 59ec1518d55bf81ee7cadba3a918c890 | bda2f7a24d874687ec0029b2c947b01d | 2,300 | PASSED |
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <ctime>
#include <vector>
using namespace std;
typedef long long ll;
const int N = 5e5 + 7;
int n, m, B, P;
ll a[N];
vector<int> e[N];
inline int h(vector<int> p) {
sort(p.begin(), p.end());
int ret = 0;
for (int x : p)
ret ... | C++ | 59ec1518d55bf81ee7cadba3a918c890 | b35bf30816aa47867561263e5f6e7620 | 2,300 | PASSED |
// ~/BAU/ACM-ICPC/Teams/Rampage/Corvus
// ~/sudo apt-get verdict Accpeted
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <memory.h>
#include <limits.h>
#include <math.h>
#include <string.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <que... | C++ | 6c3c738a1f895b9ede9378a515112861 | 88602af612bc11d7a9c9219e1727f14f | 2,400 | PASSED |
#include <bits/stdc++.h>
const int mxsz = 500500;
using namespace std;
int N, Qp;
int answers[mxsz], BLOCK_SIZE = 800, arr[mxsz], cnt[mxsz], total = 0, blk[800];
//pair< pair<int, int>, int> queries[500500];
struct str {int l,r,i;} Q[mxsz];
bool mo_cmp(const pair< pair<int, int>, int> &x, const pair< pair<int, int>, i... | C++ | 6c3c738a1f895b9ede9378a515112861 | 1e005cf4b0859bbc4f54e8965c30f377 | 2,400 | PASSED |
#include <bits/stdc++.h>
const int mxsz = 500500;
using namespace std;
int N, Qp;
int answers[mxsz], BLOCK_SIZE = 800, arr[mxsz], cnt[mxsz], total = 0, blk[800];
struct str {int l,r,i;} Q[mxsz];
bool mo_cmp(const pair< pair<int, int>, int> &x, const pair< pair<int, int>, int> &y){
int block_x = x.first.first / BLO... | C++ | 6c3c738a1f895b9ede9378a515112861 | a6cd0e5337d3c1c51824a478a87fc2ec | 2,400 | PASSED |
#include <bits/stdc++.h>
const int mxsz = 500500;
using namespace std;
int N, Qp;
int answers[mxsz], BLOCK_SIZE = 800, arr[mxsz], cnt[mxsz], total = 0, blk[800];
struct str {int l,r,i;} Q[mxsz];
inline void add(int x){
cnt[x]++;
if(cnt[x] == 1){
blk[x/BLOCK_SIZE]++;
total++;
}
if(cnt[x] == 2){
blk[x/BLOC... | C++ | 6c3c738a1f895b9ede9378a515112861 | 5bd19a99836db1970e47c5ea2f20d6c9 | 2,400 | PASSED |
// NA
#include <bits/stdc++.h>
#define BUFFER 5
#define BUFF(x) x + BUFFER
#define N_MAX (int) (5e5)
#define NODES_MAX (int) (4 * N_MAX * log2(N_MAX))
#define mp make_pair
#define INF (int) 1e9
// #pragma GCC optimize "O4"
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef unorde... | C++ | 6c3c738a1f895b9ede9378a515112861 | e1235fea49717c71c235ea13aed23540 | 2,400 | PASSED |
// NA
#include <bits/stdc++.h>
#define BUFFER 5
#define BUFF(x) x + BUFFER
#define N_MAX (int) (5e5)
#define NODES_MAX (int) (4 * N_MAX * log2(N_MAX))
#define mp make_pair
#define INF (int) 1e9
#pragma GCC optimize "O4"
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef unordered... | C++ | 6c3c738a1f895b9ede9378a515112861 | d034fc1206a18e418189ce57f373e390 | 2,400 | PASSED |
// NA
#include <bits/stdc++.h>
#define BUFFER 5
#define BUFF(x) x + BUFFER
#define N_MAX (int) (5e5)
#define NODES_MAX (int) (4 * N_MAX * log2(N_MAX))
#define mp make_pair
#define INF (int) 1e9
// #pragma GCC optimize "O4"
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef unorde... | C++ | 6c3c738a1f895b9ede9378a515112861 | 108db820de8a1f023546ed78946f6f46 | 2,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using pii=pair<int,int>;
const int MX=500005;
#define cin SELF_DEFINED_ISTREAM
#define cout SELF_DEFINED_OSTREAM
#define endl '\n'
int N,a[MX],B,pos[MX],Q,ans[MX],cnt[MX];
vector<int> S;
bool vis[MX];
struct Ques{int l,r,id,posl;}q[MX];
struct Istream... | C++ | 6c3c738a1f895b9ede9378a515112861 | 60502d61951dd55163df96e040a2db8e | 2,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using pii=pair<int,int>;
const int MX=500005;
#define cin SELF_DEFINED_ISTREAM
#define cout SELF_DEFINED_OSTREAM
#define endl '\n'
int N,a[MX],B,pos[MX],Q,ans[MX],cnt[MX];
vector<int> S;
bool vis[MX];
struct Ques{int l,r,id,posl;}q[MX];
struct Istream... | C++ | 6c3c738a1f895b9ede9378a515112861 | 2b8031de745db12401f9dea2dee0956b | 2,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using pii=pair<int,int>;
const int MX=500005;
#define cin SELF_DEFINED_ISTREAM
#define cout SELF_DEFINED_OSTREAM
#define endl '\n'
int N,a[MX],B,pos[MX],Q,ans[MX],cnt[MX],P[MX],*S=P;
bool vis[MX];
struct Ques{int l,r,id,posl;}q[MX];
struct Istream
{
... | C++ | 6c3c738a1f895b9ede9378a515112861 | eb070b76d6c782c8bdfcc383e60a64e0 | 2,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
int k;
cin>>k;
int a[26];
int maxa=INT_MIN;
for(int i=0;i<26;i++)
{
cin>>a[i];
maxa=max(maxa,a[i]);
}
long long res=0;
int n=s.length();
for(int i=0;i<n;i++)
{
... | C++ | 85f90533a9840e944deef9f3b4229cb8 | f463f695f6f3bb2dc9fe00ed75da8d53 | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define fast_io ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long int ll;
int main(){
fast_io
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
string s;cin>>s;
int k;cin>>k;
map<char,ll>mp;
int mx=-1;char mxc;
for(char... | C++ | 85f90533a9840e944deef9f3b4229cb8 | 75d33bd36233cc8a404debfb204598ee | 1,000 | PASSED |
#include<iostream>
#include<vector>
#include <stdio.h>
#include<bits/stdc++.h>
#include<algorithm>
#include<cstring>
#include<set>
#include<math.h>
#include <iterator>
using namespace std;
int main(){
char ch[1001];
cin>>ch;
int k;
cin>>k;
vector<int> a;
for(int i=0;i... | C++ | 85f90533a9840e944deef9f3b4229cb8 | 6fc4ea8fca0e831f3d0d57436a2d3ff0 | 1,000 | PASSED |
/*In the name of ALLAH, Most Gracious, Most Merciful*/
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define PI 2*acos(0.0)
#define sqr(x) (x)*(x)
#define EPS 10E-10
... | C++ | 85f90533a9840e944deef9f3b4229cb8 | 879172fa9df38e4d918e788e8b06728d | 1,000 | PASSED |
#include<iostream>
#include<sstream>
#include<iterator>
#include<cstdio>
#include<algorithm>
#include <random>
#include<cstring>
#include<string>
#include<set>
#include<vector>
#include<bitset>
#include<climits>
#include<queue>
#include<iomanip>
#include<cmath>
#include<stack>
#include<map>
#include<ctime>
#include<new... | C++ | 85f90533a9840e944deef9f3b4229cb8 | 5184c24faa817b5f19cc9c308d6546ed | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;cin>>s;
int k;cin>>k;
int n=s.length();
int val[26];for(int i=0;i<26;i++)cin>>val[i];
int max=0;
for(int i=0;i<26;i++)max=(val[i]>max)?val[i]:max;
int res=0;
for(int i=0;i<n;i++)res+=(i+1)*val[s[i]-97];
res+=max*(k*n... | C++ | 85f90533a9840e944deef9f3b4229cb8 | b8804a2e3f41a328632d72c4f2bd4fd4 | 1,000 | PASSED |
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<string>
#include<algorithm>
#include<math.h>
#include<iomanip>
#include<vector>
#include<queue>
#include<deque>
#include<list>
#include<set>
#include<map>
#include<bitset>
#include<iterator>
#include <stack>
#define outfile freopen("", "w", s... | C++ | 85f90533a9840e944deef9f3b4229cb8 | e7a379c9bbda696b704c7bc6391bf888 | 1,000 | PASSED |
#include<bits/stdc++.h>
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define forN(i, n) for(int i = 0; i <n ; ++i)
#define endl "\n"
typedef long long ll;
using namespace std... | C++ | 85f90533a9840e944deef9f3b4229cb8 | 683b8ca324a312bf8e1756e3d91fbd19 | 1,000 | PASSED |
#include <bits/stdc++.h>
using namespace std;
string s;
int k;
int values[26];
vector<int> rem ;
int main(){
cin >> s;
cin >> k;
int ans = 0;
for (int i = 0 ; i<26 ; i++){
cin>>values[i];
}
for (int i = 0 ; i<=s.size();i++){
ans+=(i+1)*values[s[i]-'a'];
}
int m = *max_el... | C++ | 85f90533a9840e944deef9f3b4229cb8 | 63463cae7ed8bed6faa98ddfe3b1a534 | 1,000 | PASSED |
#include <bits/stdc++.h>
using namespace std;
string s;
int k;
int values[26];
vector<int> rem ;
int main(){
cin >> s;
cin >> k;
int ans = 0;
for (int i = 0 ; i<26 ; i++){
cin>>values[i];
}
for (int i = 0 ; i<=s.size();i++){
ans+=(i+1)*values[s[i]-'a'];
}
sort(values, va... | C++ | 85f90533a9840e944deef9f3b4229cb8 | 2533c093cad3fce411d72137852b0766 | 1,000 | PASSED |
// In the name of God
// Code by: mrMaster
#include <bits/stdc++.h>
using namespace std;
#define int long long
string s;
int res = 1;
vector<int>v;
main()
{
cin >> s;
v.push_back(0);
for(int i=0;i<s.size()-1;++i)
if((s[i]-'0')+(s[i+1]-'0') != 9)
v.push_back(i+1);
v.push_back(s.size());
for(int i=0;i<v.s... | C++ | bb1e110a7f53e6f7d43ddced7407f3d1 | c3ab1a3a7e965df01739e8a4ca4a7fb8 | 1,500 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.