uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6d5a4ce1-aa27-436f-b943-e8db32767678 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_11915_11.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 7, M = 1e6 + 7;
int row[N], col[N];
long long dpc[M], dpr[M];
int main() {
priority_queue<int> pqc, pqr;
int n, m, k, p;
scanf("%d %d %d %d", &n, &m, &k, &p);
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
int a;
scan... | ALGO | 0.999909 | 3.29113 |
1067268a-132c-49c6-a9af-eecf305facc7 | r4pidstart/problems | by_category/greedy/28324.cpp | // https://www.acmicpc.net/problem/28324
// 2024-01-21 09:21:28
#include"bits/stdc++.h"
using namespace std;
int main(void)
{
#ifdef LOCAL
#endif
int n; scanf("%d", &n);
vector<int> arr(n);
for(int i=0; i<n; i++)
scanf("%d", &arr[i]);
reverse(arr.begin(), arr.end());
long sum=0, now=1;... | ALGO | 0.999933 | 3.896219 |
7d8b2403-6b26-4880-af47-dfb3660cf1f3 | mmints/hibpm | src/hibpm/Unary/AtMostThree.cpp | /**
* @author: Mark O. Mints
* @email: <EMAIL>
*/
#include "../Unary.hpp"
namespace hibpm {
AtMostThree::AtMostThree(size_t sigmaSize, Event &event)
: Unary(sigmaSize, event) {
m_type = AT_MOST_THREE;
m_constraintTypeString = "AtMostThree";
m_automaton = Automaton(5, sigmaSize);
AtMostThree::initialize... | ALGO | 0.996099 | 6.777406 |
daa8b9e8-a609-494d-ab99-a5175ffd44e9 | prathyushadamarla/conditionals_and_loops | numberPattern1.cpp | /*
Print the following pattern
Pattern for N = 4
1
23
345
4567
*/
#include<iostream>
using namespace std;
int main() {
int n;
cout<<"Enter N:"<<endl;
cin>>n;
for(int i=1;i<=n;i++) {
for(int j=1;j<=i;j++) {
cout<<(j+i-1);
}
cout<<endl;
}
return 0;
}
| ALGO | 0.999808 | 4.471673 |
aeb9dc1d-642c-407f-81ee-32caee1f7b54 | nemo-i/Algorithms-Problem-Solving-Level-2 | DigitFrequency.cpp |
#include "MyMathLib.h"
#include <string>
#include<iostream>
using namespace std;
// my way
int DigitFrequency(int number,int wholeNumber) {
int reminder;
int repate = 0;
while (wholeNumber >0)
{
reminder = wholeNumber % 10;
if (reminder == number) {
repate = repate+1;
}
wholeNumber = wholeNumber / 10... | ALGO | 0.997396 | 3.852445 |
a5d48ada-d76b-48a4-ac49-8cd76703b592 | jolho/challenges | projecteuler/0047/0047.cpp | #include <set>
#include <iostream>
using namespace std;
#define PRIMELIM 1000000
#define DISTINCT_TARGET 4
set<int> composites[PRIMELIM];
void build_composites()
{
for(int i=2;i<PRIMELIM;i++)
{
if(composites[i].size()==0)
{
for (int j=i*2;j<PRIMELIM; j+=i)
{
composites[j].insert(i);
}
}
}
}
i... | ALGO | 0.997286 | 3.759357 |
7653aab1-3029-46bd-89b2-a1e85af65779 | Prafful-Goyal/6companies30days | Day13/2.Friends Of Appropriate Ages.cpp | //PROBLEM STATEMENT
/*
There are n persons on a social media website. You are given an integer array ages where ages[i] is the age of the ith person.
A Person x will not send a friend request to a person y (x != y) if any of the following conditions is true:
age[y] <= 0.5 * age[x] + 7
age[y] > age[x]
age[y] > 100 && ... | ALGO | 0.997369 | 5.482983 |
fcaaa4db-dcf7-478d-a425-7896ba549e9d | TrifanBogdan24/Probleme-PBINFO | pbinfo/coduri-cpp/clasa-XI/traseucalmax.cpp | // #2244 - TraseuCalMax
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("traseucalmax.in");
ofstream g("traseucalmax.out");
int n, m, Max = -1, a[15][15], M[15][15];
int dx[8] = {2, 2, 1, 1, -1, -1, -2, -2};
int dy[8] = {1, -1, 2, -2, 2, -2, 1, -1};
struct nod {
int l, c;
};
nod st[600];
... | ALGO | 0.999989 | 3.988079 |
5a4720f3-296f-4eee-8b55-9731b579ed95 | trietvuive/CF_Practice | CodeForces/old/1602A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int tc;
cin >> tc;
while (tc--)
{
string s; cin >> s;
char mn = 'z';
int mn_index = -1;
for (int i = 0; i < s.size(); ++i)
if (s[i] <= mn) mn = s[i], mn_index = i;
cout << mn << ' ';
for (int i = 0; i < s.size(); ++i)
if (i != mn_index)cout... | ALGO | 0.999897 | 3.721789 |
7e902f3d-45f3-4b91-9293-1b952f950d81 | Arnie09/Codechef | rainbow array.cpp | #include<iostream>
#include<math.h>
#include<vector>
using namespace std;
int countFact(int n, int p)
{
int k=0;
while (n>=p)
{
k+=n/p;
n/=p;
}
return k;
}
long long pow(int a, int b,int MOD)
{
long long x=1,y=a;
while(b > 0)
{
if(b%2 == 1)
{
... | ALGO | 0.999993 | 4.487404 |
282eabb6-2972-4cdc-8791-a661c06cf726 | shruti-nahar14/DataStructure | dnfsort.cpp | #include<iostream>
using namespace std;
void dnfsort(int arr[],int n)
{
int low=0;
int mid=0;
int high=n-1;
while(mid<=high)
{
if(arr[mid]==0)
{
swap(arr[low],arr[mid]);
low++;
mid++;
}
else if(arr[mid]==1)
{
mid++;
}
... | ALGO | 0.999961 | 4.614299 |
3c75ec6f-6fe1-45bb-83c5-d0fb870fe2da | piyush14298/A2OJ | CodeChef/incrdec.cpp |
///////////////// ____ ___ _ _ _ *******************************
///////////////// | _ \_ _/ | || | *******************************
///////////////// | |_) | || | || |_ *******************************
///////////////// | __/| || |__ _| ... | ALGO | 0.999991 | 4.589334 |
83af32bf-a662-4759-915a-e7b6f63aa97a | aquemy/TaskAssignment | src/SIF/ia/model/manualModel.cpp | namespace sif
{
template <int Dim, class Type>
ManualModel<Dim, Type>::ManualModel(Strategy<Dim, Type>& _currentStrategy) :
Model<Dim, Type>(_currentStrategy)
{
}
template <int Dim, class Type>
void ManualModel<Dim, Type>::update(double _time, SpatialData& _spatialData, C... | ALGO | 0.958454 | 5.488697 |
a635189e-a369-4623-87fb-db13c753405c | kitano-kazuki/leetcode | 112_path_sum.cpp | struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right)
: val(x), left(left), right(right) {}
};
#include <vector>
using namespace std... | ALGO | 0.999898 | 6.416589 |
59f5febb-50a2-4107-8b98-74d6ef581453 | Sakshibagul7/Cpp_Series | Striver A2Z c++ cource/Arrays/SingleNO.cpp | #include<bits/stdc++.h>
using namespace std;
// Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.
// You must implement a solution with a linear runtime complexity and use only constant extra space.
// Example 1:
// Input: nums = [2,2,1]
// Output: 1
// Example... | ALGO | 0.9989 | 5.510845 |
bf7d592a-f9d7-4a26-b3a0-c0bb0e4dcc99 | AYUSHRAJ6623/CPP-and-DSA | SumUptoN.cpp | // Write a C++ program to find sum of number upto n using while loop !!
#include<iostream>
using namespace std;
int main(){
cout<<"Enter the value of N :- ";
int N;
cin>>N;
int i=1;
int sum=0;
while (i<=N)
{
sum=sum+i;
i++;
}
cout<<"Sum of number upto N is"<<" :- "<<s... | ALGO | 0.999678 | 3.123222 |
68be8361-0f9d-4a4e-b8bf-2f1816082cfc | tcadigan/reginleif | challenges/uva/uva_424.cpp | #include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main(){
string input;
vector<string> list;
unsigned int length = 0;
cin >> input;
while(input != "0"){
if(input.length() > length){
length... | ALGO | 0.999887 | 4.552796 |
c7d5d7c7-d3d7-41a4-a712-2e69e583c96b | betelqeyza/Zmem-cpp | src/utils.cpp | #include <fmt/core.h>
#include <fcntl.h>
#include <unistd.h>
#include <vector>
namespace utils
{
std::string format_size(uint64_t size)
{
const std::string units[] = {"kB", "MB", "GB", "TB"};
double size_f = size;
auto unit_index = 0;
while (size_f >= 1024.0 && unit_index < 3)
{
size_f /= 1024.0;
un... | TOOL | 0.966357 | 5.554369 |
11552c7d-8d1c-42f8-a923-3d56a357bf08 | zjkmxy/algo-problems | 平成26年/其他DP/POJ3230.cpp | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
#define MAXN 105
#define MAXI 0x0fffffff
int n, m;
int dp[MAXN][MAXN]; //nڵmԺöǮ
int fee[MAXN][MAXN], profit[MAXN][MAXN];
int calc()
{
int i, j, k;
for(i=0;i<=n;i++)
{
dp[i][m] = profit[m][i];
}
for(j=m-1;j>=0;j--)
... | ALGO | 0.999878 | 3.056228 |
b2be2f41-433a-4a7d-a24a-603583656891 | ned14/boost-release | libs/math/example/find_scale_example.cpp | // find_scale.cpp
// Example of finding scale (standard deviation) for normal (Gaussian).
// Note that this file contains Quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
//[find_scale1
/*`
First we need some includes to access the __normal_distrib,
the algorithms ... | ALGO | 0.998755 | 6.68025 |
3e826feb-7883-4073-9165-c24ecb23cd41 | toby4548/CarND-Path-Planning-Project-P11 | src/Eigen-3.3/unsupported/test/BVH.cpp | #include "main.h"
#include <Eigen/StdVector>
#include <Eigen/Geometry>
#include <unsupported/Eigen/BVH>
namespace Eigen {
template<typename Scalar, int Dim> AlignedBox<Scalar, Dim> bounding_box(const Matrix<Scalar, Dim, 1> &v) { return AlignedBox<Scalar, Dim>(v); }
}
template<int Dim>
struct Ball
{
EIGEN_MAKE_ALIGN... | TEST | 0.989561 | 6.337957 |
c6f2b00d-2243-4d36-ba73-e0a08faaf015 | TensorMD/lammps-tensormd | src/KOKKOS/improper_class2_kokkos.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Ray Shan (Materials Design)
------------------------------------------------------------------------- */
#include "improper_class2_kokkos.h"
#include <cmath>
#include "atom_kokkos.h"
#include "neighbo... | ALGO | 0.99477 | 7.547245 |
1f6178b0-2294-4c9c-a38d-e4220d28cfb5 | VPetrova00/Data-structures-and-algorithms | fmi/fmi tests/02.test/correctiveArrangement.cpp | #include <cmath>
#include <set>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int N;
vector<int> sortVect;
set<int> uniques;
void mergeAll(vector<int>& arr, int left, int mid, int right) {
vector<int> leftArr;
vector<int> rightArr;
for(int i = left; i <... | ALGO | 0.999992 | 5.018197 |
6e8b7ccb-dd5d-4d82-9435-53d92dd37abc | mercersFIRE/Saved-code | Shohag Loves XOR (Easy Version).cpp | #include "bits/stdc++.h"
#define pb push_back
#define ff first
#define ss second
#define endl "\n"
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
using namespace std;
typedef long long ll;
const ll N=1e6+7;
vector<ll>prime,spf(N);
void seive()
{
for (ll i = 1; i ... | ALGO | 0.999789 | 4.263583 |
4d4f1cfc-f319-430c-ba20-8f3fb75c18a7 | enmccarthy/mpi_test | transpose.cpp | #include <iostream>
#include "mpi.h"
#include <fstream>
#include <sstream>
#include <vector>
#include <cstring>
#include <string>
#include <cassert>
#include "common.hpp"
void transpose_matrix(std::vector<short> &buf,
hsize_t *dims) {
auto transposed = buf;
auto get_offset = [&](hsize_t i, h... | DATA | 0.945154 | 4.93468 |
943ad5ca-83df-41fd-8dfa-426abe478d15 | MichalMroz21/Competitive-Programming | Leetcode/389.cpp | class Solution {
public:
char findTheDifference(string s, string t) {
char ret = '\0';
for(auto& i : s) ret ^= i;
for(auto& i : t) ret ^= i;
return ret;
}
}; | ALGO | 0.999948 | 6.390147 |
a4415c4f-2e1b-434f-85e0-184bb0c1ec78 | sayan112/Leetcode_Sayan | 0128-longest-consecutive-sequence/0128-longest-consecutive-sequence.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
unordered_set<int>st;
for(auto elem: nums)
{
st.insert(elem);
}
int count =1;
int longest=0;
for(auto elem : nums)
{
if(st.find(elem-1)==st.end())
... | ALGO | 0.999949 | 5.631118 |
4afa7b23-f508-49c3-997b-8c4ea2461ccf | julienr/zoob | project/jni/logic/ShadowPolygon.cpp | #include "ShadowPolygon.h"
#include "logic/physics/CollisionManager.h"
#include "logic/Level.h"
#include "lib/Line.h"
//We want the shadow to cover everything.. Since the logical game is 15 by 10, 50 will pretty much cover everything
//beware though, don't put this TOO CLOSE to 15 because shadows might extends in diag... | ALGO | 0.90561 | 6.295175 |
47dec8d1-f793-4cb5-b486-3e8c1017422b | Anuragrathi0001/DS-ALGO_CPP | basicRecursions/re16.cpp | #include <bits/stdc++.h>
using namespace std;
bool checkPalindrome(string a, int i) {
// Base case: Stop when the pointers meet or cross
if (i >= a.length() / 2)
return true;
// If characters at both ends don't match, it's not a palindrome
if (a[i] != a[a.length() - 1 - i])
return fals... | ALGO | 0.999812 | 5.706219 |
2c5bb124-7151-497e-a0f1-852489de7c72 | woohyunjng/Coding-Practice | CP/Codeforce/Round 868/D.cpp | #include <bits/stdc++.h>
#define int long long
#define MAX 200100
#define MOD 1000000007
#define INF 0x7f7f7f7f7f7f7f7f
#define endl '\n'
using namespace std;
typedef pair<int, int> pr;
typedef array<int, 3> tp;
int X[MAX], C[MAX];
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
... | ALGO | 0.999924 | 4.061448 |
7c1ba492-1329-4403-a3bc-aceb396223de | GFG-CLUB-KIIT/100-Days-of-Code | Shashi Kiran/Day 13/abc208_b.cpp | // Problem: B - Factorial Yen Coin
// Contest: AtCoder - AtCoder Beginner Contest 208
// URL: https://atcoder.jp/contests/abc208/tasks/abc208_b
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
using namespace std;
#define int long l... | ALGO | 0.999752 | 4.455898 |
e6240e00-ca14-4bb5-b2fe-a96797a1a6fd | anishakd4/ds | BinaryTree/LongestCommonAncestor/1LowestCommonAncestorInABinaryTreeSet13.cpp | #include<iostream>
using namespace std;
struct Node{
int data;
Node *left, *right;
};
Node* newNode(int data){
Node* new_node = new Node;
new_node->data = data;
new_node->left = new_node->right = NULL;
return new_node;
}
bool find(Node* node, int k){
if(node == NULL){
return fals... | ALGO | 0.999979 | 5.305536 |
7194650c-d91e-4b35-9c59-2793a3894b1a | vpatrikov/programing-exercises | C++/print_triangle.cpp | #include <iostream>
using namespace std;
int main ()
{
int size;
cout << "Enter the size of your triangle: ";
cin >> size;
for (size_t i = 1; i < size + 1; i++)
{
for (size_t j = 0; j < i; j++)
{
cout << "*";
}
cout << endl;
}
} | ALGO | 0.998112 | 4.494038 |
da76d379-57c2-4d43-b78c-2b52902efb28 | Nitika3277/day01 | 4.cpp | #include<iostream>
using namespace std;
int main(){
char ch;
cin>>ch;
if(ch=='A' || ch=='E' || ch=='I' || ch=='O' || ch=='U' || ch=='a' || ch=='e' || ch=='i' || ch=='o'|| ch=='u'){
cout<<"Vowels";}
else
cout<<"Consonants";}
| ALGO | 0.994098 | 3.511194 |
0a9adc9e-1d89-41b1-a1b2-8ab1baf1aa12 | elvinMark/eNeural | src/eMLPClassifier.cpp | #include <iostream>
#include <vector>
#include <math.h>
#include <eMath.hpp>
#include <eNeural.hpp>
using namespace std;
using namespace emath;
enn::eMLPClassifier::eMLPClassifier(std::vector<int> structure,int act_fun) {
for(int i = 0;i<structure.size()-1;i++){
this->add(new eLinear(structure[i],structure[i+1]... | ALGO | 0.988793 | 3.708705 |
9e6e028c-7b56-47b5-9692-c212b299aea7 | digoal/VecDB-Exp | faiss/faiss/utils/distances_simd.cpp | // -*- c++ -*-
#include <faiss/utils/distances.h>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <faiss/impl/FaissAssert.h>
#include <faiss/impl/platform_macros.h>
#include <faiss/utils/simdlib.h>
#ifdef __SSE3__
#include <immintrin.h>
#endif
#ifdef __aarch64... | ALGO | 0.999266 | 6.285138 |
9ea80f6f-636d-42fb-a621-6c74c89efa9b | Angelzaki/BOOKIE-APP-GROUP-H-3-15 | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
fbe9e98d-ec4d-4d0d-8073-8b9d98407533 | iyangzy/LeetCode | 剑指offer/字符串的排列.cpp | #include <iostream>
#include <vector>
#include <set>
using namespace std;
// 按照书上的解法来的,但是力扣对题目做了改动,稍微改动后超时
// 为解决超时,采取的措施
// 递归从str.length()减少到str.length() - 1
// 不使用set去重,递归过程中实时剪枝
// 采取了以上策略还是超时。。。。。。
// 最最最最最最最后,是把函数参数改为全局变量,减少回调传参得以AC,之前不晓得这样还能减少不少时间
vector<string> arr;
string str;
void recur(int index)
{
if (i... | ALGO | 0.999931 | 5.020284 |
819ab3c3-2001-418e-bf7d-2b7bd37548d8 | AviShtarkberg/MST-SERVER | KruskalMST.cpp | #include "KruskalMST.h"
KruskalMST::KruskalMST(const Graph& graph) : graph(graph), mst_weight(0) {}
void KruskalMST::solve() {
int V = graph.getVertices();
auto edges = graph.getEdges();
// Sort edges by weight
std::sort(edges.begin(), edges.end(), [](const auto& a, const auto& b) {
return st... | ALGO | 0.999973 | 6.830362 |
4c7aada3-612a-44be-bae3-cdf6fbdeddc0 | ishandutta2007/codeforces | pavement/normal/1304/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
main() {
ios::sync_with_stdio(0);
cin.tie(0);
int t, x, y, a, b;
cin >> t;
while (t--) {
cin >> x >> y >> a >> b;
int lo = 0, hi = 1e9, ans = -1;
while (lo <= hi) {
int mid = (lo + hi) >> 1;
if (x + a * mid >= y - b * mid) {
ans =... | ALGO | 0.999967 | 3.680694 |
e0d14da6-d3eb-48a3-8b23-67409e1f58fe | Bobby999123/competitive-coding | 3_Character_Arrays_String/3_count_digit_space.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
//here we have to count the space alphabets and digit
char ch;
ch=cin.get();
int digit=0;
int alphabets=0;
int space=0;
while(ch!='\n'){
if(ch>='0' an... | ALGO | 0.977718 | 3.156307 |
4c535869-a32a-4e69-a13f-864e293f9b1a | meghna2808/Coding | groupAnagrams.cpp | class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strs) {
int size=strs.size();
map<string,vector<string>>m;
for(int i=0;i<size;i++)
{
string str=strs[i];
sort(str.begin(),str.end());
m[str].push_back(strs[i]);
}... | ALGO | 0.999991 | 6.398263 |
895cee1f-fa89-4da7-9abb-aa3264a369c4 | Mhmd-Hisham/Problem-Solving | URI/Beginner/Twilight at Portland.cpp | #include <bits/stdc++.h>
using namespace std;
int N = 0, n;
string s;
int main () {
cin >> N;
bool block[N+1][N+1];
for (int i = 0;i < N+1; i++){
for (int j = 0; j < N+1; j++){
cin >> block[i][j];
}
}
for (int i = 0;i < N; i++){
for (int j = 0; j < N; j++){
n = 0;
if (block[i][j]) n++;
if (... | ALGO | 0.999811 | 3.843157 |
e6aedcd9-4d68-4a66-87e8-480ad5e35bb4 | anashali01/Cpp | Day - 9/prog2.cpp | #include <iostream>
using namespace std;
int main()
{
int num;
cout << "Enter a number: ";
cin >> num;
cout << "The factors of " << num << " are: ";
for (int i = 1 ; i <= num ; i++)
{
if (num % i == 0 )
{
cout << i << " " ;
}
}
return 0;
} | TOOL | 0.905643 | 3.447659 |
32ef44f0-d40e-47ac-9c2d-29d01eab2321 | Therealchainman/archive-cp | codejam/2021/1A/append-sort.cpp | #include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <regex>
#include <set>
#include <chrono>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#... | ALGO | 0.999735 | 5.133556 |
2a86dbc4-1e89-43f7-b50c-00df3084dbcd | sooglejay/geeksforgeeks | 名企面试题/(a^i)(b^j)(c^k)型的子序列个数.cpp | //
// Created by sooglejay on 17/4/15.
//
//http://practice.geeksforgeeks.org/problems/count-subsequences-of-type-ai-bj-ck/0
//
// Input : abbc
// Output : 3
// Subsequences are abc, abc and abbc
//
// Input : abcabc
// Output : 7
// Subsequences are abc, abc, abbc, aabc
// ... | ALGO | 0.999007 | 4.718401 |
0c8bb94f-c582-4de9-b03c-00f855ab4fea | tycoon168/Home-Automation | tree.cpp | #include<iostream>
using namespace std;
struct node
{
int info;
struct node *next;
struct node *right;
};
struct node *tree=NULL;
void create(int value )
{
if(tree==NULL)
{
struct node s1,*ptr;
ptr=&s1;
cout<<endl<<endl<<"ptr value : "<<ptr<<endl<<endl;
ptr->info=value;... | ALGO | 0.994762 | 3.062994 |
e2b4c3fe-c8d3-44a7-8e1f-e8f9ff31cc06 | wavydavy7/Competitive-Programming-Solutions | CompProgramming/dump/test.cpp | #include <iostream>
#include <vector>
#include <algorithm>
int valid(long long n, long long k, long long m, long long x) {
long long g = 0;
while(k > 0 && g < n) {
long long y = (n - g) / x;
if(y < m) {
long long leftover = (n-g + m-1) / m;
return leftover <= k;
}
long long maxmatch = ... | ALGO | 0.999985 | 4.055029 |
c3bf097e-87b8-46da-a0d4-8a031af1496a | Zhaoyibinn/LVI-SAM-Study | 相关环境/gtsam/gtsam_unstable/dynamics/PoseRTV.cpp | /**
* @file PoseRTV.cpp
* @author Alex Cunningham
*/
#include <gtsam_unstable/dynamics/PoseRTV.h>
#include <gtsam/geometry/Pose2.h>
#include <gtsam/base/Vector.h>
namespace gtsam {
using namespace std;
static const Vector kGravity = Vector::Unit(3,2)*9.81;
/* ****************************************************... | ALGO | 0.907174 | 7.541789 |
5c48a180-8687-46a4-b7b2-c9f678278d89 | MeMrBerlin/Placement_help | Coding Platforms(codechef,codeforces,etc)/CodeChef/Practice/Finding Square Roots.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int t;
cin>>t;
while(t--){
int n;
cin>>n;
int result;
result= sqrt(n);
cout<<result<<endl;
}
}
| ALGO | 0.99996 | 4.391944 |
8ba7b39d-c05a-4bc0-a622-d92f7b42cab7 | ehusky/try-cpp | leetcode/leetcode/lc_busyStudent.cpp | #include "leetcode.h"
int Solution::busyStudent(std::vector<int>& startTime, std::vector<int>& endTime, int queryTime)
{
int num_students = 0;
for (std::vector<int>::iterator iter_i = startTime.begin(), iter_j = endTime.begin(); iter_i != startTime.end(); iter_i++, iter_j ++)
{
if (*iter_i <= queryTime && *iter_j... | ALGO | 0.99951 | 5.660809 |
18d6f015-59a7-4487-8081-e9ec9cbabefc | MDRobiulhassan/Codeforces | 1675A.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int a, b, c, x, y;
cin >> a >> b >> c >> x >> y;
int a2, b2;
if (a < x)
a2 = abs(x - a);
else
a2=0;
if (b < y)
b... | ALGO | 0.997419 | 3.361397 |
57c3f791-0da2-4a06-b269-99f4f6ed808e | AS-Data-Analysis/Research-Project-ISAE | catkin_ws/src/mrs_lib/src/rheiv/example.cpp | // clang: MatousFormat
/** \file
\brief Example file for the RHEIV implementation
\author Matouš Vrba - <EMAIL>
This example may be run after building *mrs_lib* by executing `rosrun mrs_lib rheiv_example`.
A plane surface model in the cartesian form \f$ a x + b y + c z + d = 0 \f$ will be used in... | ALGO | 0.987406 | 6.311538 |
6d69e128-4086-489d-bade-2f4785ffd8b3 | Amritpal2001/-6Companies30days | Microsoft/15.alien language.cpp | void dfs_topo(vector<int> adj[], int s, bool visited[], string &res)
{
visited[s] = true;
for (auto i : adj[s])
if (!visited[i])
dfs_topo(adj, i, visited, res);
res.push_back(s + 'a');
}
string findOrder(string dict[], int N, int K)
{
//code here
vector<int> adj[K];
for (int... | ALGO | 0.999977 | 5.359883 |
f776be6d-c76e-43be-b3bb-09d3c5068ce0 | steven112163/Cryptology | Cryptology-HW4/rsa-decrypt.cpp | // 0510002
// Steven Yuan
#include "stdafx.h"
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
using namespace std;
#include <integer.h>
#include <rsa.h>
#include <osrng.h>
#pragma comment(lib, "C:\\Cryptopp\\x64\\Output\\Release\\cryptlib.lib")
using namespace CryptoPP;
string decrypt(R... | ALGO | 0.99821 | 4.271908 |
44de123e-b573-461e-a875-d911bb46275a | teddy-teem/Competitive-Programming | Dynamic Programming/Knapsak/Problems/10130-uva.cpp | #include <bits/stdc++.h>
#define F_READ freopen("input.txt", "r", stdin);
#define F_WRITE freopen("output.txt", "w", stdout);
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
#define PB push_back
#define F first
#define S second
#define REP(i, a, b) for (int i = a; i <= ... | ALGO | 0.999492 | 3.356862 |
316b1386-4fd1-463a-b5d5-d9972bdf31f1 | Es7evam/Problem-Solutions | CodeBackup/Estevam/codeforces/112-A/112-A-26720012.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 0x3f
#define fastcin ios_base::sync_with_stdio(false)
typedef long long ll;
int main(void){
#ifndef ONLINE_JUDGE
freopen("inp.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif
string one, two;
cin >> one >> two;
std::transform(one.begin(),... | ALGO | 0.999989 | 3.319955 |
bff8aa73-8ad3-4823-a34e-8803717ff005 | sinian666/code_102_6 | cpp_副本31/chapter_stack_and_queue/deque.cpp | /**
* File: deque.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* Driver Code */
int main() {
/* 初始化双向队列 */
deque<int> deque;
/* 元素入队 */
deque.push_back(2);
deque.push_back(5);
deque.push_back(4);
deque.push_front(3);
deque.push_fron... | TEST | 0.914321 | 5.774346 |
6c812e8f-181a-4d2d-9223-cdd4ed19dfb5 | YogithaSelvam/LeetCode-Problems | 0035-search-insert-position/0035-search-insert-position.cpp | class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int low=0, high= nums.size()-1;
while(low<=high){
int mid = (low+high)/2;
if(nums[mid]==target)
return mid;
else if (nums[mid]>target)
high = mid-1;
... | ALGO | 0.999955 | 6.346191 |
45d3ce82-a702-4a1b-9458-0771a68043bd | ChangJun1/LuoGuCPP | P1152.cpp | // https://www.luogu.com.cn/problem/P1152
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
vector<int> dif(n - 1);
cin >> a[0];
for (int i = 1; i < n; ++i) {
cin >> a[i];
dif[i - 1] ... | ALGO | 0.999912 | 4.177686 |
8b132aec-1484-4da8-beac-63b58119e287 | KhursheedAK/C-plus-plus-Work | Pointers/arithmetic.cpp | #include <iostream>
using namespace std;
int main()
{
int num [] {10,20,30,40,-1};
int *num_ptr {nullptr};
num_ptr = num;
while(*num_ptr != -1)
{
cout<<*num_ptr++<<endl;
}
cout<<endl; // Worked because null terminator at the end of array
cout<<"num_ptr value is: " << *num_ptr ... | TOOL | 0.996238 | 4.078216 |
36d1bcec-2a57-419a-911e-1ca7a80edcf1 | dharmik-anghan/Bootcamp-in-C | Assignment-26/9.cpp | #include <iostream>
using namespace std;
class Bill
{
private:
float unit, bill, x = 1.5, y = 2, z = 3;
int ac;
public:
Bill()
{
}
void get()
{
int a;
float u;
cout<<"Enter A/C and Units: "<<endl;
... | TOOL | 0.890897 | 4.158432 |
f1322e09-ed20-4fbb-a75e-30c220856a03 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-coop-gpt35/Codenet/p00726/671362070/original.cpp | #include <cstdlib>
#include <iostream>
#include <string>
int cket(std::string &str, int i) {
int n = 1;
for (; i < str.size(); ++i) {
if (str[i] == '(')
n++;
if (str[i] == ')')
n--;
if (n == 0)
break;
}
return i;
}
int n;
char expand(std::string str) {
std::string res;
for (int... | ALGO | 0.999795 | 4.480397 |
8d3a36f5-6e39-48b3-93e3-90a31d1c4eff | kaner918/competitive-programming | online judge.kaner murillo/c++/13177.cpp | //https://onlinejudge.org/external/131/13177.pdf
//13177
#include<cstdio>
#include<iostream>
#include<queue>
#include<math.h>
using namespace std;
class Musician{
public:
int number;
int calculation;
int division;
Musician(){}
Musician(int a, int b, int c){
... | ALGO | 0.999919 | 3.168905 |
54361759-126b-4fdc-bdcd-a95dc3258f06 | Friox/study-algorithm | goorm/deepdive/12-graph-theory/03-union.cpp | #include <cstdio>
#include <vector>
#include <set>
using std::vector;
struct Edge {
int A, B;
bool operator<(const Edge &e) const {
if (B == e.B) return A < e.A;
return B < e.B;
}
};
class UnionFind {
vector<Edge> edges;
vector<int> parent;
public:
UnionFind(int N) {
... | ALGO | 0.999866 | 5.009336 |
4e5f8695-c1c9-4872-8f0a-023a157123fc | shermz-lim/kattis-problems | bestrelayteam.cpp | #include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
struct Runner {
string name;
double first;
double other;
};
bool compare(Runner r1, Runner r2){
return r1.other<r2.other;
}
int main() {
int n;
cin>>n;
Runner arr[n];
for(int i=0;i<n;i++) cin>>arr[i]... | ALGO | 0.999993 | 3.768853 |
549870c8-757c-41eb-ace2-1267590320fb | aliozanyerli/leetcode_problems | Fill the Matrix - GFG/fill-the-matrix.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
//User function Template for C++
class Solution{
public:
int minIteration(int n, int m, int x, int y){
// code here
queue<pair<int,int>>q... | ALGO | 0.999903 | 5.583416 |
5bff982d-99ba-4071-959d-30ef83a55c23 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_8580_6.cpp | #include <bits/stdc++.h>
const int MAXN = 1005;
int a[MAXN];
int cnt[MAXN];
int main() {
int n, k;
while (scanf("%d%d", &n, &k) + 1) {
memset(cnt, 0, sizeof(cnt));
for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
if ((j - i) * k... | ALGO | 0.99989 | 3.075118 |
61a510f0-0f86-44fa-ba98-41cd0d212f04 | mariacristina-s/Cplusplus-Program_LAN-Party | ArboreBST.cpp | #include <iostream>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include "ArboreBST.h"
using namespace std;
Arbore::Arbore(Echipa ech) {
echipa = ech;
left = right = NULL;
}
Arbore::Arbore():left(NULL), right(NULL) {
}
Arbore* Arbore::adaugareArbore(Arbore *&tree, Echipa ech) {
... | ALGO | 0.940602 | 4.11411 |
5bff2d9d-1f7b-4420-a64c-05646136a7eb | worldwidee/progress_alert | example/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998848 | 6.76073 |
76ab21d5-d710-4ca2-9e12-ca649822f16d | Takeoff0518/cpp-learning-code | P4170.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#define ll long long
const int N=55,M=1005;
const int INF=0x3f3f3f3f;
const int p=998244353;
using namespace std;
int n;
char s[N];
int f[N][N];
int main(){
scanf("%s",s+1);
n=strlen(s+1);
memset(f,0x3f,sizeof(f));
for(int i=1;i<=... | ALGO | 0.999989 | 4.260588 |
e3ec01ca-8fc2-44ba-953e-7c05339d18aa | rhseung/toonflix-fe | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
ef923d1a-749d-48cb-9692-4b80dac658bb | KaranGaur2112/dsa-cpp | ARRAY/Sorting/insertion_sort.cpp | #include<iostream>
using namespace std;
void display(int A[], int n){
for ( int i = 0; i < n; i++)
{
cout<< " " << A[i];
}
}
void insertionSort(int *A, int n){
int key, j;
for (int i = 1; i <= n-1; i++)
{
key = A[i];
j = i-1;
while(j>=0 && A[j] > key... | ALGO | 0.999964 | 4.840934 |
7b34722b-28df-4777-99f3-a69e6660e57d | Dhruv-vs/Coding-Questions | GFG Questions/BST/Merge two bst.cpp | class Solution {
public:
void inorder(Node* root,vector<int>&ans){
if(!root) return;
inorder(root->left,ans);
ans.push_back(root->data);
inorder(root->right,ans);
}
vector<int> merge(Node *root1, Node *root2) {
vector<int>ans;
inorder(root1,ans);
... | ALGO | 0.999996 | 5.776252 |
18368b38-ffb8-4b08-b9ad-0e1d970761f4 | EricWang007/POJ-PTA | POJ/基本算法/贪心/2586.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
int main() {
int s, d, sum;
while (scanf("%d%d", &s, &d)!=EOF) {
int i;
for (i=1; i<5; i++)
if (d*i > s*(5-i))
break;
if (i=... | ALGO | 0.999858 | 3.886695 |
a0735035-1961-4906-9334-24e44902fda7 | rburchell/skia | src/core/SkLineClipper.cpp | #include "SkLineClipper.h"
// return X coordinate of intersection with horizontal line at Y
static SkScalar sect_with_horizontal(const SkPoint src[2], SkScalar Y) {
SkScalar dy = src[1].fY - src[0].fY;
if (SkScalarNearlyZero(dy)) {
return SkScalarAve(src[0].fX, src[1].fX);
} else {
return s... | ALGO | 0.998892 | 5.677089 |
0b0d2b4f-dc4a-4bc8-8177-00a75160a7a0 | blasbarbagelata/modelo-y-simulacion | TP2/atomics/sources/saw.cpp | #include "saw.h"
void saw::init(double t,...) {
//The 'parameters' variable contains the parameters transferred from the editor.
va_list parameters;
va_start(parameters,t);
A=va_arg(parameters,double);
F=va_arg(parameters,double);
pend=va_arg(parameters,char*);
Method=va_arg(parameters,char*);
dq=va_arg(parameters,doub... | ALGO | 0.97146 | 4.569607 |
caa05c3a-c9b4-4d6d-9f88-acd5fd080a35 | shyamal2411/DSA-Practice | bhagwan_question/LL/DeleteMiddleofLL.cpp | // C++ program to delete middle
// of a linked list
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node* next;
};
void printList(struct Node* ptr) {
while (ptr != NULL) {
cout << ptr->data << "->";
ptr = ptr->next;
}
cout << "NULL\n";
}
int countnodes(struct Node* head... | ALGO | 0.999896 | 5.925162 |
8957a1f8-308d-42b6-b3b7-50307978dd7d | cheaneatine/USTP-BSCS-1st-Year | Second Semester/CS121 - Computer Programming 2/Labs/lab 7/problem1.cpp | /*
+-----------------------------------+
| main() |
+-----------------------------------+
| + counts: int* |
+-----------------------------------+
| + count(const string&): int* |
| + count(const string&, int[], int)|
+-----------------------------------+
|
|
... | ALGO | 0.998271 | 5.550221 |
4b2018c7-5911-4b8d-bd88-48ba110a8029 | jimeiyang/deepRotator | caffe-cedn/matlab/toolbox/detector/private/acfDetect1.cpp | #include "mex.h"
#include <vector>
#include <cmath>
using namespace std;
typedef unsigned int uint32;
inline void getChild( float *chns1, uint32 *cids, uint32 *fids,
float *thrs, uint32 offset, uint32 &k0, uint32 &k )
{
float ftr = chns1[cids[fids[k]]];
k = (ftr<thrs[k]) ? 1 : 2;
k0=k+=k0*2; k+=offset;
}
voi... | ALGO | 0.998652 | 4.608357 |
b9cea627-82d6-4637-ad73-6198e2bdf7d1 | edmont87/albcoin | src/wallet/wallet.cpp | #include <wallet/wallet.h>
#include <chain.h>
#include <consensus/consensus.h>
#include <consensus/validation.h>
#include <fs.h>
#include <interfaces/chain.h>
#include <interfaces/wallet.h>
#include <key.h>
#include <key_io.h>
#include <optional.h>
#include <policy/fees.h>
#include <policy/policy.h>
#include <primitiv... | TOOL | 0.963043 | 4.966663 |
70ae0a34-a71f-42bb-87cb-331351000c78 | Kabachok-Georg/Maestro7IT_cpp | codewars/sum_the_string.cpp | /*
[ Sum The Strings ]
Create a function that takes 2 integers in form of a string as an input, and outputs the sum (also as a string):
Example: (Input1, Input2 -->Output)
"4", "5" --> "9"
"34", "5" --> "39"
"", "" --> "0"
"2", "" --> "2"
"-5", "3" --> "-2"
Notes:
If either ... | ALGO | 0.999437 | 7.077552 |
fffb1ee4-f6ad-45ae-87a9-882a35222da0 | 7hong13/Problem-Solving | BruteForce/2529/2529.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#define MAX 9
using namespace std;
int k;
char signs[MAX];
void init() {
cin.tie(nullptr);
cout.tie(nullptr);
ios_base::sync_with_stdio(0);
}
bool isValid(vector<int> nums) {
int numIdx = 0;
for (int idx = 0; idx < k; idx... | ALGO | 0.999988 | 4.158762 |
0604c688-fb90-4b80-a66d-3307dde9e29b | alexandraback/datacollection | solutions_1483485_0/C++/tmt514/pa.cpp | #include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
char w[1000];
int main(void) {
const char *a="ejp mysljylc kd kxveddknmc re jsicpdrysi rbcpc ypc rtcsra dkh wyfrepkym veddknkmkrkcd de kr kd eoya kw aej tysr re ujdr lkgc jv y qee z";
const char *b="our language is impossi... | ALGO | 0.99952 | 3.907311 |
1ac2d0c3-4fde-4b28-ae48-e78520fefea5 | shiqinkai/huawei2019 | cross_express/题目相关资料/2019软挑-初赛-SDK/SDK/SDK_C++/CodeCraft-2019/CodeCraft-2019.cpp | #include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<fstream>
#include<algorithm>
#include<list>
#include<map>
#include<functional>
using namespace std;
int NUM_OF_CROSS = 0;
int NUM_OF_ROAD = 0;
int NUM_OF_CAR = 0;
int MAX_PLAN_TIME = 0;
int MIN_V_ROAD = 9999;
int NUM_OF_FINISH = 0; //¼Ŀĵصi... | ALGO | 0.985535 | 3.346058 |
8eb5e09a-5388-4b64-9cb8-23b424a352e2 | ThibaultGH/Navier-Stokes | build_dir/doc/snippets/compile_MatrixBase_transpose.cpp | static bool eigen_did_assert = false;
#define eigen_assert(X) if(!eigen_did_assert && !(X)){ std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X << "\n### The following would happen without assertions:\n"; eigen_did_assert = true;}
#include <iostream>
#include <Eigen/Eigen>
#ifndef M_PI... | TOOL | 0.890556 | 3.592494 |
51ce1105-c3ca-464e-8940-ded3afef2023 | Tornado025/Competitive-Programming | Codeforces/1353C_Board_Moves.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;cin>>t;
for(long long i=1;i<=t;i++){
long long n;cin>>n;long long d=0;long long k=1;
if(n==1)d=0;
else{
n--;
while(n>0){
d=d+n*k*2;
k++;
n--;
}
}
... | ALGO | 0.999838 | 3.842237 |
62efb0f7-eeb2-44c4-b4c1-62b8734d2cdd | kevinMkY/CPP_ALGO | testC++++/剑指 Offer 47. 礼物的最大价值.cpp | //
// 剑指 Offer 47.cpp
// testC++++
//
// Created by yekaihua on 2021/2/27.
//
#include "剑指 Offer 47. 礼物的最大价值.hpp"
#include "common.h"
int countPath(vector<int>path){
int sum = 0;
for (int i = 0; i<path.size(); i++) {
sum+=path[i];
}
return sum;
}
void _offer_47_repeat_testdfs(
... | ALGO | 0.99999 | 5.988301 |
ed58c8ad-959d-4a6b-9b9c-71e0a982db34 | Andrew-J-Li/UTPC-practice | Daily/contest_1020_problem_d.cpp | #include <bits/stdc++.h>
#define endl "\n"
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll t; cin >> t;
while (t--) {
ll n, m; cin >> n >> m;
vector<ll> flowers (n);
for (ll i = 0; i < n; ++i) cin >> flowers[i];
... | ALGO | 0.999949 | 4.463655 |
546e2639-0b57-4330-b2c8-99717d90ccf7 | fwhxyer/POJ_WFArt_insolent | 3129/11710374_WA.cpp | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
using namespace std;
double x[500],y[500],z[500],xx[50],yy[50],zz[50],ww[50];
int main()
{
int n,m;
while (scanf("%d",&n)==1&&n){
for (int i=0;i<n;i++)
scanf("%lf%lf%lf",&x[i],&y[i],&z[i]);
scanf("%d",&m);
for (int i=0;i<m;i++)
... | ALGO | 0.990345 | 3.187041 |
b5019e5d-20fe-4742-8c32-62abf35b9355 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6209_5.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
string ans = "";
ans += a[0];
int n = a.size();
for (int i = 1; i < n; i++) {
if (a[i] <= b[0]) {
ans += a[i];
} else {
ans += b[0];
break;
}
if (i + 1 == n) ans += b[0];
}
if (ans.si... | ALGO | 0.999817 | 3.705489 |
b50e397b-c2d3-4ba1-90cb-146845f0fcb6 | today2098/algorithm-dev | verify/aoj-GRL_3_A-low_link.test.cpp | #define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/library/5/GRL/3/GRL_3_A"
#include <iostream>
#include "../algorithm/Graph/Others/low_link.hpp"
int main() {
int n, m;
std::cin >> n >> m;
algorithm::LowLink lowlink(n);
for(int i = 0; i < m; ++i) {
int s, t;
std::cin >> s >> t... | ALGO | 0.999451 | 4.751074 |
fb4f0b05-94cd-4b03-91bb-9e602e9fb725 | ishandutta2007/codeforces | yashchandnani/normal/1361/A.cpp | #include <bits/stdc++.h>
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
voi... | ALGO | 0.99999 | 3.909864 |
f9d70c5a-617d-49bf-9449-5847c561be5f | hxzinh/VOI | DIVXYZ/main.cpp | #include <bits/stdc++.h>
#define ll long long
#define INF 1e9
#define FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
template<class X, class Y>
inline bool maximize(X &x, const Y &y) {return (x < y ? x = y, 1 : 0);}
template<class X, class Y>
inline bool minimize(X &x, const Y &y... | ALGO | 0.999661 | 3.479313 |
5605b298-9604-47ce-a6b6-104602c72453 | shaurya127/Leetcode_Solution | 1-two-sum/1-two-sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
vector<int>v;
unordered_map<int,int>mp;
for(int i=0;i<nums.size();i++){
int x=target-nums[i];
if(mp.find(x)!=mp.end()){
return {i,mp[x]};
}
... | ALGO | 0.999588 | 6.180116 |
1984e9ee-2a08-4a4a-b81f-1d4472ea17bf | ZiruiYannn/Micromechanics-Proj-Math-Eng | Lib/eigen-3.4.0/doc/examples/Tutorial_ArrayClass_interop.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
MatrixXf n(2,2);
MatrixXf result(2,2);
m << 1,2,
3,4;
n << 5,6,
7,8;
result = (m.array() + 4).matrix() * m;
cout << "-- Combination 1: --" << endl << result << endl << e... | ALGO | 0.999362 | 4.531452 |
6594aa41-a86b-4c44-ace5-38a46667307e | ishandutta2007/codeforces | sserxhs/normal/1725/F.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 120000
int n,l[N],r[N],f[32];
int solve(int t){
int len=1<<t,cnt=0;
vector<pair<int,int> > dlt;
for (int i=1;i<=n;++i){
if (r[i]-l[i]+1>=len) ++cnt;
else{
int L=l[i]%len,R=r[i]%len;
if (L<=R){
... | ALGO | 0.999916 | 4.124274 |
effbdcf1-7fe2-48ac-8958-a37ecff40bb9 | valentin-aleksandrov/TU-Sofia-oop | LastPELabTask1/main.cpp | #include <iostream>
#include <vector>
/*
Задача 1 от последното упражнение при Константинов.
Клас дата с член променливи:
-> ден
-> месец
-> година
, които са цели числа.
Имаме задължително копиращ конструктор.
Да се проектира клас спестовен вложител в банка с член променливи:
име
сума
и
дата.
Задължително член функция... | TOOL | 0.89951 | 4.279836 |
1354cb19-7bfa-4ade-87be-6945c55c7a5c | SerbanL/BORIS | Boris/Atom_DiffEqBCC.cpp | #include "stdafx.h"
#include "Atom_DiffEqBCC.h"
#ifdef MESH_COMPILATION_ATOM_BCC
#include "Atom_Mesh_BCC.h"
#include "Atom_MeshParamsControl_Multi.h"
Atom_DifferentialEquationBCC::Atom_DifferentialEquationBCC(Atom_Mesh_BCC*paMesh):
Atom_DifferentialEquation(paMesh)
{
error_on_create = UpdateConfiguration(UPDATECON... | ALGO | 0.982493 | 6.026522 |
99132135-e85b-42a7-8bbb-705023ea09a4 | Ermi9s/Cpp--DSA | linkedListClass.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node *next;
};
class Linked_List
{
private:
int length;
Node *head;
public:
Linked_List()
{
head = new Node;
head->next = NULL;
length = 0;
}
~Linked_List()
{
Node *temp... | ALGO | 0.999059 | 3.851875 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.