uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
830225a6-2e04-4382-a4e6-9be5deef02d5 | cbkpar/BOJ | boj_22188.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int iN, iM;
cin >> iN >> iM;
vector<int> vecC(iN, 0);
vector<int> vecT(iN, 0);
vector<int> vecP(iN, 0);
vector<int> vecTime(iM, 0);
vector<int> vecS... | ALGO | 0.999907 | 4.093909 |
4ca0e0c8-ed44-4d4e-ac0b-eac0de497025 | Wenzayyds/parallel | lab3/pthread_neon_2.cpp | # include <iostream>
# include <pthread.h>
#include <semaphore.h>
# include <sys/time.h>
# include <arm_neon.h> // use Neon
using namespace std;
const int n = 4000;
float A[n][n];
int NUM_THREADS = 5;
void init()
{
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
A[i][j] = 0;
}
A[i][i] = 1.0;
... | ALGO | 0.999896 | 3.453226 |
5e823af9-7d50-46d3-8bf7-531321673855 | CryptoNeverSleeps/Pulse | src/utilstrencodings.cpp | #include "utilstrencodings.h"
#include "tinyformat.h"
#include <cstdlib>
#include <cstring>
#include <errno.h>
#include <limits>
#include <openssl/bio.h>
#include <openssl/buffer.h>
#include <openssl/evp.h>
using namespace std;
static const std::string CHARS_ALPHA_NUM = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ... | TOOL | 0.974853 | 6.520417 |
bf3b8d71-84f0-4045-9436-bfee58826f35 | barryZZJ/summerACM | 2.6/G.cpp | #include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <climits>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
//快速幂
//a^b = a^(1) * a^(2^1) * a^(2^2) * a^(2^3)....
//b的二进制数的第i位乘以第i项
ll qpow(ll a, ll b, ll mod) {
ll re = 1;
while (b) {
if (b & 1) {... | ALGO | 0.999611 | 3.837638 |
b57f5ffc-8835-49a8-8163-1b61ba340261 | edisonhello/OnlineJudge | TIOJ/1108.cpp | #include <iostream>
#include <string>
using namespace std;
void solve(string preOrder, string inOrder);
int main() {
string preOrder, inOrder;
while(cin >> preOrder >> inOrder) {
solve(preOrder, inOrder);
cout << endl;
}
return 0;
}
int index(string s, char c) {
for (int i = 0; i < s.size(); ++i) {... | ALGO | 0.999975 | 4.740286 |
fdeba891-5d07-49c4-a4e0-61c72785e6c5 | priyankjairaj100/Codeforces-Solutions | contest/1087/d/47550169.cpp | // Coded with <3 by la_flame_
#include <bits/stdc++.h>
using namespace std;
#define LL long long
typedef long double LD;
const int MAX = 1e5 + 5;
const int MOD = 1e9 + 7;
const LD EPS = 1e-10;
const LD PI = acos(-1.0);
#define fastio ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define re... | ALGO | 0.99844 | 3.567018 |
72943865-6443-4df3-b890-954665f94399 | trilinos/Trilinos | packages/compadre/examples/GMLS_Manifold.cpp | #include <Compadre_Config.h>
#include <Compadre_GMLS.hpp>
#include <Compadre_Evaluator.hpp>
#include <Compadre_PointCloudSearch.hpp>
#include "GMLS_Manifold.hpp"
#include "CommandLineProcessor.hpp"
#ifdef COMPADRE_USE_MPI
#include <mpi.h>
#endif
#include <Kokkos_Timer.hpp>
#include <Kokkos_Core.hpp>
using namespace... | ALGO | 0.991312 | 6.522877 |
0d878e45-8543-4910-95e3-465f06c570bd | ishandutta2007/codeforces | xtqqwq/normal/1556/F.cpp | #include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template <typename T> bool chkmax(T &x,T y){return x<y?x=y,true:false;}
template <typena... | ALGO | 0.999962 | 3.560296 |
07fbeed2-132c-49f5-ab60-931017a6cc32 | capslpop/Infix | Infix/Includes/glm-master/test/gtx/gtx_pca.cpp | #define GLM_ENABLE_EXPERIMENTAL
#include <glm/glm.hpp>
#include <glm/gtx/pca.hpp>
#include <glm/gtc/epsilon.hpp>
#include <glm/gtx/string_cast.hpp>
#include <cstdio>
#include <vector>
#if GLM_HAS_CXX11_STL == 1
#include <random>
#endif
template<typename T>
T myEpsilon();
template<>
GLM_INLINE GLM_CONSTEXPR float myEp... | TEST | 0.965088 | 6.786098 |
e659149b-e484-425f-a3fb-0179934e7468 | alexandraback/datacollection | solutions_5686313294495744_0/C++/Lefonius/pC.cpp | // {{{
#include <bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define ALL(x) begin(x),end(x)
#define SZ(x) ((int)x.size())
#define REP(i,n) for(int i=0;i<n;i++)
#define REP2(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#ifdef F... | ALGO | 0.999826 | 3.994877 |
18688fcd-9ad0-49ec-82c2-21b7bb695660 | WhyWolfie/Gunbi-Source | CSCommon/Source/MLadderPicker.cpp | #include "stdafx.h"
#include "MMatchServer.h"
#include "MLadderMgr.h"
#include "MLadderPicker.h"
void MLadderPicker::AddTicket(MLadderGroup* pGroup, int nRandomArg)
{
m_LadderMatchList.push_back( new MLadderTicket(pGroup->GetID(), pGroup->GetScore(), nRandomArg) );
}
void MLadderPicker::AddTicket(MLadderGroup* pGro... | ALGO | 0.978375 | 4.384769 |
31842c8f-8061-4d78-96db-dd88bf5483fb | mt6589-pac/android_frameworks_av | media/libstagefright/codecs/amrwb/src/highpass_400hz_at_12k8.cpp | /*
------------------------------------------------------------------------------
Filename: highpass_400Hz_at_12k8.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
--------------------------------------------------------------... | ALGO | 0.999965 | 6.022247 |
1fd29fc0-8c5e-4b42-9e96-55067cbde8b4 | broccoli-97/libigl | include/igl/boundary_loop.cpp | template <typename DerivedF, typename Index>
IGL_INLINE void igl::boundary_loop(
const Eigen::MatrixBase<DerivedF> & F,
std::vector<std::vector<Index> >& L)
{
using namespace std;
using namespace Eigen;
if(F.rows() == 0)
return;
VectorXd Vdummy(F.maxCoeff()+1,1);
Eigen::Matrix<typename DerivedF:... | ALGO | 0.998739 | 5.818518 |
b2d1aa87-c042-4b29-986d-76e22d770612 | ahribel/leetcode | problems/medium/0189_rotate_array/cpp/solution_0189_c.cpp | //
// Created by kuwi on 4/26/25.
//
#include <numeric>
#include "solution_0189.h"
namespace solutionC {
void rotate(vector<int>& nums, int k) {
const auto n {static_cast<int>(nums.size())};
k %= n;
const auto step {gcd(n, k)};
for (int i = 0; i < step; i++) {
auto idx... | ALGO | 0.999919 | 6.383372 |
bb5daf44-2dab-4057-ab37-d0def704de25 | nafeeshossain/cpp_DSA | 27 Recursion1/8SumReturnType.cpp | #include<iostream>
using namespace std;
int sum1ton(int n){
if(n==1){ return 1; }
int sum = n + sum1ton(n-1);
return sum;
}
int main(){
cout<<sum1ton(5);
} | ALGO | 0.999874 | 4.145651 |
d77d83f1-a4a5-43f3-b69f-a22f7b27f15a | Iaminjae/Algorithm_Study | BaekJoon/0x08 ~/5014.cpp | #include <iostream>
#include <queue>
using namespace std;
int dist[1000001];
queue<int> q;
int main()
{
int f, s, g, u, d;
cin >> f >> s >> g >> u >> d;
int ud[2];
ud[0] = u;
ud[1] = d * (-1);
for (int i = 1; i <= f; i++)
{
dist[i] = -1;
}
q.push(s);
dist[s] = 0;
... | ALGO | 0.999931 | 3.649239 |
42ad2581-ea58-4744-9249-60eeabdf412e | sleeg00/algorithm | 1943/main.cpp | /*
#include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
int N, Q;
int x, y, value;
vector<vector<pair<int,int>>> arr;
void bfs(int k, int v) {
int cnt=0;
vector<int> visit(N+1,false);
visit[v]=true;
queue<pair<int, int>> q;
q.push({v, k});
while (!q.empty()) {
... | ALGO | 0.999694 | 4.417276 |
37429705-40c2-41d8-9d80-d8775f114051 | Juler115/Codeforces_Codes_Solutions | B. Make it Divisible by 25.cpp | // Problem: B. Make it Divisible by 25
// Contest: Codeforces - Codeforces Round 748 (Div. 3)
// URL: https://codeforces.com/contest/1593/problem/B
// Memory Limit: 256 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
using namespace std;
#define int long long int
... | ALGO | 0.998837 | 5.131354 |
33016ac1-4bb4-4edf-b887-a11f36e69d1b | kavita-sh/DATASTRUCTURE-AND-ALGORITHM | TwoPointers/3Sum.cpp | // Problem Link: https://leetcode.com/problems/3sum/
// The problem is to find all unique triplets in the array which gives the sum of zero.
// The solution is to sort the array and then iterate through the array and for each element we will find the other two elements using two pointers.
#include<bits/stdc++.h>
using... | ALGO | 0.999873 | 6.201626 |
7afbaec6-afba-48cf-b74d-c3d06dfbbb14 | deuce-40-all/DSA_ASSIGNMENT_- | Print the Elements of a Linked List.cpp | #include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
class SinglyLinkedList {
public:
S... | ALGO | 0.999541 | 5.447663 |
4cedfcd8-8fa0-4eb2-bca8-8688ce724610 | DaniilSelin/Compulator | include/lexer/lexer.cpp | #include "semantics.h"
#include "locale.h"
#include <string>
#include <vector>
#include <unordered_map>
#include <iostream>
#include <fstream>
#include <codecvt>
#include <sstream>
std::vector<Lexeme> lexemeReader(Context& ctx, const std::string& inputString) {
ctx.InputSTR = inputString;
State state = State::... | ALGO | 0.970899 | 4.505255 |
6c445bbf-a11a-4a6e-8f4c-4ab15407d9a6 | audunsh/fermicc | solver/ccd.cpp | #include "ccd.h"
#define ARMA_64BIT_WORD
#include <armadillo>
#include "solver/flexmat.h"
#include "basis/electrongas.h"
#include "solver/initializer.h"
#include "solver/unpack_sp_mat.h"
#include <time.h>
//#include <eigen/Eigen/Dense>
//#include <eigen/Eigen/Sparse>
using namespace std;
using namespace arma;
ccd::c... | ALGO | 0.99937 | 3.951534 |
29f4b107-4c04-4f73-8131-3617c7f0ea0f | tushar54594/LeetcodeQuestions | 0134-gas-station/0134-gas-station.cpp | class Solution {
public:
int canCompleteCircuit(vector<int>& gas, vector<int>& cost) {
int totalCost = 0;
int totalGas = 0;
int n = gas.size();
for(int i=0; i<n; i++)
{
totalCost += cost[i];
totalGas += gas[i];
}
if(to... | ALGO | 0.999995 | 5.969936 |
3272a4cd-f945-4324-8553-060e97e82ece | kmjp/procon | codeforce/951-1000/981/d3.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.99926 | 4.158707 |
8c6f996d-9dbb-4d4b-ab42-40c5830b8e62 | Abhirai1/Leetcode | 1431-kids-with-the-greatest-number-of-candies/1431-kids-with-the-greatest-number-of-candies.cpp | class Solution {
public:
vector<bool> kidsWithCandies(vector<int>& candies, int extraCandies) {
int maxo = *max_element(candies.begin() , candies.end());
vector<bool>a;
for(int i=0;i<candies.size();i++){
if(( candies[i]+extraCandies )>=maxo ){
a.push_back(true)... | ALGO | 0.999955 | 5.923684 |
dd78ca0f-44ec-444a-a580-791f1e958d54 | atalantus/Comp-Programming-Archive | LeetCode/Problems/104.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.999695 | 6.800728 |
af35c401-340f-4588-a2a0-fd521c569298 | wonseokdjango/AOJ | AOJ_LIS.cpp | #include <cstdio>
#include <cstring>
#define MAXN 500
#define MAXVAL(A, B) ( ( (A) > (B) ) ? (A) : (B) )
int C, N;
int CACHE[MAXN];
int NUMBERS[MAXN];
int main(void)
{
scanf(" %d", &C);
while (C--)
{
// input.
scanf(" %d", &N);
for (int idx = 0; idx < N; ++idx)
scanf(... | ALGO | 0.999871 | 4.156823 |
58d1d1d3-3670-43b4-ba2f-a136ffef48ab | kritzikratzi/soundythingie | src/Helpers.cpp | #include "Helpers.h"
/**
* Will read a maximum of 64 characters!
*/
void Helpers::readCommand( char * cmd, ifstream& in ){
int i = 0;
char value;
in.get( value );
while( value != ':' && !in.eof() ){
if( i >= 63 ){
// do nothing anymore!
}
else if( ( value >= 'A' && value <= 'Z' ) || ( value >= '... | TOOL | 0.899232 | 4.163873 |
3c76cef6-f7b9-48ba-8524-48c3af20c287 | ProjectBlaze-Reborn/frameworks_av | media/module/codecs/amrnb/enc/src/lpc.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/lpc.c
Date: 01/31/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updating includes and making code more simple as per comments.... | ALGO | 0.917789 | 3.832206 |
34fc2933-7f12-41f2-b345-3e4fa41ed42d | trailofbits/llvm-wedlock | llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp | #include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo/Symbolize/DIPrinter.h"
#include "llvm/DebugInfo/Symbolize/Symbolize.h"
#include "llvm/Support/COM.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Suppo... | TOOL | 0.934536 | 6.790692 |
3ffba215-2d9c-43a2-af8b-0e01a227a989 | isaiahiruoha/introduction-to-cpp | Final Exam Notes/Week 4/pointers_references_exampl_2.cpp | #include <iostream>
using namespace std;
double getAverage(const int array[], int size) {
if (size <= 0) {
std::cerr << "Invalid array size\n";
return -1;
}
int sum = 0;
for (int i = 0; i < size; ++i) {
sum += array[i];
}
return static_cast<double>(sum) / size;
}
do... | TOOL | 0.994125 | 5.084844 |
109b9a3d-2ef6-464f-8eb3-0c89e74a3a5c | stuntrally/stuntrally | source/vdrift/carsuspension.cpp | #include "pch.h"
#include "carsuspension.h"
#include "../ogre/common/Def_Str.h"
void CARSUSPENSION::DebugPrint(std::ostream & out)
{
//out << "---Suspension---" << std::endl;
out << "Disp " << fToStr(displacement, 2,4) << std::endl;
out << "Vel " << fToStr(velocity, 2,5) << std::endl;
//always 1?..
//out << "Sp... | ALGO | 0.963476 | 4.555506 |
c2ad888f-60aa-46f9-a8a2-09f3f4fa2d47 | SohamDuttae/klinker | USACO training problems/Section 1.3/milk2aux.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
using namespace std;
int main(){
//input/output objects
ifstream is("milk2.in");
ofstream of("milk2.out");
//amount of lines for to reading
int intervals;
is >> intervals;
int stored[intervals][2];
//storing the inputs and initiali... | ALGO | 0.999907 | 3.526333 |
2c1a88d3-69ff-4fcd-a35c-e211f0c48185 | jiaojb/BlockChain | untitled/main.cpp | #include <QUdpSocket>
#include <QTimer>
#include <QCoreApplication>
#include <QInputDialog>
#include <QDataStream>
#include <iostream>
#include "BlockChain.h"
#include <QtMath>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QDebug>
#include <QSqlError>
#include <QCryptographicHash>
#include <QMutex>
// 全局互斥锁,用... | WEB | 0.929821 | 4.813299 |
f12bf5bd-e757-4554-aced-00dd451a176f | cseshahriar/phitron-batch-05 | bundel-course-2-cpp/module-3.5-practice/V_Comparison.cpp | #include <iostream>
using namespace std;
int main() {
int a, b;
char s;
cin >> a;
cin >> s;
cin >> b;
if(s == '>') {
if(a > b) {
cout << "Right" << endl;
} else {
cout << "Wrong" << endl;
}
} else if(s == '<') {
if(a < b) {
... | ALGO | 0.999865 | 3.077899 |
b9c2d128-b955-4734-b559-50d3d4094b8f | arnavarora1710/Competitive_Programming | Codeforces/2026C.cpp | #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;
template<class T> using oset = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
template<class T> using omset = tree<T, null_type, less_equa... | ALGO | 0.999804 | 4.108644 |
96af3c22-c362-487b-8ac3-ba50bf9a999d | AnkurKumarKasana/leetcode | 2529-range-product-queries-of-powers/2529-range-product-queries-of-powers.cpp | class Solution {
public:
const int MOD = 1000000007;
vector<int> productQueries(int n, vector<vector<int>>& queries) {
vector<int> powers;
int power = 1;
while (n > 0) {
if (n & 1) {
powers.push_back(power);
}
power <<= 1;
n... | ALGO | 0.999949 | 5.596343 |
5ee40164-6332-4df9-be3a-81475ddd5573 | Anirudh257/Leetcode_Solutions | 0540-single-element-in-a-sorted-array/striver_binary_search.cpp | // Time complexity: O(logN), Space complexity: O(1)
class Solution {
public:
int singleNonDuplicate(vector<int>& nums) {
int size = nums.size();
int low = 0, high = size - 2; // Keeping it as size-2 to avoid
// missing numbers at the last place.
while (low <= high) {
in... | ALGO | 0.999949 | 5.93221 |
8c309855-16bd-4be5-85ae-42bad7f4bdac | yinyanghu/OI | OJ/usaco/cpp/subset.cpp | /*
ID:oifox20071
LANG:C++
PROG:subset
*/
#include <iostream>
using namespace std;
const int maxn = 40;
const int maxsum = (maxn - 1) * maxn / 2 + 1;
long long f[maxn][maxsum];
int main()
{
freopen("subset.in", "r", stdin); freopen("subset.out", "w", stdout);
int n;
cin >> n;
int sum = (n + 1) * n / 2;
if ((sum & 1... | ALGO | 0.999985 | 4.018578 |
9b3106b7-2cbd-45dd-bbaf-d8154bff6e3a | prataprohit851/LeetCode | 948-bag-of-tokens/948-bag-of-tokens.cpp | class Solution {
public:
int bagOfTokensScore(vector<int>& tokens, int power) {
sort(tokens.begin(), tokens.end());
int i = 0;
int j = tokens.size()-1;
int score = 0;
int ans = 0;
while(i <= j){
if(power >= tokens[i]){
score += 1;
... | ALGO | 0.999953 | 6.250073 |
8980290c-6bf3-41f0-8e6a-c96c2ffb7e33 | CelestialLemon/Programs | similarityH.cpp | #include<iostream>
using namespace std;
int findSimilarity(char* string1, char* string2)
{
int similarityPoints =0;
//step one, first letter match (30 points)
similarityPoints = firstLetterMatch(string1, string2);
}
int firstLetterMatch(char* string1, char* s... | ALGO | 0.994379 | 3.786869 |
beb8dc12-4231-4dd2-a292-56177a27e722 | 0point1Zishan/CP | Random_Practice/C_Tiles_Comeback.cpp | #include<bits/stdc++.h>
#define int long long int
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
void solve(){
int n, k; cin >> n >> k;
vector<int> v(n);
for(int i = 0; i < n; i++) cin >> v[i];
if(v[0] == v.back()){
int cnt = 0;
fo... | ALGO | 0.999947 | 4.341071 |
562bf197-0001-48cd-aee0-ccdebb35eedb | EdisonKun/DynamicCalculation | shunyao's data/quadruped_locomotion-master/free_gait_core/src/executor/Executor.cpp | /*
* Executor.cpp
*
* Created on: Oct 20, 2015
* Author: Péter Fankhauser
* Institute: ETH Zurich, Autonomous Systems Lab
*/
#include "free_gait_core/executor/Executor.hpp"
namespace free_gait {
Executor::Executor(StepCompleter& completer,
StepComputer& computer,
A... | ALGO | 0.968389 | 7.248243 |
c68e7aa0-9e15-4e86-9aed-84efc46b6e3d | QingIsCoding/cpp_heima | practice/STL/algorithm/find/adjecent_find/adjecent_find.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void test01()
{
vector<int> v;
v.push_back(0);
v.push_back(2);
v.push_back(0);
v.push_back(3);
v.push_back(1);
v.push_back(4);
v.push_back(3);
v.push_back(3);
vector<int>::iterator pos = adjacent_find(v.begin(), v.end());
if(p... | ALGO | 0.999719 | 3.894233 |
7ce117ef-3bc4-4746-bf40-eb7efe7effd0 | ishandutta2007/codeforces | mateocv/normal/1623/D.cpp | #include <bits/stdc++.h>
#define pb push_back
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,ggdem=b;i<ggdem;++i)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define mset(a,v) memset((a),(v),sizeof(a))
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace st... | ALGO | 0.999956 | 4.009764 |
b0fc0b49-45ff-4970-b2a3-6a9fb92e49fa | rishabhgargdps/coding_prep | 5_April_2022/height_checker.cpp | class Solution {
public:
int heightChecker(vector<int>& heights) {
vector<int>counter(101, 0);
for(int i=0; i<heights.size(); i++) {
counter[heights[i]]++;
}
for(int i=1; i<counter.size(); i++) {
counter[i] += counter[i-1];
}
int res = 0;
... | ALGO | 0.999952 | 5.53749 |
615e17b4-b937-4d7e-8563-5b8a27d4c839 | maxtyutmanov/imtrcr | tracing_service/src/vectorization/PotracePath.cpp | #include <vectorization/PotracePath.h>
#include <vectorization/StraightLineEquation.h>
#include <utils/Arithmetic.h>
#include <map>
#include <algorithm>
#include <stdexcept>
using namespace ImTrcr::Imaging;
using namespace ImTrcr::Utils;
using namespace std;
namespace ImTrcr {
namespace Vectorization {
Potrace... | ALGO | 0.997798 | 5.497653 |
550aa7c0-24fe-4ca9-84ae-3d74a650a6af | SanthiagoTI/Trabalhos-da-Faculdade-Linguagem-C | Lista de Exercícios I/2.cpp | #include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <time.h>
#include <conio.h>
#include <locale.h>
using namespace std;
int main (){ setlocale(LC_ALL,"Portuguese_Brazil");
float SAL;
printf("Qual o salrio do funcionrio? \t");
scanf("%f", &SAL);
printf("O slario deste funcio... | TOOL | 0.886899 | 3.016809 |
12322dc4-0913-4d7b-9e67-2211e2b37a86 | 7matuag/Leetcode | POTD/881. Boats to Save People.cpp | class Solution {
public:
int numRescueBoats(vector<int>& people, int limit) {
int ans = 0;
sort (people.begin(), people.end());
int i = 0, j = people.size() - 1;
while(j >= i){
if(people[i] + people[j] <= limit){
i++;
j--;
}
... | ALGO | 0.999993 | 5.940297 |
3ac493fd-1e89-484a-85dc-edb4fb9edf97 | AleksandarTulic/Programski_Jezici_1 | Vjezba2/main.cpp | #include <iostream>
#include <cstdlib>
#include "prava.h"
#include "sistem.h"
#include "niz.h"
int main()
{
int n;
std::cout<<"Broj pravih, n=";
std::cin>>n;
Prava *pr = new Prava[n];
for (int i=0;i<n;i++){
double a,b;
std::cout<<i+1<<". prava:\n";
std::cout<<" p=";
... | ALGO | 0.979055 | 3.095889 |
9cd9c0fd-92a2-4f52-bc84-f978c175c94e | mohamedismail53/Leetcode-Study-Plans | Programming Skills/Programming Skills I/Day_10/28_Sum_of_Left_Leaves.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.999851 | 6.493653 |
4e7313d7-e0f5-4295-957b-53212d5b8792 | Pradum-codes/DSA | LeetCode/3005.cpp | #include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
using namespace std;
// class Solution {
// public:
// int maxFrequencyElements(vector<int>& nums) {
// map<int,int> mp;
// // map<int,int> max;
// int max = -1;
// for(int i : nums){
// mp[i]... | ALGO | 0.999965 | 5.293782 |
b852e3d8-0426-484e-a8e8-d9f427deea17 | Vaishnaviii25/Leetcode-DSA-Practice | Reverse words in a given string - GFG/reverse-words-in-a-given-string.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
string reverseWords(string S)
{
// code here
stringstream ss(S);
string word;
vector<string> words;
while (getline(ss, word, '.')) {
words.push... | ALGO | 0.999574 | 6.04726 |
602fd854-287d-4640-a96e-e910b3dcb4ac | ishandutta2007/codeforces | atoiz/normal/1368/E.cpp | #include <stdio.h>
#include <string.h>
int i, u, v, t, m, n, a[200007][2], d[200007], c;
int main()
{
scanf("%d", &t);
while (t--) {
scanf("%d %d", &n, &m);
memset(a, 0, sizeof(a[0]) * (n + 1));
memset(d, 0, sizeof(d[0]) * (n + 1));
while (m--) {
scanf("%d %d", &u, &v);
a[u][!!a[u][0]] = v;
}
c ... | ALGO | 0.999926 | 4.185343 |
d3426582-30bc-4134-b8cb-e25bf33ab823 | melancholicpp/CSGO-2018-Source | bonesetup/bone_utils_PS3.cpp | #include "mathlib/mathlib.h"
#if defined(__SPU__)
#include "ps3/spu_job_shared.h"
#endif
#include "bone_setup_PS3.h"
#include <string.h>
#if !defined(__SPU__)
#include "tier0/vprof.h"
#endif
#include "mathlib/ssequaternion.h"
#include "bone_utils_PS3.h"
// -----------------------------------------------------------... | ALGO | 0.981852 | 5.070536 |
a9df4249-4615-4594-bdb4-d687338ff4de | Justinshao33/competitive_programming | done/AtCoder/011_Gravy_Jobs_6.cpp | #pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,popcnt,sse4,abm")
#include<bits/stdc++.h>
using namespace std;
#define ZTMYACANESOCUTE ios_base::sync_with_stdio(0), cin.tie(0)
#define ll long long
#define ull unsigned long long
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define debug(x) ... | ALGO | 0.999744 | 4.996316 |
921a18db-180c-4d92-b3fa-46f7caa20e2f | 1JigSaW/algorithms | practice/chapter_1/gcd.cpp | #include <cassert>
#include <iostream>
#include <cstdint>
template <class Int>
Int gcd(Int a, Int b) {
assert(a > 0 && b > 0);
Int current_gcd = 1;
for (Int d = 2; d <= a && d <= b; d++) {
if (a % d == 0 && b % d == 0) {
current_gcd = d;
}
}
return current_gcd;
}
int m... | ALGO | 0.999475 | 5.688146 |
36aaf208-084c-4ef4-9ea3-f82301008ce2 | Red-0111/Leetcode | 1460-number-of-substrings-containing-all-three-characters/1460-number-of-substrings-containing-all-three-characters.cpp | class Solution {
public:
int numberOfSubstrings(string s) {
int l=0, r=0, cnt=0, n=s.size()-1;
unordered_map<char,int> mp;
for(r=0;r<=n;r++)
{
mp[s[r]]++;
while(mp['a']&&mp['b']&&mp['c'])
{
cnt+=1+(n-r);
mp[s[l]]--;
... | ALGO | 0.999912 | 5.214151 |
2991f5a6-cd36-4ea1-b081-883439d264dc | umangja/CompetitiveProgrammingSolution | codeforces/1473/C.cpp | /*input
4
1 1
2 2
3 2
4 3
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
int T = 1;
cin>>T;
while(T--)
{
ll n,k;cin>>n>>k;
ll mx = ((n-k)*(n-k+1))/2;
set<ll> st;
for(int i=1;i<=k;i++) st.insert(i);
ll L = 1,R = k;
for(int i=1;i<=k;i++)
{
if(i<(2*k-n)) c... | ALGO | 0.999962 | 4.076237 |
03570505-0bf4-4596-8db7-12e33dbc1d56 | Em-iIy/Particle-System | src/Config.cpp | /*
Created by: Emily (Em_iIy) Winnink
Created on: 19/02/2025
*/
#include "Config.hpp"
#include "utils.hpp"
enum e_conf_tok {
TITLE,
FOV,
FULLSCREEN,
WIDTH,
HEIGHT,
VIEW_BOX_DIMENSIONS,
VSYNC,
POST_PROCESSING,
SIM_SPEED,
COLOR1,
COLOR2,
PARTICLE_COUNT,
PARTICLE_MASS,
PARTICLE_SIZE,
PARTICLE_INIT_POSITI... | CONFIG | 0.985392 | 5.951126 |
c3dd044e-bd87-4712-b689-ec7969d9337a | flick-23/leetcode | 0103-binary-tree-zigzag-level-order-traversal/0103-binary-tree-zigzag-level-order-traversal.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.999996 | 6.123486 |
7f5ad747-2f4d-4840-aab9-c34ab945e902 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_463_0.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
long long r, x1, y1, x2, y2;
while (cin >> r >> x1 >> y1 >> x2 >> y2) {
double dis = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + 0.0);
cout << ceil(dis / 2 / r) << endl;
}
return 0;
}
| ALGO | 0.999671 | 3.081428 |
e46c99cf-a2f2-4aa8-8a63-f91521670761 | zzvalkatazz/week2 | stackCalculate/Source.cpp | #include<string>
#include<cwctype>
#include<cassert>
#include<stack>
int calculate(std::string s)
{
int len = s.length();
if (len == 0)
{
return 0;
}
std::stack<int> stack;
int currentNumber = 0;
char operation = '+';
for (int i = 0; i < len; i++)
{
char currentChar = s[i];
if (isdigit(currentChar))
{... | ALGO | 0.998771 | 5.206679 |
c2ee7066-26c6-49f4-a73f-f919e494e80c | yadavvikas007/30days-6-companies | AMAZON/_15___Delete_N_nodes_after_M_nodes_of_a_linked_list.cpp | // Delete N nodes after M nodes of a linked list
// My Profiles--------------------------------------------------------------------
// GFG : https://auth.geeksforgeeks.org/user/vy9690703/profile
// Leetcode : https://leetcode.com/xmenvikas07/
// Codeforces : https://codeforces.com/profile/xmenvikas07
// Codechef : htt... | ALGO | 0.999653 | 5.350159 |
94bed9dc-b989-4d95-95ae-8826eb772789 | Ziklon/algorithms | tc/testprograms/Fifteen.cpp | #include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
using namespace std;
int dp[1<<9][1<<9][2];
bool check(int mask){
vector<int> v;
for(int i=0;i<9;i++)i... | ALGO | 0.999891 | 4.772897 |
2389eb09-77f3-4c26-a679-84c07f8f04fd | sarthak2012/gfg | Basic/Sort a String/sort-a-string.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
string sort(string s);
int main(){
int t;
cin >> t;
while(t--){
string s;
cin >> s;
cout << sort(s) << endl;
}
return 0;
}
// } Driver Code Ends
string sort(string s){
//complete the function here
/*
... | ALGO | 0.999858 | 6.171194 |
2fbe8947-fd70-47b5-b134-af7d1d09e0cd | anands29-mac/Snake_Game | Lab 2/Lab1-Model (Improved)/src/Player.cpp | #include "Player.h"
#include "objPosArrayList.h"
#include "objPosDLinkedList.h"
#include <iostream>
using namespace std;
#define TEST_LENGTH 40960
Player::Player(int x, int y, char symbol, GameMechs* gm, ItemBin* bin)
{
// Choose the list type for Lab 2
//myPos = new objPosArrayList();
myPos = ne... | TOOL | 0.864379 | 3.782186 |
cd66143d-4948-4b47-930d-43b72abde605 | lansen31/learngit | C-Plus-Plus/sorting/recursive_bubble_sort.cpp | /**
* @file
* @author [Aditya Prakash](https://adityaprakash.tech)
* @brief This is an implementation of a recursive version of the [Bubble sort algorithm](https://www.geeksforgeeks.org/recursive-bubble-sort/)
*
* @details
* The working principle of the Bubble sort algorithm.
* Bubble sort is a simple sorting a... | ALGO | 0.999977 | 7.393331 |
d7162d19-414f-4b68-8d73-4de751aebd2a | Pavitar56/LeetCode | 0944-delete-columns-to-make-sorted/0944-delete-columns-to-make-sorted.cpp | class Solution {
public:
int minDeletionSize(vector<string>& strs) {
int m = strs.size();
int n =strs[0].size();
int count=0;
for(int i=0;i<n;i++)
{
string word = "";
for(int j=0;j<m;j++)
{
word += strs... | ALGO | 0.999989 | 6.198754 |
d9c86a51-fcac-4c20-9386-fa7d7aadad36 | ishandutta2007/codeforces | guyuplion/normal/283/D.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999816 | 3.55992 |
bf19e5bc-cd56-4be3-b869-0d8fe8521a7d | someear9h/CP-DSA | leetcode/dp/triangle.cpp | // https://leetcode.com/problems/triangle/description/
#include <iostream>
#include <vector>
using namespace std;
int solve(vector<vector<int>> &triangle) {
int n = triangle.size();
vector<int> front(n, 0);
vector<int> curr(n, 0);
for(int j = 0; j < n; j++) {
front[j] = triangle[n - 1][j];
... | ALGO | 0.99998 | 6.63678 |
4c6418dc-cc81-433a-8f5d-0d1365fe564c | Tornado025/Competitive-Programming | Codeforces/1927D_Find_the_Different_Ones.cpp | #include <bits/stdc++.h>
#define int long long int
using namespace std;
int32_t main(){
int t;cin>>t;
while(t--){
int n;cin>>n;int arr[n];
for(int i=0;i<n;i++)cin>>arr[i];
int ans[n];
for(int i=0;i<n;i++)ans[i]=-1;
for(int i=1;i<n;i++){
ans[i]=ans[i-1];//defau... | ALGO | 0.999948 | 3.993231 |
3a07dde1-6c33-4ebd-a421-8634eddf752f | MohammedAladin/Computer_Graphics_Project | graphics project.cpp | #if defined(UNICODE) && !defined(_UNICODE)
#define _UNICODE
#elif defined(_UNICODE) && !defined(UNICODE)
#define UNICODE
#endif
using namespace std;
#include <iostream>
#include <tchar.h>
#include <windows.h>
#include<cmath>
#include<list>
#include<stack>
#include<vector>
#include <fstream>
//-------------------------... | ALGO | 0.967052 | 3.224518 |
e2d48366-3f2f-4679-8156-0ac3dc4b538c | Rohit-Yadav-47/DSA-Questions | Remove every k'th node .cpp | Node* deleteK(Node *head,int K)
{
int cnt=0;
Node* temp=head;
Node* prev=NULL;
if(K == 1)return NULL;
while(temp){
cnt++;
if(cnt==K){
prev->next=temp->next;
cnt=0;
}
prev = temp;
temp=temp->next;
}
return head;
}
| ALGO | 0.999952 | 3.077345 |
05f9c872-4ec9-4a20-81cf-9a1611f38aa1 | RedBlueBird/competitive-programming | USACO/2015-2016/1-Dec/Silver/2-HighCardWins.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ofstream fout("highcard.out");
ifstream fin("highcard.in");
// ofstream fout("../output.txt");
// ifstream fin("../input.txt");
//Take inputs
int n;
fin >> n;
vector<int> opp(n);
for (int i = 0; i < n; i... | ALGO | 0.999722 | 3.981498 |
8fb39a68-4ed6-4900-b024-a22d376ed603 | prakashharsh009/DSA-DONE_AND_DUSTED | Recursion🔁/Striver's Recursion Playlist/Subset_Sum_I.cpp | void subsetSum(int index , int sum , vector<int> &arr, vector<int> &res){
//BASE CASE
if(index == arr.size()){
res.push_back(sum);
return;
}
//PICKING UP THE ELEMENT AT INDEX
subsetSum(index+1, sum + arr[index], arr, res);
//NOT PICKING UP THE ELEMENT AT INDEX
subsetSum(ind... | ALGO | 0.999941 | 5.644305 |
e78e6e81-24bb-406b-bd22-9315b400b075 | Arvln/LeetCode | BFS/542.01-Matrix/542.01-Matrix.cpp | class Solution {
int dirs[4][2]{{1,0},{0,1},{-1,0},{0,-1}};
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& mat) {
int m=mat.size(), n=mat[0].size();
queue<pair<int, int>>q;
vector<vector<int>>visited(m, vector<int>(n, 0));
for (int i=0; i<m; i++)
for (i... | ALGO | 0.999949 | 6.379453 |
422e9210-2cad-49d6-8042-55c0dbe3511c | ArnabDas2003/leetcode-solution | 0024-swap-nodes-in-pairs/0024-swap-nodes-in-pairs.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* swapPairs(L... | ALGO | 0.99999 | 6.0808 |
e4e882c5-8567-4e9c-82a5-fe317f5ed230 | GaryLeeChou/LeetcodeExercise | Easy/20_ValidParentheses.cpp | class Solution {
public:
bool isValid(string s) {
bool ans = true;
string sTr = "";
for(int i = 0 ; i < s.size(); i ++){
cout<<s[i]<<endl;
string::iterator it = sTr.end();
if(s[i] == '('){
sTr.push_back('a');
}else if(s[i] == ... | ALGO | 0.999146 | 5.606969 |
52fb7569-fbec-498e-875f-5a403e045fde | vishusharmaX/100DaysofCodeChallenge | 2938-separate-black-and-white-balls/2938-separate-black-and-white-balls.cpp | class Solution {
public:
long long minimumSteps(string s) {
long long count = 0;
int last = 0;
int n = s.length();
for(int i = 0; i < n; i++){
if(s[i] == '0'){
count += (i-last);
last++;
}
}
return count;
... | ALGO | 0.999905 | 5.967606 |
7ff7bff2-9078-41d1-bf47-798859b5721a | Jnshiroya/jenish-shiroya | laab.cpp | #include <iostream>
#include<string>
using namespace std;
class string1
{
int len;
char *p;
string s;
int count = 0;
public:
string1()
{
cin >> len;
p = new char[len];
cin >> p;
}
void enetrs()
{
cin >> s;
}
int findocc(string1 &s1)
{
... | ALGO | 0.998452 | 3.331376 |
2e5060c3-71de-4afe-a377-7a77346bd34a | nguoitamamo/thuattoan_codeC- | dem cặp có tổng lớn hơn k.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int dau_tien(int a[], int l, int r, int k)
{
int save = 0;
while (l <= r)
{
int m = (l + r) / 2;
if (a[m] > k)
{
save = m;
r = m - 1;
}
else
{
l = m + 1;
}
}
return save;
}
int main()
{
int n,k; cin >> n >> k;
int a[100]{};
for (... | ALGO | 0.999975 | 4.433223 |
f01805f9-4f0f-4256-9779-0abb1c4c1c73 | ahmadmamdouh-10/Data_Structure_ITI_Tasks | Day4/Day4.TreeBinarySearch/main.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int Data;
Node *Left, *Right;
Node(int data)
{
Data = data;
Left = Right = NULL;
}
};
class Tree
{
Node *root;
public:
Tree()
{
root = NULL;
}
void Add(int data)
{
Node *newNode... | ALGO | 0.999948 | 5.10194 |
8371cc21-4ac0-4d9b-b2c9-4e5c36194f5d | Seann0425/LeetCode | finished/78. Subsets.cpp | #include <bits/stdc++.h>
using namespace std;
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) {
}
};
struct TreeNode {
int val;
TreeNode *left;
... | ALGO | 0.999936 | 4.898192 |
f03b3ef2-a2b9-4e56-9223-580efb63bbd3 | cherewaty/maxflow | benchmark.cpp | #include <algorithm>
#include <iostream>
#include <random>
#include <vector>
#include "cycle_timer.h"
#include "graphs.h"
#define IDX(i, j, n) ((i) * (n) + (j))
/*
* Signifcant portions of source from https://github.com/vulq/Flo
*/
// Generates a random directed graph that ensures there exists some s-t path, where... | TEST | 0.981111 | 6.247962 |
7f995669-82a5-41a8-80f1-66b99aa11a8a | Oracynx/Source-Code | CQYC/2024/0826/B.cpp | #include <cstdio>
#include <tuple>
#include <vector>
constexpr int MaxN = 5e2 + 5;
int n, m, k;
int board[MaxN][MaxN];
void print()
{
std::vector<std::tuple<int, int>> p1;
std::vector<std::tuple<int, int>> p2;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= m; j++)
{
if (... | ALGO | 0.99989 | 3.527329 |
59fe48b2-8653-423d-aabc-c4c87108f0db | iains/LLVM-8-Branch | llvm/lib/Transforms/Scalar/ADCE.cpp | #include "llvm/Transforms/Scalar/ADCE.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#... | TOOL | 0.957176 | 6.554421 |
3b24d21b-9613-4859-b995-481a6edc83c0 | davdleet/algorithms-practice | BOJ/5639/A.cpp | #include <iostream>
#include <string>
using namespace std;
class node
{
public:
int value;
node *left = nullptr;
node *right = nullptr;
node(int val)
{
value = val;
}
void insert(node *n)
{
if (n->value < value)
{
if (left)
{
... | ALGO | 0.999961 | 5.005421 |
98030aa8-a2c7-4877-8552-0be651839197 | Ethan4582/Codeforces-solution | CODEFORCES/A_set/A_Flipping_Game.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int maxOnes = 0;
for (int i = 0; i < n; i++) {
for (int j = i; j < n; j++) {
int cnt = 0;
for (int k = 0; k < ... | ALGO | 0.999986 | 4.389953 |
9c084b15-8a68-4c8c-969b-07fe5b800f3d | martin0327/LeetCode | 2696-minimum-string-length-after-removing-substrings/2696-minimum-string-length-after-removing-substrings.cpp | class Solution {
public:
int minLength(string s) {
string t;
for (auto c : s) {
if (t.empty()) t += c;
else if (t.back() == 'A' && c == 'B') {
t.pop_back();
}
else if (t.back() == 'C' && c == 'D') {
t.pop_back();
... | ALGO | 0.999435 | 6.024695 |
39fa7a04-faa4-4c6b-afca-ba8943413eb1 | itsan2448/leetcode-solutions- | 0920-uncommon-words-from-two-sentences/0920-uncommon-words-from-two-sentences.cpp | class Solution {
void store(map<string,int> &m, string s){
stringstream ss(s);
string w;
while(ss>>w){
m[w]++;
}
}
public:
vector<string> uncommonFromSentences(string s1, string s2) {
vector<string> v;
map<string,int> m1;
map<string,int> m... | ALGO | 0.999707 | 5.005477 |
6317e977-bb28-42a4-b051-d35b207f8df2 | itkingnb/cf-atc-and-so-on | codeforces/999.1+2/d.cpp | #include<bits/stdc++.h>
#define pii pair<int,int>
#define mii map<int,int>
#define msi map<string,int>
#define ll long long
#define all(x) (x).begin(), (x).end()
using namespace std;
int maxint = INT_MAX;// 2147483647
int minint = INT_MIN;// -2147483648
long long maxll = LLONG_MAX;// 9223372036854775807
long long minll... | ALGO | 0.999979 | 3.747766 |
5497291c-ca80-43e7-a86d-1ff71cae5890 | myscale/MyScaleDB | src/Analyzer/Passes/LogicalExpressionOptimizerPass.cpp | #include <Analyzer/Passes/LogicalExpressionOptimizerPass.h>
#include <Functions/FunctionFactory.h>
#include <Analyzer/InDepthQueryTreeVisitor.h>
#include <Analyzer/FunctionNode.h>
#include <Analyzer/ConstantNode.h>
#include <Analyzer/HashUtils.h>
namespace DB
{
class LogicalExpressionOptimizerVisitor : public InDep... | ALGO | 0.949373 | 7.686279 |
df008145-7594-4869-9d69-c54235d1252b | DWGTech/DWG | deps/libigl/include/igl/bijective_composite_harmonic_mapping.cpp | #include "slice.h"
#include "doublearea.h"
#include "harmonic.h"
//#include "matlab/MatlabWorkspace.h"
#include <iostream>
template <
typename DerivedV,
typename DerivedF,
typename Derivedb,
typename Derivedbc,
typename DerivedU>
IGL_INLINE bool igl::bijective_composite_harmonic_mapping(
const Eigen::Matri... | ALGO | 0.993874 | 6.807374 |
fc4db63d-f3b6-4a0d-97d4-b472ea980056 | dabslee/Project-Euler | PE4/PE4.cpp | #include "pch.h"
#include <iostream>
#include <string>
using namespace std;
bool checkpal(int n) {
string s = to_string(n);
string s2 = "";
for (int i = s.length() - 1; i >= 0; i--) {
s2 += s[i];
}
return s == s2;
}
int main() {
int max = 0;
for (int i = 0; i < 1000; i++) {
for (int j = 0; j < 1000; j++) {... | ALGO | 0.999723 | 5.589603 |
15746ec2-6763-4187-918b-446e1ab60692 | wangtongxue-369/xcpc_Code_file | file/codeforces/race/1006_div3/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define INF 0x3f3f3f3f
#define PII pair<ll, ll>
const ll mod = 1e9 + 7;
const ll MAXN = 500005;
const ll base1 = 131;
const ll base2 = 127;
ll _ = 1, n, m, ans = 0, a[MAXN], f[MAXN];
void solve()
{
cin >> n;
for (i... | ALGO | 0.999743 | 4.04675 |
e74f4e56-c601-45a8-a5b3-a83204a60ca0 | fjarcticfox/blender | extern/bullet2/src/BulletSoftBody/btSoftSoftCollisionAlgorithm.cpp | #include "btSoftSoftCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletSoftBody/btSoftBodySolvers.h"
#include "btSoftBody.h"
#include "BulletCo... | ALGO | 0.994275 | 3.800098 |
23e7b015-a44b-4cff-80e3-85d5de58f2e2 | pseudo-usama/my-undergrad-coding | 1 Semesters/1/Programming fundamentals/1Non Graphical/11 First Assingment/8date to day.cpp | // 8date to day.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "iostream"
using namespace std;
int main()
{
long days = 0, year;
int date, month, DayDecieder = 8, leapDecieder;
cout << "Enter the date. = ";
cin >> date;
cout << "Enter the month. ... | ALGO | 0.99795 | 3.642238 |
06294599-ff8f-4542-ac8a-495ed8a18699 | PranavMahara/C-Programming | CodeChef/RPD.cpp | #include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
for(int i=0; i<t; i++){
int n;
cin>>n;
int arr[n];
for(int i=0; i<n; i++){
cin>>arr[i];
}
int max = 0;
for(int i=0; i<n; i++){
for(int j=0; j<n; j++){
... | ALGO | 0.999955 | 4.207815 |
6cc09c70-5771-4929-b3e9-74cd1807a9ff | tanvirs27/Solved_CP_Problems | UVa/10110 - Light, more light/10110 - Light, more light.cpp | #include<stdio.h>
#include<math.h>
int main()
{
long long int n,m,x;
while(scanf("%lld",&n)==1)
{
if(n==0)break;
m=sqrt(n);
x=m*m;
if(x==n)
printf("yes\n");
else
printf("no\n");
}
return 0;
}
| ALGO | 0.999928 | 3.81692 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.