uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
84a6692a-4691-4702-a2ec-b55b1da9b46b | rzkynovan/Dasprog_SainsData | Task no. 3.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main(){
float bb, tb, bmi;
cout << "==================================\n";
cout << "======== Body Mass Index =========\n";
cout << "==================================\n\n\n";
cout << "Masukkan Berat Badan : ";
cin >> bb;
cout << "Masukkan Tingg... | ALGO | 0.954316 | 3.92935 |
27d405be-971f-485b-9645-4eaf06e67e92 | Imagaverse/CitraEmu | externals/cryptopp/bench3.cpp | // bench3.cpp - originally written and placed in the public domain by Wei Dai
// CryptoPP::Test namespace added by JW in February 2017
#include "cryptlib.h"
#include "bench.h"
#include "validate.h"
#include "cpu.h"
#include "factory.h"
#include "algparam.h"
#include "argnames.h"
#include "smartptr.h"
#in... | TEST | 0.94657 | 7.198253 |
652be305-b9fd-45f4-b61a-c8439cbf076d | Aishwarya7902/DAILY-LEETCODE-CHALLENGE | 2023/DECEMBER/31__Dec__ Largest Substring Between Two Equal Characters.cpp | PROBLEM :https://leetcode.com/problems/largest-substring-between-two-equal-characters/description/?envType=daily-question&envId=2023-12-31
VIDEO(MIK BHAIYA):https://www.youtube.com/watch?v=kQLhWLVlzYo
/*
DID ON MY OWN 🥳
TC:
SC:
*/
class Solution {
public:
void FindLastIndex(string &s,char target, vector<in... | ALGO | 0.999843 | 5.946321 |
5c8d7fe4-b670-40f1-944a-a30fec6173a0 | navneetk2001/CPP_Programs | Test Series/Amazon test Series/Data Structures and Algorithms/12. Heap/10. Merge K sorted linked lists.cpp | // Given K sorted linked lists of different sizes. The task is to merge them in such a way that after merging they will be a single sorted linked list.
// Example 1:
// Input: K = 4
// value = {{1,2,3},{4 5},{5 6},{7,8}}
// Output: 1 2 3 4 5 5 6 7 8
// Explanation: The test case has 4 sorted linked list of size 3, 2, ... | ALGO | 0.999953 | 5.726326 |
4224672f-a27d-46a8-9d79-37081ff16536 | SWEG-2015EC-Batch/Algorithm-Avengers | ETS1309_15_THRESSA_MENILEK/Activity 4.2/2D Array Practical Exercises/Row_element_product_column_sum.cpp | #include <iostream>
using namespace std;
int main() {
int ROWS, COLS;
cout<<"Enter the number of rows: ";
cin>>ROWS;
cout<<"Enter the number of columns: ";
cin>>COLS;
int arr[ROWS][COLS];
// read in values for array
cout << "Enter values for array:" << endl;
for (int i = 0; i < ROWS; i++) {
for ... | ALGO | 0.997773 | 4.185966 |
b3a7fc72-f0da-48cc-8ce2-9f2743917eaf | SKundu312/Crack-Your-Internship | Arrays/Easy/MoveZeroes.cpp | //O(N)
class Solution {
public:
void moveZeroes(vector<int>& nums) {
int k=0;
for(int i=0;i<nums.size();i++){
if(nums[i])
nums[k++]=nums[i];
}
for(int i=k;i<nums.size();i++)
nums[i]=0;
}
};
class Solution {
public:
void moveZeroes(vect... | ALGO | 0.999901 | 6.246966 |
4fac1c87-0faa-4eff-adc3-889fecc1c0c7 | wjyaxxx/Algorithm-exercise-code | PTA/2019年真题/e.cpp | #include<bits/stdc++.h>
#define inf 110000
using namespace std;
map<string, int> mp;
int p[inf],cnt[inf],dx[inf],dy[inf],sex[inf];
string ming[inf], xing[inf];
bool judge(int x, int y)
{
memset(cnt,0,sizeof(cnt));
memset(dx,0,sizeof(dx));
memset(dy,0,sizeof(dy));
cnt[x]=1,cnt[y]=1;
while(p[x] != -1){
... | ALGO | 0.999842 | 4.442735 |
6cdb5d77-02db-4fd1-8eee-cadee96d1aa5 | wandukong/Algorithm | SDS/그래프2/플로이드_11404.cpp | #include <algorithm>
#include <iostream>
#include <string.h>
using namespace std;
int N, M;
int dp[101][101];
int main()
{
scanf("%d %d", &N, &M);
memset(dp, 0x3f, sizeof(dp));
for (int i = 1; i <= N; i++)
dp[i][i] = 0;
for (int i = 0; i < M; i++)
{
int a, b, c;
scanf("%d ... | ALGO | 0.999985 | 3.759429 |
c575aada-69f1-499d-a311-c94cf0f63dad | Lqs66/boost_1_74_0 | libs/numeric/ublas/doc/samples/vector_binary_outer.cpp | #include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
vector<double> v1 (3), v2 (3);
for (unsigned i = 0; i < (std::min) (v1.size (), v2.size ()); ++ i)
v1 (i) = v2 (i) = i;
std::cout << outer_prod (v1, v2) << std::... | ALGO | 0.998647 | 3.95939 |
41157788-f2ab-4cb9-bf0c-765102423e64 | leonardoAnjos16/Competitive-Programming | Codeforces/array_with_odd_sum.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t; scanf("%d", &t);
while (t--) {
int n; scanf("%d", &n);
int num_odd = 0;
for (int i = 0; i < n; i++) {
int a; scanf("%d", &a);
num_odd += a % 2;
}
if (num_odd % 2 || (num_odd && n... | ALGO | 0.998705 | 4.606862 |
82471c50-aa22-4961-a581-5c937d0905e3 | Duonghbtt/CODEPTIT | PTIT-Source-main/PTIT-Source-main/SPOJ PTIT/VT14.cpp | // https://luyencode.net/problem/VT14
// VT14 - Lại là đi tìm cặp đôi
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> a, b;
for (int i = 0; i < n; ++i)
{
int x;
cin >> x;
if (x > 0)
a.push_back(x);
else
... | ALGO | 0.999971 | 4.664245 |
1608addf-6b2a-43b0-9918-6c8de2c6ef6e | OscarRexid/PP | libraries/eigen-3.4.0/doc/examples/Tutorial_BlockOperations_vector.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::ArrayXf v(6);
v << 1, 2, 3, 4, 5, 6;
cout << "v.head(3) =" << endl << v.head(3) << endl << endl;
cout << "v.tail<3>() = " << endl << v.tail<3>() << endl << endl;
v.segment(1,4) *= 2;
cout << "after 'v.segment(1,4) *= 2', v... | ALGO | 0.99711 | 3.093805 |
deca268a-d668-4ee5-94e9-d09d86bb7144 | janeeshah123/-Assortment | PR. 5 Assortment/Sum of Elements in Row & Column of 2D Array.cpp | #include <stdio.h>
int main() {
int rows, cols,rownum,colnum, colsum, rowsum,i,j;
printf("Enter the array's row size: ");
scanf("%d", &rows);
printf("Enter the array's column size: ");
scanf("%d", &cols);
int a[rows][cols];
printf("Enter array's elements:\n");
for ( i = 0; i < rows; i... | ALGO | 0.945619 | 3.721932 |
41093aea-9072-4b98-b347-8605501fc1a4 | ishandutta2007/codeforces | andreasyan/normal/1017/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
const int N=100005;
int n;
char a[N],b[N];
int t[2][2];
int main()
{
//freopen("input.txt","r",stdin);
//freopen("forest.in","r",stdin);
//freopen("forest.out","w",stdout);
cin>>n;
cin>>a;
cin>>b;
long long ans=0;
for(... | ALGO | 0.999959 | 3.820492 |
7ce32bbe-7a40-46eb-b0f0-6d1502f1c7cc | knockcat/Leetcode | 0026-remove-duplicates-from-sorted-array/0026-remove-duplicates-from-sorted-array.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int n = nums.size();
int cnt = 0;
for(int i = 1; i < n; ++i)
{
if(nums[i] == nums[i-1])
{
++cnt;
}
else
nums[i... | ALGO | 0.999913 | 6.268671 |
e1dd3888-bec7-4e47-ad39-446b6e194b53 | Bhavik3012/A2Z-DSA | 02_basic/set/set.cpp | #include <bits/stdc++.h>
using namespace std;
// set = everything in sorted order and just unique
int main()
{
set<int> st;
st.insert(1); //{1}
st.emplace(2); //{1,2}
st.insert(2); //{1,2} // this will not add more than 1 2
st.insert(4); //{1,2,4}
st.insert(3); //{1,2,3,4}
// Funct... | ALGO | 0.943359 | 4.704331 |
8786f69d-d1ef-4373-afd2-2f4a9dc7d471 | Anshuman1103/BabbarDSA | Striver/greedyAlgorithm/fractionalKnapsack.cpp | // Given two arrays, val[] and wt[], representing the values and weights of items, and an integer capacity representing the maximum weight a knapsack can hold, determine the maximum total value that can be achieved by putting items in the knapsack. You are allowed to break items into fractions if necessary.
// Return t... | ALGO | 0.999487 | 5.947258 |
c14c2140-9259-4512-ae83-935162887759 | DangerCenter/shaderbasis_cpp | src/ShaderBasis.cpp | /** ____ _ _ ____ _
* / ___|| |__ __ _ __| | ___ _ __| __ ) __ _ ___(_)___
* \___ \| '_ \ / _` |/ _` |/ _ \ '__| _ \ / _` / __| / __|
* ___) | | | | (_| | (_| | __/ | | |_) | (_| \__ \ \__ \
* |____/|_| |_|\__,_|\__,_|\___|_| |____/ \__,_|___/_|___/
*/
#define __USE_S... | TOOL | 0.856816 | 5.333265 |
e62bcb05-7cce-44e7-9325-3a3d2df717fc | hasin023/4th-Semester | cse_4404_algorithm/Lab_03/210042174_L03T02.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <chrono>
#include <iomanip>
using namespace std;
void countingSort(int arr[], int size, int maxVal)
{
int count[maxVal + 1] = {0};
for (int i = 0; i < size; i++)
{
count[arr[i]]++;
}
int index = 0;
for (int i = 0; i <= m... | ALGO | 0.99966 | 5.415001 |
72c39ac4-8dce-4b9d-9a9f-2bd2a635103c | dcastrelo/PrusaBear-Ar | Marlin 2.0.7.2 Upgrade V1 a V1.5/Marlin-2.0.x/buildroot/share/PlatformIO/variants/LERDGE/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
const PinName digitalPin[] = {
PB_12,
PB_13,
PB_14,
PB_15,
PD_8,
PD_9,
PD_10,
PD_11,
PD_12,
PD_13,
PD_14,
PD_15,
PG_2,
PG_3,
PG_4,
PG_5,
PG_6,
PG_7,
PG_8,
PC_6,
PC_7,
PC_8,
PC_9,
PA_8,
PA_9,
PA_10,
PA_11,
PA_12,
PA_13,
PA_1... | CONFIG | 0.916871 | 5.010884 |
25dbf9ec-6d8e-460a-9bfe-0971cab9e7ff | Ahmad-AlDeeb/Problem-Solving | University Training/Menofia/Sheets/#2 Sheet/L - Young Physicist.cpp | // problem link: https://codeforces.com/problemset/problem/69/A
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define dd double
#define ld long double
#define PQ priority_queu... | ALGO | 0.999881 | 4.236869 |
f5b25a76-c6ed-4ba2-8817-8bea0c4e1a6b | kasiyan16/Programming1 | 15_lab/15_lab.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
const int variant = 9;
const int size = 10;
double results[size]; // створити масив
// розрахувати масив
for (int k = 1; k <= size; ++k) {
double x = k;
results[k - 1] = cos(pow(x, 2) + 1) - fabs(sin(2 * x) - 5.... | ALGO | 0.999509 | 3.974371 |
43a75a79-ea06-47c1-b630-14706af7c131 | khalildallegi/PdfGenerator | 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 |
00c1e5e3-9dc3-4578-a75f-48ef987aad44 | rajxsv/Data-Structures-and-Algorithms | Number theory/PrimeSieve.cpp | #include<bits/stdc++.h>
using namespace std;
void primeprint(long long prime[]){
prime[2] = 1;
prime[0] = prime[1] = 0;
//marking along long odds as prime
for(long long i = 3 ; i < 100000 ; i+=2){
prime[i] = 1;
}
for(long long i = 3 ; i <= 100000 ; i+=2){
if(prime[i]){
for(long long j = i*i ; j <=1000... | ALGO | 0.99974 | 3.942775 |
b3a175f3-6731-4e45-876a-db9ed79cbc44 | rhdelaney/practice_projects | leetcode/232_implementQueueUsingStacks/implementQueueUsingStacks.cpp | class MyQueue {
public:
stack<int> st;
stack<int> en;
MyQueue() {
}
void push(int x) {
while(!st.empty()) {
en.push(st.top());
st.pop();
}
en.push(x);
while(!en.empty()) {
st.push(en.top());
en.pop();
}
}
... | ALGO | 0.999185 | 5.689961 |
af227858-1dff-4aa6-8977-b488f55d7895 | zqw-hooper/apollo_and_-autoware_path_planner | Apollo_PiecewiseJerk_algorithm/Ipopt-3.12.7/Ipopt/contrib/MatlabInterface/src/callbackfunctions.cpp | #include "callbackfunctions.hpp"
#include "matlabexception.hpp"
// Functions for class CallbackFunctions.
// -----------------------------------------------------------------
CallbackFunctions::CallbackFunctions (const mxArray* ptr)
: objfunc(0), gradfunc(0), constraintfunc(0), jacobianfunc(0),
jacstrucfunc(0), ... | TOOL | 0.913141 | 6.78334 |
da6911a0-eb27-42ca-8e8c-935cd32afa7d | RGreenlees/evobot_mm | evobot/src/bot_task.cpp |
#include "bot_task.h"
#include <extdll.h>
#include <meta_api.h>
#include <dllapi.h>
#include "player_util.h"
#include "bot_navigation.h"
#include "bot_tactical.h"
#include "bot_weapons.h"
#include "general_util.h"
#include "bot_util.h"
#include "bot_config.h"
#include "game_state.h"
extern float GameStartTime;
ext... | TOOL | 0.863461 | 3.002931 |
9bf59568-97cd-48fd-ae80-c763f78f91f7 | Kalpesh1A/CPP_PRACTICE | Fibonacci print up to given position.cpp | /*#include<stdio.h>
int main()
{
int i=0,j=1,sum,t,n=1;
printf("\nPrint Fibonacci up to given term");
printf("\nEnter Term Up to have to print fibonacci");
scanf("%d",&t);
printf("\n%d",i);
printf("\n%d",j);
while(n<=t)
{
sum=i+j;
printf("\n%d"sum);
i=j;
j=sum;
n=n+1;
}
return 0;
}*/
#include<stdio... | ALGO | 0.999733 | 3.45708 |
b0baf83c-1531-4727-a79b-b0ac6687c63a | Prayag2003/Standard_Template_Library | Sort/Comparator.cpp | #include <bits/stdc++.h>
using namespace std;
void printVec(vector<int> &v)
{
for (auto &val : v)
{
cout << val << " ";
}
cout << "\n";
}
bool cmp(int a, int b)
{
if (a < b)
return true;
return false;
}
bool should_i_swap(pair<int, int> &a, pair<int, int> &b)
{
if (a < b)
... | ALGO | 0.999981 | 4.769229 |
6ebc7f9c-42d5-4427-b8ef-689d4400550b | ansys/Dakota | src/NonDSparseGrid.cpp | //- Class: NonDSparseGrid
//- Description: Implementation code for NonDSparseGrid class
//- Owner: Mike Eldred
//- Revised by:
//- Version:
#include "dakota_data_io.hpp"
#include "dakota_system_defs.hpp"
#include "NonDSparseGrid.hpp"
#include "CombinedSparseGridDriver.hpp"
#include "HierarchSparseGridDriver.h... | ALGO | 0.930107 | 6.569223 |
760de307-abd1-4008-b96e-5d8637883eef | jumoog/snmpb | snmp++/src/md5c.cpp | char md5c_cpp_version[]="#(@) SNMP++ $Id: md5c.cpp 3195 2017-01-11 20:07:44Z katz $";
/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm */
#include <libsnmp.h>
#include "snmp_pp/md5.h"
#if !defined(_USE_LIBTOMCRYPT) && !defined(_USE_OPENSSL)
#ifdef __cplusplus
extern "C" {
#endif
#ifdef SNMP_PP_NAM... | ALGO | 0.998785 | 6.726737 |
ea957b46-526d-45d2-8f82-717212bad16c | kalebted/Silesua | 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.9988 | 6.76073 |
e807e6fa-bd4e-43d6-8be6-dc868badcaef | Gaurav11ME/OpenMP_Parallel_Programming | hello_world.cpp | // Headers
#include<iostream>
#include<omp.h>
using namespace std;
// function headers
void Hello(void);
int main(int argc, char* argv[])
{
/* Get number of threads from command line*/
int thread_count = strtol(argv[1],NULL,10);
// strtol will convert str to long integer
# pragma omp parallel num_threads(threa... | TOOL | 0.863799 | 3.642917 |
f8e1d2af-ccef-4d79-8c3e-baf85ba78843 | ishandutta2007/codeforces | rui_er/normal/2/A.cpp | //By: Luogu@rui_er(122461)
#include <bits/stdc++.h>
#define loop while(true)
#define rep(x,y,z) for(int x=y;x<=z;x++)
#define per(x,y,z) for(int x=y;x>=z;x--)
#define fil(x,y) memset(x, y, sizeof(x))
#define mulT0 int T; for(scanf("%d", &T);T;T--)
#define mulT1 int T, rnds; for(scanf("%d", &T),rnds=1;rnds<=T;rnds++)
us... | ALGO | 0.999987 | 3.734819 |
b19a1218-2702-45af-8f2d-963d33c65f44 | DyogoBendo/cp | competition/brasil/universities/unioeste/cpu/2025/contest-interno-2/d.cpp | #include <bits/stdc++.h>
#define flash ios_base::sync_with_stdio(false);cin.tie(NULL)
#define int long long
using namespace std;
void solve(){
int k;
cin >> k;
int x = 0;
while(k > 3){
x ++;
k >>= 2;
}
cout << (1 << x) << endl;
}
signed main(){
flash;
... | ALGO | 0.999942 | 4.396101 |
939963f4-383d-481a-b100-e04e0f0da6bb | ibrahim1118/LeetCode-Solutions | 1457-pseudo-palindromic-paths-in-a-binary-tree/1457-pseudo-palindromic-paths-in-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* 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), l... | ALGO | 0.999827 | 5.838552 |
7bb2e4ef-a877-4b1b-807f-b5aeb1cc281d | Dhruv-Limbani/Data-Structures | Binary_Trees/hard_problems/check_for_children_sum_property.cpp | #include<bits/stdc++.h>
using namespace std;
// TreeNode structure
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};
class Solution{
public:
//Function to check whether all nodes of a tree have the value
//equal to th... | ALGO | 0.999995 | 6.445139 |
6863c9c4-f2ad-4887-8ad4-ac999b980022 | idlegossip/Codeforces | Codeforces Round #614 (Div. 2)/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
ll ar[1110];
int main()
{
ll t;
cin>>t;
while(t--)
{
ll n,s,k;
cin>>n>>s>>k;
ll a;
map<ll,ll>mp;
for(ll i=1; i<=k; i++)
{
cin>>a;
mp[a]=1;
}
ll res... | ALGO | 0.999862 | 3.185816 |
2a28bb20-cb8d-4404-b438-b0340c2ea31c | Next-Gen-UI/Code-Dynamics | Leetcode/1000-2000/1921. Eliminate Maximum Number of Monsters/1921.cpp | class Solution {
public:
int eliminateMaximum(vector<int>& dist, vector<int>& speed) {
const int n = dist.size();
vector<int> arrivalTime(n);
for (int i = 0; i < n; ++i)
arrivalTime[i] = (dist[i] - 1) / speed[i];
sort(begin(arrivalTime), end(arrivalTime));
for (int i = 0; i < n; ++i)
... | ALGO | 0.99953 | 6.23158 |
756e79b5-479c-4304-823a-9048ecb3e9f5 | ishandutta2007/codeforces | krijgertje/normal/729/F.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include... | ALGO | 0.999969 | 3.132134 |
467d8962-3496-4dd0-9ff9-34db6b5d2e19 | vochi/core-intern-test | effect_sandbox/3rd/opencv/modules/imgproc/src/color_lab.cpp | #include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
#include "opencv2/core/hal/intrin.hpp"
#include "opencv2/core/softfloat.hpp"
#include "color.hpp"
using cv::softfloat;
static const float * splineBuild(const softfloat* f, size_t n)
{
float* tab = cv::allocSingleton<float>(n * 4);
const softfloat f... | ALGO | 0.993074 | 3.039247 |
c539b6f3-6945-4315-a764-7cec77d20896 | anmol210202/dsaHabits | 1794-minimize-deviation-in-array/solution_2023-02-24_19-32-05.cpp | class Solution {
public:
int minimumDeviation(vector<int>& nums) {
priority_queue<int> p;
for(auto &e:nums) {if(e%2==1) e*=2; p.push(e);}
int minValue=*min_element(nums.begin(),nums.end()),ans=INT_MAX;
while(true){
int maxValue=p.top();
p.pop();
an... | ALGO | 0.999964 | 5.200521 |
313da19e-e37a-4378-a05a-ae3f784c9974 | gorel/advent_of_code_2021 | 2/day_2_2.cpp | #include <iostream>
#include <string>
int main(int argc, char** argv) {
int64_t xpos = 0;
int64_t depth = 0;
int64_t aim = 0;
std::string dir;
int64_t n;
while (std::cin >> dir >> n) {
if (dir == "forward") {
xpos += n;
depth += aim * n;
} else if (dir == "down") {
aim += n;
... | ALGO | 0.999232 | 5.836688 |
d93fbaf4-de9f-4545-ada3-211b230ed17e | agabgim/ctf_tpls | boost/1.55.0/libs/math/example/inverse_chi_squared_bayes_eg.cpp | // inverse_chi_squared_bayes_eg.cpp
// This file is written to be included from a Quickbook .qbk document.
// It can still be compiled by the C++ compiler, and run.
// Any output can also be added here as comment or included or pasted in elsewhere.
// Caution: this file contains Quickbook markup as well as code
// and... | ALGO | 0.997873 | 5.098919 |
0052342a-33b1-4419-8a17-3c6eb6f472db | susilehtola/HelFEM | src/diatomic/completeness.cpp | #include "../general/cmdline.h"
#include "../general/checkpoint.h"
#include "../general/constants.h"
#include "../general/timer.h"
#include "../general/lcao.h"
#include "basis.h"
#include "twodquadrature.h"
#include <cfloat>
#include <climits>
using namespace helfem;
int main(int argc, char **argv) {
cmdline::parse... | ALGO | 0.993601 | 5.402331 |
ea847658-deee-4645-a6c2-9246e8780b07 | arch-net-cpp/cpp3rdlib | acl_fiber/include/acl/lib_acl/samples/zdb/md5.cpp |
/* MS VisualStudio Projects are monolithic, so we need the following
* #if to exclude the MD5 code from compile process when we are
* building the SSL support.
*/
#include <assert.h>
#include <stdio.h>
#include "md5.h"
#include <string.h>
#ifdef WORDS_BIGENDIAN
void byteSwap(uint32_t * buf, unsigned words)
{
uint... | ALGO | 0.923746 | 6.101715 |
d9901862-9e37-41a6-8e10-bc6fc4184e9b | jbhayven/oi_solutions | ontak2016/man2.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX_N 200100
#define MAX_DIM 200100
class Tree {
// A fast and memory-efficient two-dimensional tree
private:
struct One_dimension {
set <pair<int, int>> min_diags;
void insert(pair<int, int> p) {
if (min_diags.empty()) // ... | ALGO | 0.999623 | 4.128752 |
a70652eb-d22e-488c-8225-140eaff9c601 | Heych88/udacity-sdcnd-path-planning | src/Eigen-3.3/bench/eig33.cpp | #include <iostream>
#include <Eigen/Core>
#include <Eigen/Eigenvalues>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
template<typename Matrix, typename Roots>
inline void computeRoots(const Matrix& m, Roots& roots)
{
typedef typename Matrix::Scalar Scalar;
con... | ALGO | 0.999545 | 5.613888 |
5c4e0253-add9-4268-9f79-be0e451ee7a4 | WizardPenguin/competative-programming | 828 div3/17440.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> p... | ALGO | 0.999986 | 4.848102 |
1dbb1ec1-06b2-4249-a58b-83a74e9f5ea7 | NikitaUssyukin/PP1_2024_Fall | Practices/G9/Week08/Lab06/w.cpp | #include <iostream>
#include <sstream>
using namespace std;
int findNthNumber(int cnt[], int X) {
int missing_num = 1;
for(int i = 1; i < 1001; ++i) {
if(cnt[i] == 1) continue;
if(missing_num == X) return i;
++missing_num;
}
return -1;
}
int main() {
stringstream ss;
... | ALGO | 0.999905 | 4.102774 |
991e8053-b2a9-4b7b-9dfa-2ebc2be6ef72 | dhiru7890/cpp-learning | codes/mid_pat.cpp | #include<iostream>
using namespace std;
int main(){
int row,col,n;
cout<<"enter number";
cin>>n;
for(row=1;row<=n;row++){
for(col=1;col<=n-row;col++){
cout<<" ";
}
for(col=row;col>=1;col--){
cout<<col<<" ";
}
cout<<endl;
}
... | ALGO | 0.99987 | 3.824759 |
e2e3bcb5-1cf8-447a-9fac-239d49b3f699 | Aaksha-sharma/C-basic-questions | consonant_vowel.cpp | #include<iostream>
using namespace std;
int main()
{
char s;
cout<<"enter any alphabet:\t";
cin>>s;
if (s=='a' || s=='A' || s=='e' || s=='E' || s=='i' || s=='I' || s=='O' || s=='o' || s=='u' || s=='U')
{
cout<<s<<" is vowel";
}
else
{
cout<<s<<" is a consonant";
}
} | ALGO | 0.952953 | 3.093052 |
9fe3fa74-d582-4b33-aa24-6cf1788bf384 | fuckkmv/is1 | 11_stream.cpp | #include <iostream>
#include <string>
using namespace std;
void streamCipher(string &msg, int key){
srand(key);
for ( int i=0; i<msg.length(); i++){
msg[i] ^= (char)rand();
}
}
int main() {
string msg;
cout<<endl<<"Enter Message: ";
getline(cin>>ws, msg);
streamCipher(msg, 23457);
... | TOOL | 0.996342 | 4.275741 |
e3d4ba56-9ee0-44de-89d7-61e2050f839f | CodeX-Addy/Recursion_Problems | quickSort.cpp | #include <iostream>
using namespace std;
int partition(int arr[], int s, int e){
int pivot = arr[s];
int cnt = 0;
for(int i=s+1; i<=e; i++){
if(arr[i]<=pivot)
cnt++;
}
int pivotIndex = s + cnt;
swap(arr[pivotIndex], arr[s]);
int i=s, j=e;
while(i<pivotIndex && j>pivotIndex){
while(arr[i... | ALGO | 0.999988 | 5.313345 |
0b03ffd9-7900-4372-9b8d-233e7ac3b29c | cyanine-gi/VINS_Fusion-simulation | vins_estimator/src/initial/initial_sfm.cpp | #include "initial_sfm.h"
GlobalSFM::GlobalSFM(){}
void GlobalSFM::triangulatePoint(Eigen::Matrix<double, 3, 4> &Pose0, Eigen::Matrix<double, 3, 4> &Pose1,
Vector2d &point0, Vector2d &point1, Vector3d &point_3d)
{
Matrix4d design_matrix = Matrix4d::Zero();
design_matrix.row(0) = point0[0] * Pose0.row(2) - Pose... | ALGO | 0.986755 | 4.633471 |
ac5b6ab2-699f-4bca-a214-61910ae40450 | TimerErTim/bioinf.inf | sem-2_exercise-10/FDS_Peko_Ue10/FDS_Peko_Ue10/example01/example01.cpp | #include <iostream>
#include <string>
#include <vector>
#include <random>
#include <functional>
#include <iomanip>
#include <filesystem>
#include <numeric>
#include <algorithm>
#include <fstream>
#include "pattern_search.h"
#include "data_collector.h"
#include "pfc-mini.hpp"
// Generates a random string of a given le... | ALGO | 0.989726 | 7.105553 |
fc34732d-4035-44c0-93d3-6393ab32c31a | LordUbuntu/ICPC | 2014/editorial/Top25/Top25.cpp | #include <map>
#include <string>
#include <iostream>
using namespace std ;
int main(int argc, char *argv[]) {
int T ;
cin >> T ;
while (T-- > 0) {
map<string, int> firstset ;
int N ;
cin >> N ;
string s ;
for (int i=0; i<N; i++) {
cin >> s ;
firstset[s] = i ;
... | ALGO | 0.999907 | 3.433956 |
1556a3c0-1053-427c-93f7-32f1cbfa144d | dmayer/time_trial | racer/src/utils/string_split.cpp | #include "string_split.h"
// don't use this on long strings!
std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems, unsigned int count) {
std::stringstream ss(s);
std::string item;
std::string lastitem;
while (count > 0 && std::getline(ss, item, delim)) {
... | TOOL | 0.955264 | 6.034672 |
693ae881-91b4-473b-9e7f-2cadb72d0495 | VMihail/ITMO-AaDS | lab4/D.cpp | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cstdint>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#i... | ALGO | 0.999987 | 5.06378 |
3078142b-cc2e-4e26-aec4-a44333cd69c4 | AlgoSeoLee/backjooncpp | Project1/1106/1106.cpp | //https://www.acmicpc.net/problem/1106
//ǥ
#include <iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
vector<pair<int, int>> v;
int d[100001];
int main() {
int c, n;
cin >> c >> n;
for (int i = 0; i < n; i++)
{
int a, b;
cin >> a >> b;
v.push_back({ a,b });
}
for (int ... | ALGO | 0.999996 | 4.193239 |
5aa2dca6-20af-4694-9e50-4398765262bd | WhatTheMUCK/LeetCode | 1253-sort-the-matrix-diagonally/sort-the-matrix-diagonally.cpp | class Solution {
public:
vector<vector<int>> diagonalSort(vector<vector<int>>& mat) {
vector<vector<int>> answer = mat;
unordered_map<int, vector<int>> mp;
for (int i = 0; i < mat.size(); i++){
for (int j = 0; j < mat[i].size(); j++){
mp[i - j].push_back(mat[i][j]... | ALGO | 0.999976 | 6.311258 |
11b329b3-c56c-4be6-b863-208d72ca85b3 | oabgnol63/122023 | Codeblock/triangle.cpp | #include <iostream>
using namespace std;
void triagle_bot(int h,int x)
{
for (int j = 0; j< h;j++)
{
for (int i = 0; i<x;i++){
if (i<j || i >= x - j) cout << " ";
else cout << "*";}
cout << endl;
}
}
void triagle_top(int h,int x)
{
for (int j = h-1; j>=0;j--)
{
for (int i = 0; i<x;i++){... | ALGO | 0.999755 | 3.134432 |
f64554e3-10d8-4cfb-b680-4a144a6a6b33 | UmerSoftwares/Spark-E1 | firmware/Marlin-2.1.x/Marlin/src/feature/meatpack.cpp | /**
* MeatPack G-code Compression
*
* Algorithm & Implementation: Scott Mudge - <EMAIL>
* Date: Dec. 2020
*
* Character Frequencies from ~30 MB of comment-stripped G-code:
* '1' -> 4451136 '4' -> 1353273 '\n' -> 1087683 '-' -> 90242
* '0' -> 4253577 '9' -> 1352147 'G' -> 1075806 'Z' -> 34... | TOOL | 0.933329 | 5.874485 |
b95207b1-dde1-45c2-bf9d-5f934270ed97 | greenbtong/Path_Planning_Algorithm | AStar/CPP/Astar/Astar.cpp | /* Astar path finder - 30 x 15 map -
Start point is random on the Y-axis & 0 on the X-axis -
End point is at (14, 29) -
Cost, computational time, graph, and path are outputted
*/
#include "pathPlanning.h"
#include <time.h>
#include <stdlib.h>
#include <ctime>
int main() {
srand((time(NULL)));
clock_t clockStart =... | ALGO | 0.999137 | 3.698876 |
cc532ea0-f844-42ac-84b9-61390bd621b7 | brown0394/algorithm_practice | Deque.cpp | #include <iostream>
#include <cstring>
#define EMPTY -1
class deque {
private:
int memSize;
int mem[10000];
public:
deque();
void push_front(int elem);
void push_back(int elem);
int pop_front();
int pop_back();
int size();
int empty();
int front();
int back();
};
deque::deq... | ALGO | 0.995667 | 4.716169 |
7b46f7ed-e09d-4839-84ce-323728fe2f3e | arlechann/atcoder | AtCoder/ABC248/C.cpp | #include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include ... | ALGO | 0.999977 | 4.480451 |
6d6e9196-ffc7-4700-8bd5-f47c5fd1522d | 1s22s1/kanraniwa | 20250122/abc169_a.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
cout << a * b << endl;
return 0;
} | ALGO | 0.981163 | 4.083063 |
93367b57-57ac-44b6-a735-b54b75454829 | Harshit16112000/DSA | 2463-minimum-recolors-to-get-k-consecutive-black-blocks/minimum-recolors-to-get-k-consecutive-black-blocks.cpp | class Solution {
public:
int minimumRecolors(string blocks, int k) {
int count = 0;
int n = blocks.size();
int i = 0;
int j = 0;
while(j < k)
{
if(blocks[j] == 'W') count++;
j++;
}
int maxi = count;
while(j < n)
... | ALGO | 0.999878 | 5.635517 |
e761c7bd-d623-4fdc-970c-c7617d1cfb12 | selat/algorithms-and-programming-problems-and-solutions | chapter02/p01-01.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
* 2.1.1. Print all the sequences of length k composed of the numbers 1..n.
*/
void _printSequences(vector <int> &a, int n, int id)
{
if(id == a.size()) {
for(int i = 0; i < a.size(); ++i) {
cout << a[i] << " ";
}
cout << endl;
} else {
for(... | ALGO | 0.999941 | 3.835038 |
ecc1da7f-b8b9-4856-9b0e-f985dbd55fe3 | Dancarhide/programs_in_summer_2023 | Arreglos/EliminarNumeros.cpp | #include <iostream>
#include <vector>
int removeElement(std::vector<int>& nums, int val) {
int k = 0; l
for (int i = 0; i < nums.size(); i++) {
if (nums[i] != val) {
nums[k] = nums[i];
k++;
}
}
return k;
}
int main() {
std::vector<int> nums = {0,1,2,2,3,0,4,... | ALGO | 0.999683 | 6.156233 |
005c0a8b-491a-42b4-8949-68b67721b5fd | Akshitguptaa/cp | cp/B_Replacement.cpp | //// AKSHIT - template ////
#include <bits/stdc++.h>
#include<chrono>
#include<unordered_set>
using namespace std;
typedef long long int int64;
typedef unsigned long long int uint64;
#define int long long
#define endl "\n"
#define INF LLONG_MAX
#define MOD 1000000007
#define PI 3.1415926535897932384626433832795
// ... | ALGO | 0.999859 | 4.56107 |
2d443d37-5176-46e6-95db-ba47330d02cd | Twinparadox/AlgorithmProblem | Before_2023/Baekjoon/6131.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main(void)
{
int cnt = 0, n;
cin >> n;
for (int i = 1; i <= 500; i++)
{
for (int j = 1; j <= i; j++)
{
if (pow(i, 2) - pow(j, 2) == n)
{
cnt++;
break;
}
}
}
cout << cnt;
}
| ALGO | 0.999899 | 3.631737 |
586c7753-fd2c-4bdc-aa2a-938dd6bc69df | abdo-taha/Data-Structures-and-Algorithms-Specialization | lost/Exchanging Money Optimally/main.cpp | #include <bits/stdc++.h>
using namespace std;
const long long OO = (long long) 1e18;
#define lp(i,a,n) for(long long i = a ; i < n ; ++i)
#define rep(i,vec) for(ll i = 0 ; i < vec.size() ; ++i)
#define reprv(i,vec) for(ll i = vec.size()-1; i >=0 ; --i)
#define eps (1e-5)
#define pb(i) push_back(i)
typedef vector<int> v... | ALGO | 0.99981 | 3.519134 |
c1c77dc1-6add-4670-9390-7b54d0885c74 | nicolatoscan/ASD-1920 | 3_sottomat/3.sottomat.cpp | #include <fstream>
#include <iostream>
using namespace std;
int R, C;
int _mat[1000000];
int mat(int r, int c)
{
return _mat[(r * C) + c];
}
int main()
{
ifstream in("input.txt");
in >> R;
in >> C;
for (int i = 0; i < R * C; i++)
in >> _mat[i];
int max = 0;
int tempArr[C];
... | ALGO | 0.999331 | 4.340072 |
613b6109-cc17-40b9-adf9-9cf57102d7fa | ishandutta2007/codeforces | gabrijel/normal/940/A.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, x, rj = 1e9, tr, potrj = 0;
int suma [150];
vector <int> tocke;
int main()
{
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++)
{
scanf("%d", &x);
tocke.push_back(x);
}
sort(tocke.begin(), tocke.end());
for (int i = 0; i <... | ALGO | 0.99999 | 4.064924 |
f44f4af5-d3a4-41c2-b611-333c560a7040 | TheUnicat/competitive-pwogramming | usaco/silver/2019/February/3_the_great_revegetation.cpp | //
// Created by TheUnicat on 2024-08-01.
//
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int n, m;
char type;
vector<vector<pair<int, bool> > > graph;
vector<int> searched;
bool dfs(int start, int c) {
if (searched[start] != 0) return c == searched[start];
... | ALGO | 0.999945 | 4.967849 |
6ac4280d-35f9-4852-98f5-62cd8638f6a7 | kbcgang/kbc | KBB TIME/C++/OnlineJudges/THPTChuyenNTUCoder/BSEQ.cpp | ///Hãy làm Sư tử, đừng làm Nai.😅😅😅
///Hãy làm thợ săn, đừng làm con mồi.
/// --- <EMAIL> ---
///☆*: .。. o(≧▽≦)o .。.:*☆
#include <bits/stdc++.h>
using namespace std;
#define kien long long
#define JAV main
#define Million 1000000
#define NT 10000000
#define MOD 1000000007
int n,k,m,dem, a[1000000], f[Million];
int m... | ALGO | 0.999702 | 4.17967 |
52576833-be5b-4e4e-bec7-67d5bb3bf79e | HAXAZE/LeetCode | 1918-maximum-score-of-a-good-subarray/1918-maximum-score-of-a-good-subarray.cpp | class Solution {
public:
struct item{
int val;
};
struct sparseTable{
int sze, mxLog;
vector<int> logval;
vector<vector<item>> table;
item merge(item a, item b){
return {min(a.val, b.val)};
}
item single(int v){
return {v};
... | ALGO | 0.999993 | 5.497563 |
f68d152a-c5c5-42e3-9e42-88f5de046330 | kwesa/Cpp-Projects | 7.1 Practice/7.1 Practice/LowScoreDrop.cpp | #include "LowScoreDrop.h"
#include <iostream>
#include <string>
using namespace std;
LowScoreDrop::LowScoreDrop()
{
test1 = -1;
test2 = -1;
test3 = -1;
test4 = -1;
}
void LowScoreDrop::getScore(int* t1, int* t2, int* t3, int* t4)
{
}
void LowScoreDrop::calcAverage(int* t1, int* t2, int* t3, int* t4)
{
double ... | TOOL | 0.945065 | 3.715897 |
2913e6c1-f20f-4281-a784-0e1dc74535bd | ishandutta2007/codeforces | wzyyn/normal/1437/F.cpp | #include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)... | ALGO | 0.999945 | 3.761394 |
13eeb4a6-f785-4268-bf2d-49509c75ecf2 | mukesh567/ALL-DSA-PROBLEMS | DynamicProgramming(DP)/SellStockQues/BuyAndSellStockII.cpp |
#include <bits/stdc++.h>
using namespace std;
//Infinite transactions
// Method-1 Recursion
// int solve(int index, int buy, vector<int> &prices)
// {
// // base case
// if (index == prices.size())
// return 0;
// int profit = 0;
// // buy allowed
// if (buy)
// {
// // there... | ALGO | 0.999859 | 5.609877 |
776349bc-90cc-4440-b938-75ff28644cdb | asd147asd147/High_Quality_Baekjoon | 1202-보석도둑.cpp | #include <bits/stdc++.h>
using namespace std;
int N,K,C;
long long ans = 0LL;
vector<pair<int,int>> vec;
vector<int> bag;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> N >> K;
for(int i = 0; i < N; i++){
int M,V;
cin >> M >> V;
vec.push_bac... | ALGO | 0.99993 | 3.611607 |
e5b97f9d-e9de-4b66-a1db-194738dfa799 | TanRai/Online_Judge_Solves | Leetcode/876. Middle of the Linked List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* middleNode(... | ALGO | 0.999866 | 5.868136 |
e8053235-04ea-48a0-916a-d6231f399cfb | ishandutta2007/codeforces | dorost/normal/1632/C.cpp | /* * In the name of GOD */
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
void solve() {
int a, b, a2, b2;
cin >> a2 >> b2;
a = a2;
b = b2;
int mn = abs(a - b);
for (int i = 0;; i++) {
if ((a | b) == b) {
mn = min(mn, i + ... | ALGO | 0.999867 | 4.806282 |
d215fa68-684b-4f25-99cc-5d9972b9d463 | hakuuww/uWaterlooECESoftwareCoursesProjects-Labs | ECE250/Project2/openhttest.cpp | #include <iostream>
#include <string>
#include "doubleHashing.hpp"
using namespace std;
int main(){
bool exit = false;
char userInput;
cin >> userInput;
int tableSize;
cin >> tableSize;
doubleHashingHashTable t1(tableSize);
while (exit == false || (!std::cin.eof()))
{
if (ci... | TOOL | 0.907881 | 3.796571 |
3e3f2daf-41d1-4f7b-9168-e2efe9809319 | jmerle/shell-ai-hackathon | src/strategy/layout_generator.cpp | #include "strategy/layout_generator.h"
LayoutGenerator::LayoutGenerator()
: generator(std::random_device{}()), distribution(PerimeterClearance, MapSize - PerimeterClearance) {}
TurbineLocations LayoutGenerator::generateLayout() {
TurbineLocations turbineLocations;
for (int i = 0; i < TurbineCount; i++) {
... | ALGO | 0.968719 | 4.952856 |
2fc519e4-3441-4093-ab2d-1fe517bc57e6 | piy1577/DSA | 35 Dynamic Programming/13_number_of_subsequence_abc.cpp | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vii vector<pair<int, int>>
#define vvi vector<vi>
#define ff first
#define ss second
#define rep(i, a, b) for (int i = a; i < b; i++)
int main()
{
string s;
cin >> s;
int e = 1, a = 0, ab = 0, abc = 0;
rep(i, 0, s.length())
... | ALGO | 0.999972 | 3.284828 |
2fe5e3e2-3fe8-45d8-bf44-a448624f069c | deepin-community/openjfx | modules/javafx.web/src/main/native/Source/WebCore/platform/mediastream/MediaConstraints.cpp | #include "config.h"
#include "MediaConstraints.h"
#if ENABLE(MEDIA_STREAM)
#include "RealtimeMediaSourceCenter.h"
#include "RealtimeMediaSourceSupportedConstraints.h"
#include <wtf/StdLibExtras.h>
namespace WebCore {
const String& StringConstraint::find(const WTF::Function<bool(const String&)>& filter) const
{
f... | TOOL | 0.924433 | 6.748995 |
90b9f693-a088-437e-84b3-ec61b9e226e2 | JaswanthKarangula/Leetcode | 142-linked-list-cycle-ii/142-linked-list-cycle-ii.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *detectCycle(ListNode *head) {
if(head==nullptr || head->next==nullptr)return nullptr;
ListNode* slow=head;... | ALGO | 0.999885 | 5.4204 |
7cfe0868-10e9-4368-b71b-1bcf43529838 | cmzbutqq/SCUTOJ | C++/Basic/3c.cpp | #include <iostream>
using namespace std;
int clac_num(int i, int j)
{
if (i == 1)
{
return (j + 1) * j / 2;
}
return clac_num(i - 1, j + 1) - 1;
}
int main()
{
int num;
while (cin >> num)
{
for (int i = 1, j = 1; clac_num(i, j) <= num;)
{
for (int j = 1; c... | ALGO | 0.999956 | 4.242204 |
10684fef-966c-4a62-9490-e9d4eeab17f6 | cwza/juniortrainingsheet | CF59-D2-A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
string s;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
cin >> s;
int cnt1 = 0, cnt2 = 0;
for(char ch : s) {
if(islo... | ALGO | 0.999902 | 5.676435 |
fa98d8ae-c865-4bb9-a1b9-5e0f55d456c8 | ishandutta2007/codeforces | yongaron/normal/1758/B.cpp | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
for(int i = 0; i < t; i++)
{
int n;
cin >> n;
if(n % 2)
{
for(int i = 0; i < n; i++)
... | ALGO | 0.999939 | 3.465107 |
036c2319-0f77-436a-adba-c21269407118 | tr0j4n034/SPOJ | ADACAROT.cpp | #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
/****Author: Barish Namazov****/
/*
Number of spanning trees in complete bipartite graph is: X^{Y - 1} * Y^{X - 1}
So, we hav... | ALGO | 0.999934 | 4.85992 |
59691d97-0fe1-473f-9211-59605cc634b8 | Camilo649/Competitiva | Codeforces/MyProblemset/B/Journey.cpp | #include <bits/stdc++.h>
// for's hacia adelante
#define forr(i, a, b) for(int i = (int) a; i < (int) b; ++i)
#define forn(i, n) forr(i, 0, n)
// for's hacia atras
#define dforr(i, a, b) for(int i = (int) b-1; i >= (int) a; --i)
#define dforn(i, n) dforr(i, 0, n)
// otros
#define sz(x) ((int) x.size())
#define pb push... | ALGO | 0.999608 | 3.584974 |
3d86f234-9ca7-4497-90db-d50483f67a4a | Satish7897/Dynamic-Programming | Longest Palindromic subsequence/Longest palindromic subsequence.cpp | class Solution {
public:
int longestPalindromeSubseq(string s) {
int n;
n=s.length();
int mat[n][n];
for(int i=0;i<n;i++)
mat[i][i]=1;
for(int j=2;j<=n;j++)
{
for(int i=0;i<n-j+1;i++)
{
int k=i+j-1;
if(s[i]==s[k]&&j==2)
mat[i][k]=2;
else if(s[i]==s[k])
mat[i][k]=2+mat[i+1][k-... | ALGO | 0.999937 | 5.811073 |
900783ea-0857-4d67-9060-ebcfc1a57b0a | Vzenun/Codeforces-Problems-Solutions | Two_Permutations.cpp | #include<iostream>
#include<string>
#include<cmath>
#include<climits>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
long long int t;
cin>>t;
for(long long int i=0;i<t;i++){
long long int n,a,b;
cin>>n>>a>>b;
if(n==1){
if(a==1 && b==1)... | ALGO | 0.999157 | 3.483166 |
8ddd76e4-a9ab-42ca-98fc-31db32d8f279 | Yash-YC/Source-Code-Plagiarism-Detection | gcj/gcj/188266/hh314/168107/1/extracted/1.cpp | #include<stdio.h>
#include<string.h>
int a[100];
int k;
int d[12][20000002];
void get(int n, int m)
{
k = 0;
while(n)
{
a[k++] = n % m;
n = n / m;
}
}
int set(int n, int m)
{
int r, i;
get(n, m);
int ret = 0;
for(i = 0; i < k; i++)
{
ret += a[i] * a[i];
}
if(d[m][ret] == 0)
{
d[m][n] = 0;
}
else i... | ALGO | 0.999619 | 3.090138 |
273f7a68-eb2d-4f3d-821a-7d50b3f3b37c | Asevenx174/CP-source-code- | 01_CP_CODE_LIBRARY/Miscellaneous/fastpow.cpp | ll fastpow(ll a,ll b,ll m)
{
a %= m ;
ll res = 1;
while (b > zz)
{
if (b & qq) { res = res * a % m ; }
a = a * a % m;
b >>= qq ;
}
return res;
} | ALGO | 0.999852 | 3.485096 |
480f20fb-90d2-4b99-9860-389c6965a6ab | Star369666/NUTN_C_Project | Chapter5/5-16/5-16.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
float f_of_X(float, float, float);
float f_of_X_derivative(float, float);
int main(void) {
float x0;
float y1;
int times;
float c;
printf("Enter the initial guess (= c/2): ");
scanf("%f", &c);
printf("Enter how many times sqrting: ");
scan... | ALGO | 0.999976 | 3.373126 |
cab1ff7a-33bb-4e74-ab00-d4adc6c55e37 | HMRUHUL/CP | Coding/Stack and Queue/5_LRU_Cache.cpp | /*
The task is to design and implement methods of an LRU cache. The class has two methods get() and set() which are defined as follows.
get(x) : Returns the value of the key x if the key exists in the cache otherwise returns -1.
set(x,y) : inserts the value if the key x is not already present.
If the cach... | ALGO | 0.998446 | 5.509185 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.