uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
19b9b7a7-5977-4e1b-bb99-dea38ae9d108 | Sheng1994/percy | cryptominisat/src/solutionextender.cpp | #include "solutionextender.h"
#include "solver.h"
#include "varreplacer.h"
#include "occsimplifier.h"
//#define VERBOSE_DEBUG_SOLUTIONEXTENDER
using namespace CMSat;
SolutionExtender::SolutionExtender(Solver* _solver, OccSimplifier* _simplifier) :
solver(_solver)
, simplifier(_simplifier)
{
}
void SolutionE... | ALGO | 0.990054 | 5.828251 |
5cf50085-e3e1-4d72-85c8-ddbeddfd38bf | Alonefcp/Leetcode-problems-solutions | Problems/383.RansomNote.cpp | #include <vector>
#include <string>
#include <unordered_map>
using namespace std;
/*
Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from magazine and false otherwise.
Each letter in magazine can only be used once in ransomNote.
Example 1:
Input: ransomN... | ALGO | 0.993823 | 7.02257 |
b644a2ef-0d20-4afe-90d2-24c3526ed721 | bernardoviero/estruturaDeDados | Exercicios/Atividade Exluir dados Lista/podaLista.cpp | #include "codigo.h"
#include <ctime>
Celula *popular(Celula *lista, int n){
srand(time(NULL));
for(int i=0;i<n;i++){
lista = inserirLista(rand()%50,lista);
}
return lista;
}
int main(){
int qntNumeroLista = 30;
Celula *lista = NULL;
lista = popular(lista, qntNumeroLista);
co... | ALGO | 0.995119 | 4.089532 |
492fb6bc-0581-4fad-a0e4-869935c6dafb | goropikari/CompetitiveProgramming | atcoder/abc274/c.cpp | /*https://atcoder.jp/contests/abc274/tasks/abc274_c*/
// #include <atcoder/all>
// using namespace atcoder;
// using mint = modint998244353;
// using mint = modint1000000007;
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i, n) for (int i = 0; i < (n)... | ALGO | 0.999983 | 3.910024 |
4625763a-b70c-406c-b298-9e3b35755af0 | espressif/esp-boost | test_apps/graph/example/main/planar_face_traversal.cpp | #include <boost/graph/planar_face_traversal.hpp>
#include <boost/graph/boyer_myrvold_planar_test.hpp>
using namespace boost;
// Some planar face traversal visitors that will
// print the vertices and edges on the faces
struct output_visitor : public planar_face_traversal_visitor
{
void begin_face() { std::cout <... | ALGO | 0.996171 | 7.461198 |
2ff92e4c-60d3-4a02-9cbb-2433a06d8726 | jimmy-hsin/Leetcode-record | c++/0827. Making A Large Island/DFS_efficient version.cpp | class Solution {
public:
vector<int> dir = {-1, 0, 1, 0, -1};
int largestIsland(vector<vector<int>>& grid) {
//第一步,探詢每個島嶼的大小
int n=grid.size();
vector<int> islandSize={0,0};
int zeroCnt=0;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(g... | ALGO | 0.999731 | 5.529801 |
ef8a6e7b-9697-4838-b6ca-308eaf3e6b89 | MikeR1992/SRlib | cpp/hashmap/unique.cpp | #include <unordered_map> // Hash table
#include <vector>
#include <iostream>
using namespace std;
typedef unordered_map<int, bool> hashmap;
// A function equivalent to np.unique, return a vector of all the unique elements
vector<int> unique(vector<int> &array){
// Create a hash table
hashmap uniqueItems;
// I... | ALGO | 0.999185 | 5.013043 |
226e7380-99d7-4f62-8cd9-baf58e1f15c0 | Edemolt/codeforces | codechef/171D/E.cpp | /***************************************
Name : Demolt
Date : 29/01/2025
Contest : Codechef
***************************************/
#include <bits/stdc++.h>
using namespace std;
// Optimize macros for Codeforces
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define pb p... | ALGO | 0.999927 | 5.422635 |
e2375e24-9349-492d-8a08-953f6adb22d9 | himham-jak/Jak1-but-Microtransactions | decompiler/Disasm/InstructionParser.cpp | #include "InstructionParser.h"
#include <algorithm>
#include <optional>
#include <stdexcept>
#include "common/common_types.h"
#include "common/util/Assert.h"
#include "third-party/fmt/core.h"
namespace decompiler {
InstructionParser::InstructionParser() {
init_opcode_info();
// we only support a subset of the ... | TOOL | 0.918897 | 5.294746 |
3f896f9b-c9f5-4cca-965c-b85729f22b11 | yliu-fort/gallery | 04_particle_segregation_sims/src/visual_ks2d.cpp | #include <iostream>
#include <string>
#define CL_GL_INTEROP
#include "syclode45.hpp"
#include "sycl_integrator_rk45.hpp"
#include "sycl_integrator_adm4.hpp"
#include "ks2d_algorithm.hpp"
#include "memory"
using namespace cl::sycl;
// state_type = double
constexpr access::mode sycl_read = access::mode::read;
constex... | ALGO | 0.998898 | 5.224329 |
fedd8cbd-d45b-4fc4-8d5a-83e61e5dd32a | yashikajotwani12/DataStructures_Algorithms | backtracking/letter_comb_phone_keypad.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<string> relations ={"0","1","abc","def", "ghi","jkl","mno","pqrs","tuv","wxyz"};
void helper(string digits, vector<string> &ans, string currentstr, int i)
{
if(i >= digits.size())
{
ans.push_back(cu... | ALGO | 0.999669 | 6.178483 |
041435e9-1c86-4dbd-a3f0-718723390c5c | himanshu-221/assignment-33 | Q7DeterminantOfMatrix.cpp | #include<iostream>
using namespace std;
class matrix
{
protected:
int a,b,c,d;
public:
void set_data()
{
cout<<"Enter Four elements of 2x2 matrix\n";
cin>>a>>b>>c>>d;
cout<<"Your entered matrix is:-\n";
cout<<a<<" "<<b<<"\n"<<c<<" "<<d<<end... | ALGO | 0.999415 | 4.063616 |
fa7feb3d-5933-4dea-8efc-555babcc8467 | alsofly/heard | sort/merge.cpp | #include <iostream>
void mergesort(int *num, int *tmp, int l, int r)
{
if ( l >= r ) return;
int mid = (l + r)/2;
mergesort(num, tmp, l, mid);
mergesort(num, tmp, mid+1, r);
int p1(l), p2(mid+1), pt(l);
while ( p1 <= mid && p2 <= r )
{
if ( num[p1] < num[p2] ) tmp[pt++] = num[p1++];
e... | ALGO | 0.999986 | 4.692059 |
d3552e3d-b6ab-4ba2-b518-f8fb464be6ec | DuDafang/PAT | BasicLevel_C++/1026程序运行时间.cpp | #include<iostream>
using namespace std;
int main(){
int a,b;
scanf("%d%d",&a,&b);
int ans=b-a;
if(ans%100>=50){//λǷʮж/100֮ỹ
ans=ans/100+1;
} else ans=ans/100;
int ss=ans%60;
int mm=ans%3600/60;
int hh=ans/3600;
printf("%02d:%02d:%02d",hh,mm,ss);
return 0;
}
| ALGO | 0.998467 | 3.443826 |
87f19d00-3474-4ca2-95df-36575c23289a | ThBreuer/EmbSysLib | Src/Std/Crc.cpp | /
//*******************************************************************
#include "Crc.h"
//*******************************************************************
namespace EmbSysLib {
namespace Std {
//*******************************************************************
//
// Crc
//
//***********************************... | ALGO | 0.999326 | 5.698668 |
c9907f9b-e1b0-4093-83e7-28e9ffd15303 | Alvee78/Codeforces | D_Print_Digits_using_Recursion.cpp | #include<bits/stdc++.h>
using namespace std;
//typedef ...
#define ll long long
typedef unsigned long long ull;
typedef long double lld;
typedef pair<int, int>pii;
typedef pair<ll, ll>pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii>vpii;
typedef vector<pll>vpll;
typedef vector<vi>vvi;
typedef vec... | ALGO | 0.999812 | 5.782705 |
cac97d05-ce8a-4e3d-b864-1e3e0ed63021 | 113bommy/LogicalErrorFixCodeT5 | logicalErrorFix_CodeT5_Linenumber/model/cpp/CodeT5_LineNumber_cpp_gold/Problem_160_gold_738.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, m;
cin >> n >> m;
int rb, cb, rd, cd;
cin >> rb >> cb >> rd >> cd;
int x1, x2;
if (rb <= rd) {
x1 = rd - rb;
} else if (rb > rd) {
x1 = 2 * (n)-rb - rd;
}
if (cb <= cd) {
x2 = cd - cb;
} else if (cb > cd) {
x2 = 2 * (m)-cb ... | ALGO | 0.999393 | 3.217504 |
bee2ea15-47a7-402b-ab68-fcc3799aeeb2 | ImageProcessing-ElectronicPublications/scantailor-experimental | src/dewarping/DistortionModelBuilder.cpp | #include <algorithm>
#include <exception>
#include <iterator>
#include <limits>
#include <cmath>
#include <cassert>
#include <boost/foreach.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#include <QTransform>
#include <QImage>
#include <QPainter>
#include <QPen>
#... | ALGO | 0.999218 | 6.932218 |
e8d79c6f-b025-4cf0-a4d4-90df8defc910 | NahmG/StackMaker_OLD | Library/PackageCache/com.unity.ide.visualstudio@2.0.22/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.947374 | 6.926379 |
9798fcde-0092-4fa8-98a9-2bb17f6d9608 | zzo30802/leetcode | src/medium/3_Longest_Substring_Without_Repeating_Characters.cpp | // #include "../../include/common.h"
/*
https://leetcode.com/problems/longest-substring-without-repeating-characters/
Question:
Given a string s, find the length of the longest substring
without repeating
characters.
Example 1:
Input: s = "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
E... | ALGO | 0.998316 | 5.092596 |
83cbe682-0aa9-4ae5-8089-7e89a0cb8279 | KwakJiyeon/BOJ | 20210712~20210718/11047_동전0.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> v;
int N = 0;
int K = 0;
cin >> N >> K;
for (int i = 0; i < N; i++) {
int coin = 0;
cin >> coin;
v.push_back(coin);
}
sort(v.begin(), v.end());
int i = N - 1;
int count = 0; //
while (K != 0... | ALGO | 0.999805 | 4.124061 |
e2d6f954-441a-4e13-ad34-d54c201a3102 | hoanpvpv/DSAPTIT | DSA07019 - HÌNH CHỮ NHẬT LỚN NHẤT.cpp | #include <iostream>
#include <stack>
#define ll long long
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int a[n], v[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
v[i]=1;
}
stack <int> st,sc;
for(int i=0;i<n;i++)
{
while(!... | ALGO | 0.999899 | 3.269607 |
72b73801-94b3-4ec9-bd17-093a55259a5d | austin1997/Leetcode_cn | leetcode_385_M/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class NestedInteger {
public:
// Constructor initializes an empty nested list.
NestedInteger() = default;
// Constructor initializes a single integer.
NestedInteger(int value) : isList(false), value(value) {}
// Retu... | ALGO | 0.996865 | 6.652023 |
2e9feb99-5c85-4514-be6e-a2b7681c534c | antusaha970/My-source-code-DSA | leetcode/levelOrderTraversalii.cpp | #include <iostream>
#include <stack>
#include <queue>
#include <vector>
#include <climits>
#include<algorithm>
using namespace std;
// Definition for a binary tree node.
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x... | ALGO | 0.999977 | 5.272806 |
cade5847-66f4-4da2-a978-16a2589946ea | ishandutta2007/codeforces | tzc_wk/normal/1439/C.cpp | #pragma comment(linker,"/stack:200000000")
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define fill0(a) memset(a,0,sizeof(a))
#define fill1(a) memset(a,-1,s... | ALGO | 0.999974 | 4.156448 |
da49130f-48f4-4527-8b40-19a5e98642c1 | sm-amoled/AlgorithmPS | 백준/bj_2343_기타레슨/bj_2343_기타레슨.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> Lesson(N);
int maxLength = 0, sumLength = 0;
for(int i = 0; i < N; i++) {
cin >> Lesson[i];
if(maxLength < Lesson[i]) maxLength = Lesson[i];
... | ALGO | 0.999996 | 4.611284 |
df31db10-a554-4557-865e-666ce2c72acd | md-qubais/Data_Structures_Algorithms_and_Competitive_Programming | median_assign.cpp | #include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)
#define int long long
#define endl "\n"
using namespace std;
int32_t main(){
#ifndef qubais_judge
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
IOS;
int t;
cin>>t;
while(t--){
//max heap
pr... | ALGO | 0.999962 | 3.422794 |
9162ca6c-2592-4009-b64f-f2b73455c2a4 | lixiang2017/leetcode | cpp/0797.0_All_Paths_From_Source_to_Target.cpp | /*
Backtracking
Runtime: 20 ms, faster than 51.98% of C++ online submissions for All Paths From Source to Target.
Memory Usage: 15.6 MB, less than 31.58% of C++ online submissions for All Paths From Source to Target.
*/
class Solution {
public:
vector<vector<int>> paths;
vector<vector<int>> allPathsSource... | ALGO | 0.999923 | 6.242025 |
e83f5aa0-ddb0-4b04-9ae3-598e8387ea39 | deliangyang/Data-Structure | chapter10/10.3/rstrlen.cpp |
#include <iostream>
using namespace std;
int rstrlen(char s[])
{
int len=0;
while(s[len]!='\0')
len++;
return len;
}
int main(int argc, char *argv[])
{
char s[]="hello world";
std::cout<<s<<std::endl;
std::cout<<"length: "<<rstrlen(s)<<std::endl;
std::cout<<"strlen: "<<strlen(s)<<std::endl;
std::system... | TOOL | 0.899892 | 3.292278 |
2b41b9ad-5d56-4e4d-b021-d7684af53c80 | mckianisla/AMAOEd-CompProg1 | Laboratory Exercise 006/for_triangle.cpp | #include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
//////////////////////////////////////////////////////////////////
// NOTE
// This is your program entry point. Your main logic is placed
// inside this function. You may add your functions before this
// "main(... | ALGO | 0.997172 | 4.137537 |
c6c8ec69-6f05-48bc-91fa-24ca592a76f7 | luqiang21/Exercises-CarND | term-2/CarND-MPC-Quizzes-master/polyfit/src/Eigen-3.3/unsupported/test/NumericalDiff.cpp | #include <stdio.h>
#include "main.h"
#include <unsupported/Eigen/NumericalDiff>
// Generic functor
template<typename _Scalar, int NX=Dynamic, int NY=Dynamic>
struct Functor
{
typedef _Scalar Scalar;
enum {
InputsAtCompileTime = NX,
ValuesAtCompileTime = NY
};
typedef Matrix<Scalar,InputsAtCompileT... | TEST | 0.988409 | 6.21049 |
09caefa8-7fbe-4573-9cb2-f9468dabb341 | lsakunes/TSAVRPETS | VRPetsNationals/Library/PackageCache/com.unity.ide.visualstudio@2.0.11/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.960409 | 6.947423 |
cc5bb26a-6716-41d3-b775-74bf5e3af3c0 | heshanchuan/STEB-Planner | code_utils/tier4_autoware_utils/src/geometry/boost_polygon_utils.cpp | #include "tier4_autoware_utils/geometry/boost_polygon_utils.hpp"
#include "tier4_autoware_utils/geometry/geometry.hpp"
#include <tf2/utils.h>
namespace
{
namespace bg = boost::geometry;
using tier4_autoware_utils::Point2d;
using tier4_autoware_utils::Polygon2d;
void appendPointToPolygon(Polygon2d & polygon, const g... | TOOL | 0.983411 | 5.686587 |
e9024068-4a23-413c-8d04-24ec504d043e | whuang369/Competitive-Programming | OJ/Codeforces/1_Templates/DoubleHashStrings.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll MOD[2] = {998244353, 1000000007};
const ll p[2] = {23, 103};
const int N = 1e5 + 5;
ll pw[N][2], inv[N][2], ss[N][2][2];
ll ksm (ll x, ll y, ll m) {
ll ret = 1, now = x;
while (y) {
if (y & 1) {
ret *= now;
... | ALGO | 0.999954 | 5.000904 |
55d0bb2f-29e6-4edc-bf2e-4476d426ad25 | chinmaykhamkar/cc | leetcode/beautiful_no.cpp | class Solution {
public:
bool isHappy(int n) {
set<int> s;
int val,temp;
while(1){
val = 0;
while(n){
temp=n%10;
val = val + temp*temp;
n=n/10;
}
if(val == 1){
return true... | ALGO | 0.999963 | 6.121539 |
90696636-1c33-42aa-bb9f-6781c9414fa7 | dreamstarshine/remote-STL | Algorithm/17_learn_accumulate.cpp | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
//常用算术生成算法accumulate
void test01(){
vector<int>v;
for(int i=0;i<=100;i++){
v.push_back(i);
}
int num=accumulate(v.begin(),v.end(),0);
cout<<"total:"<<num<<endl;
}
int main(){
test01();
return 0;
} | ALGO | 0.998266 | 3.900905 |
992c4e60-2c04-4984-bd24-2c052f275077 | Qernz/FC | Projeto1/g23p1c1.cpp | #include <iostream>
using namespace std;
int main()
{
int n_max = 10; // numero de iteradas
float r = .7, x = .5; // r e o parametro geometrico, x o valor inicial
for(int n =0; n < n_max; n++) // ciclo das iteradas
{
x *= r;
cout << "x(" << n << ")= " << x << endl;
}
return 0... | ALGO | 0.999848 | 3.338093 |
a9a86bcc-3892-44e9-b5bb-ba53ae9478af | FitrahNeonal/Prak-ALPRO | toLower.cpp | #include <iostream>
#include <cctype>
#include <string>
using namespace std;
void yaTidak(bool Y){
if ( Y == 1) {
cout << "Ya";
} else {
cout << "Tidak";
}
}
int main() {
string teks = "C168 Fitrah Neonal";
// Ubah ke huruf kecil
string teksKecil = teks;
for (int i = 0; i < teks.length(); i++)... | ALGO | 0.992547 | 3.716764 |
3698d77e-3eed-494e-84f1-168f8373e75e | MertD014/DeneyapCPP | Hafta 7/hafta7gorev/hafta7gorev3.cpp | /*
06/26/2021 Gorev 3
biggest value in array using a function
*/
#include <bits/stdc++.h>
using namespace std;
void findMax(int *dizi,int lenght){
int mx=INT_MIN;
for(int i=0;i<lenght;i++){
mx=max(mx,dizi[i]);
}
cout<<mx;
}
int dizim[]={1,2,5,3,8,32,7,1};
int main(){
findMax(dizim,8);
return 0;
}
| ALGO | 0.999529 | 4.428595 |
0a0cb337-8926-4b88-be31-b1586e1666d6 | ecnusse/ifse | ifse/klee/lib/Solver/WrapKRPKSolver.cpp | #include "klee/Expr/ExprVisitor.h"
#include "klee/Solver/Solver.h"
#include "klee/Expr/Constraints.h"
#include "klee/Expr/Expr.h"
#include "klee/Solver/IncompleteSolver.h"
#include "klee/Solver/SolverImpl.h"
#include "klee/Solver/SolverStats.h"
#include <memory>
#include <unordered_map>
#include <utility>
using name... | TOOL | 0.934414 | 7.418901 |
c2854d26-9e99-4091-b4d1-c9b85f1d2be5 | SufianTonmoy/C-plus-plus-programming | STL/string/str_pr_1.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
bool isvowel(char c)
{
return (c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='y');
}
int main() {
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input_2.txt", "r", stdin)... | ALGO | 0.999399 | 3.564154 |
508c38d9-4468-42bc-b480-c3223832655f | ngng628/competitive-programming | atcoder/ABC/ABC237/E/main.cpp | # ifndef ONLINE_JUDGE
# include <nglib/atcoder>
# endif
# ifdef ngng628_library
int32 main() {
int n, m;
cin >> n >> m;
vi h(n);
cin >> h;
vvi graph(n);
rep (m) {
int u, v;
cin >> u >> v;
u--, v--;
graph[u].push_back(v);
graph[v].push_back(u);
}
vi dist(len(graph)... | ALGO | 0.999941 | 4.262972 |
c83ca307-5bb8-48be-a5a6-426cef3bfadf | kite707/BOJ | 1463.cpp | #include <iostream>
using namespace std;
int arr[1000001];
int init = 0;
int number(int x) {
if (x == 1) {
return 0;
}
if (arr[x] != 0) {
return arr[x];
}
int res= 1 + number(x - 1);
if (x % 3 == 0) res = min(res, 1 + number(x / 3));
if (x % 2 == 0) res = min(res, 1 + number(x / 2));
arr[x] = res;
retur... | ALGO | 0.999968 | 4.529612 |
6ddc336a-2a16-4c22-9696-0253b2ae224a | atharva1554/Leetcode-question-solution- | Medium/Find Missing And Repeating/find-missing-and-repeating.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
vector<int> findTwoElement(vector<int> arr, int n) {
int a[n+1]={0};
for(int i=0;i<n;i++)
{
a[arr[i]]++;
}
int b=-1,c=-1;
for(int i=0;i<=n;... | ALGO | 0.999793 | 5.564186 |
05503a2d-d58a-477f-96c4-4163556bd476 | libretro/nxengine-libretro | nxengine/sound/org.cpp |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "../nx.h"
#include "../common/basics.h"
#include "org.h"
#include "pxt.h" // for loading drums
#include "sslib.h" // SAMPLE_RATE
#include "org.fdh"
#include "libretro_shared.h"
#define DRUM_PXT
#define drumK 22050
static bo... | TOOL | 0.902667 | 4.534586 |
b10bb433-aaee-4420-b55d-1cfd79e9c473 | Acul4321/competitive-programming-submissions | atcoder/abc390/abc390_b/main.cpp | #include <iostream>
#include <string>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
#include <set>
#include <map>
#include <deque>
#include <stdio.h>
#include <cassert>
#include <climits>
#define ll long long
#define ld long double
#define MOD(x,y) (x%y+y)%y
using namespa... | ALGO | 0.999908 | 3.838854 |
b5be66da-c890-4c25-9115-3430abbab050 | koco0371/Algorithm | 알고리즘/C++/보호필름.cpp | #include <iostream>
using namespace std;
int map[13][20];
int copy_map[13][20];
int total[13];
int medicine[13];
bool visited[13];
int T, D, W, K;
int answer;
bool check_std();
bool insert_medi(int size);
bool DFS(int size);
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> T;
T+... | ALGO | 0.999711 | 3.890543 |
00437811-d5a3-4845-a260-0a540e51c000 | ishandutta2007/codeforces | abdude824/normal/1350/B.cpp | #include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#define fi(n) for(int i=0;i<n;i++)
#define fr(n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vs vector<string>
#define int long long int
#define all(a) (a).begin(),(a).end()
#define pb push_back
#define setbits(x) __builtin_popcountll(x)
#def... | ALGO | 0.999899 | 3.883508 |
b3b3141e-6ac9-4ff5-b453-4decf7d9d82e | MaxwellLeeee/LLM | UnrealEngine-5.1.1-release/Engine/Source/Developer/DerivedDataCache/Private/Http/HttpClient.cpp | #include "HttpClient.h"
#include "Containers/LockFreeList.h"
#include "HAL/Event.h"
#include "Memory/MemoryView.h"
#include "Misc/AsciiSet.h"
#include "ProfilingDebugging/CpuProfilerTrace.h"
#include "String/Find.h"
namespace UE
{
FAnsiStringView LexToString(const EHttpMethod Method)
{
switch (Method)
{
case EHtt... | WEB | 0.89965 | 7.062995 |
6530912c-9d9e-47ad-86bc-2be7317d48cd | Tanguy1213/2D_Platformer_3_1 | externals/Box2D/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp | #include "Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h"
#include "Box2D/Common/b2BlockAllocator.h"
#include "Box2D/Dynamics/b2Fixture.h"
#include <new>
b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)
{
void* mem = allocator->Allocat... | ALGO | 0.982223 | 6.877173 |
65d70209-c3e9-47b8-b17a-902f4a6246ae | Serik-develop/Algoritms-and-Data-Structures | BinarySearch/esep.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
while(n--){
stack<char> st;
string s;
cin>>s;
st.push(s[0]);
if(s.size()==1 || s[0]=='}' || s[0]==')' || s[0]=='}'){
cout<<1<<endl;
break;
}
for(int i=1;i<s.length();++i){
if(st.top()=='(' && s[i]==')' ) st.pop();
e... | ALGO | 0.999802 | 3.991051 |
b1862136-574d-4cdd-906a-258f243d1d59 | sivasweatha/CPP | Turbo CPP/pofp.cpp | #include <iostream>
#include <ctype.h>
#include <stdio.h>
int main()
{
char STR[] = "#E1x2";
for (int b = 0; STR[b] != '\0'; b++)
{
if (!isdigit(STR[b]))
STR[b] = '@';
else if (isupper(STR[b]))
STR[b] = '*';
else
STR[b] = STR[b + 1];
}
put... | ALGO | 0.995958 | 3.167647 |
8b083faa-fcbb-47af-aac5-33af133b91ba | akshatsingh2002/compi | buyAshovel.cpp | #include <iostream>
using namespace std;
void buy()
{
int k, r;
cin >> k >> r;
int i = 1;
for (;;)
{
if ((k * i) % 10 == r)
{
break;
}
else if ((k * i) % 10 == 0)
{
break;
}
i++;
}
cout << i << endl;
}
int main(... | ALGO | 0.998986 | 3.510813 |
fae79d24-9928-400a-95db-921ceeef8b99 | weiweiweidong/My_Competitive_Programming_Codes | 1_AcWing_Algo_Course/2_Advanced_Algorithms/CH1/4_State_Machine_Model/1_ACW_1049.cpp | // Problem: https://www.acwing.com/problem/content/1051/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int N = 1e5 + 10;
int n;
int a[N];
int f[N][2];
void solve() {
int T;
cin >> T;
while (T--) {
cin >> n;
for (int i = 1; i <= n; i+... | ALGO | 0.999894 | 4.682819 |
d913b515-5b87-4bc5-b7b3-f8c1aecfba51 | Saifu0/CP | Practice/mul.cpp | #include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)
#define rep(n) for(int i=n-1;i>=0;i--)
#define ii pair<int,int>
#define m map<int,int>
#define pb push_back
#define ll long long
int main(){
int t;
cin >>t;
while(t--){... | ALGO | 0.999471 | 4.728347 |
6ef916b5-31a1-40b5-a931-204e85ba8a46 | SATTU3108/DSA_Solutions | Dynamic Prgramming/Perfect Sqaure.cpp | int numSquares(int n) {
vector <int> dp(n+1,INT_MAX);
dp[0]=0;
for (int i=1;i<=n;i++) {
for (int j=1;j*j<=i;j++) {
dp[i]=min(dp[i],dp[i-j*j]+1);
}
}
return dp[n];
}
| ALGO | 0.999927 | 4.738342 |
4a110774-b1fc-44ec-b2c2-c9fe2d56ba29 | afxhsjodo/algorithm | 二分图.cpp | #include<iostream>
#include<vector>
#include<map>
#include<math.h>
#include<cmath>
#include<cstring>
#include<iomanip>
#include<queue>
#include<algorithm>
#include<stack>
#include<set>
#include<unordered_map>
#include<unordered_set>
using namespace std;
#define pb push_back
#define x first
#define y second
#define low... | ALGO | 0.999418 | 3.550412 |
179096a4-6862-4659-a892-5f170fd500a2 | L1ANLab/CD-SBN | detection/query_handle.cpp | #include "detection/query_handle.h"
bool HeapEntry::operator < (const HeapEntry &right) const
{
if (this->score == right.score)
{
return this->node->GetLevel() < right.node->GetLevel();
}
return this->score < right.score;
}
bool HeapEntry::operator > (const HeapEntry &right) const
{
if (... | ALGO | 0.989734 | 5.246316 |
f8967a74-11b6-4308-a30f-ceaf15f36075 | masayukisobe/atcoder | abc/349/D/main.cpp | // #define _GLIBCXX_DEBUG
// #pragma GCC optimize("O2,unroll-loops")
#include<bits/stdc++.h>
namespace {
using namespace std;
//#pragma GCC diagnostic ignored "-Wunused-function"
//n#include<atcoder/all>
//#pragma GCC diagnostic warning "-Wunused-function"
//using namespace atcoder;
template<class T> bool chmax... | ALGO | 0.993099 | 3.646256 |
f727047a-6258-4c68-afa1-4716bd03e540 | omp-node/libnode | deps/icu-small/source/i18n/decNumber.cpp | /* ------------------------------------------------------------------ */
/* Decimal Number arithmetic module */
/* ------------------------------------------------------------------ */
/* */
/* This software is made av... | TOOL | 0.883007 | 4.637443 |
45dedd46-14d7-4886-a87b-00395b2bc1cd | 23f2002007/leetcode | basic/sorting/QuickSort/Solution.cpp | #include <iostream>
using namespace std;
const int N = 1e6 + 10;
int n;
int nums[N];
void quick_sort(int nums[], int left, int right) {
if (left >= right) return;
int i = left - 1, j = right + 1;
int x = nums[left + right >> 1];
while (i < j) {
while (nums[++i] < x)
;
whi... | ALGO | 0.999979 | 4.543973 |
f217d434-87a9-4737-951c-cacaed957952 | tinjuiho/EECS587HW4 | main_serial.cpp | #include <iostream>
#include <queue>
#include <ctime>
#include <cstdlib>
#include <stdio.h>
#include <stdlib.h>
#include "g.h"
using namespace std;
class Node
{
public:
double lowerBound;
double upperBound;
Node(double lowerBoundValue, double upperBoundValue)
{
this->... | ALGO | 0.999993 | 4.465326 |
9416eddd-0887-4954-9f5a-6761b2dd0c32 | hnakamur/llvm-toolchain-8-deb | lib/Analysis/DominanceFrontier.cpp | #include "llvm/Analysis/DominanceFrontier.h"
#include "llvm/Analysis/DominanceFrontierImpl.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Pass.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#inc... | TOOL | 0.982536 | 7.734727 |
99e982bc-973e-4244-9d6a-ea02fc3b5084 | tanmayck1201/DSACppSection | Queues/DEQueue.cpp | // DEQueue Queue with all operations having O(1) time!
#include <iostream>
using namespace std;
class Queue
{
private:
int size;
int front;
int rear;
int *Q;
public:
Queue();
~Queue();
void Insert_from_front(int x);
void Insert_from_rear(int x);
int Delete_from_rear();
int Dele... | ALGO | 0.943017 | 5.143749 |
d2ad7cf8-c05e-4f63-8929-49207ab9948c | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10586_15.cpp | #include <bits/stdc++.h>
using namespace std;
class node {
public:
int x;
int y;
bool operator<(const node &b) const {
if (x != b.x) {
return x < b.x;
} else {
return y > b.y;
}
}
};
int main() {
node a[8];
node b[8];
for (int i = 0; i < 4; i++) {
cin >> a[i].x >> a[i].y;
}
... | ALGO | 0.999972 | 3.511312 |
fd75ce9c-21ea-483e-a616-83921c398094 | vlasove/course | YellowBelt/week4/newIter1.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
template <class It>
void PrintRange(It range_begin,
It range_end)
{
for (auto it = range_begin; it != range_end; ++it)
{
cout << *it << ", ";
}
cout<<endl;
}
int main(){
vector<s... | ALGO | 0.968167 | 4.4803 |
bfeac557-1aaa-45e5-909c-dff95cd59b0f | cahidenes/Misket | Çözüm kodları/altgorev4.cpp | #include <bits/stdc++.h>
#define inf 1000000000
using namespace std;
int tl, tr, ml, mr, c;
int main() {
int D;
cin >> D;
while (D--) {
cin >> tl >> tr >> ml >> mr >> c;
vector<int> en_kotu_ihtimaller(mr+2+tr, 0);
en_kotu_ihtimaller[0] = 1;
en_kotu_ihtimaller[tr] = -1;... | ALGO | 0.999922 | 3.390998 |
bedb1fd6-db40-464f-ac6c-9b3399450956 | zenvite2/DSAA_PTIT | SỐ FLOOR(X).cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define faster() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define vt vector <int>
#define vtl vector <ll>
#define vts vector <string>
#define pi pair <int,int>
#define matrix vector <vt>
#define matrixl vector <vtl>
const int MOD... | ALGO | 0.999852 | 4.815029 |
7a8d5661-dea5-4dd7-a90e-1706d6bbab7d | SuperRonan/PBRT-Optimal-MIS | src/shapes/hyperboloid.cpp | // shapes/hyperboloid.cpp*
#include "shapes/hyperboloid.h"
#include "paramset.h"
#include "efloat.h"
#include "stats.h"
namespace pbrt {
// Hyperboloid Method Definitions
Hyperboloid::Hyperboloid(const Transform *o2w, const Transform *w2o, bool ro,
const Point3f &point1, const Point3f &point2... | ALGO | 0.994705 | 7.07188 |
6903df04-9e1b-4055-be0f-0a4575296a3b | YousefMedhat56/ICPC-Assiut-sheets | assiut-0/sheet-8-general-easy/T_Helpful_maths.cpp | #include "iostream"
#include "string"
#include "vector"
#include "algorithm"
using namespace std;
int main()
{
string line;
cin >> line;
vector<int> digits = {};
for (int i = 0; i < line.length(); i++)
{
if (line[i] != '+')
{
int num = line[i] - '0';
digits.... | ALGO | 0.999728 | 4.616914 |
709e8256-4b08-40e4-94e9-e27c03c285cf | minhvpham/Competitive_Programing | codeforces/apio.cpp | #include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
//typedef tree<int,null_type,less<int>,rb_tree_tag,
//tree_order_statistics_node_update> indexed_set;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int,int>
#define ... | ALGO | 0.999613 | 4.021753 |
bd2e2084-1847-410e-856b-6172d926b961 | JoaoVictorFdeBarros/QuizFlutter | 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 |
c72fa82c-9ed6-454e-b7b3-fb091ad22143 | Prakash333singh/https-github.com-Prakash333singh-recursion_dp | Basic/Linked List Insertion/linked-list-insertion.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void printList(Node* node)
{
while (node != NULL) {
cout << node->data <<" ";
node = node->next;
} ... | ALGO | 0.999795 | 6.002234 |
f361fec7-8079-42ac-b034-9ddc7d360b6c | DinuAndreiRazvan/Proiecte_LICEU | Intensiv 2009/V11.5.cpp | #include<iostream>
using namespace std;
int main()
{
int m,n,i,j,minim,maxim=0,a[10][10];
cin>>m>>n;
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
cin>>a[i][j];
}
}
for(i=0;i<m;i++)
{
minim=9999;
for(j=0;j<n;j++)
{
if(a[i][j]<... | ALGO | 0.999828 | 3.372921 |
1a0bbbd0-9192-4907-baaa-980bcbec6752 | Nester778/Distributed-Lab-LR6 | LR_6/lib/cryptopp-master/xtr.cpp | // xtr.cpp - originally written and placed in the public domain by Wei Dai
#include "pch.h"
#include "xtr.h"
#include "nbtheory.h"
#include "integer.h"
#include "algebra.h"
#include "modarith.h"
#include "algebra.cpp"
NAMESPACE_BEGIN(CryptoPP)
const GFP2Element & GFP2Element::Zero()
{
#if defined(CRYPTOPP_CXX11_STA... | ALGO | 0.998938 | 4.511574 |
7f55ae9a-65f3-40f4-8fe3-81ff792be65a | Dzy0726/LeetCode-Practice | Dual Pointer/2379.得到 K 个黑块的最少涂色次数/minimumRecolors.cpp | /***
* @Author: Zhenyu Dong
* @Date: 2024-04-27 19:19:59
* @LastEditors: Zhenyu Dong
* @LastEditTime: 2024-04-27 19:20:07
* @FilePath: \LeetCode-Practice\Dual Pointer\2379.得到 K 个黑块的最少涂色次数\minimumRecolors.cpp
* @Description:
* @
* @Copyright (c) 2024 by Zhenyu Dong, All Rights Reserved.
*/
class Solution {
p... | ALGO | 0.999755 | 6.049534 |
321059bf-a53e-4bee-816e-a513dd8f7e9e | Rajan-226/CP-Stuff | CP/ALGOS/2D_Kadane.cpp | #pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define mod 1000000007
#define pi 3.141592653589
#define nl cout<<"\n"
#define db(x) cout<<x<<" "
#define aaja(x) cout<<"Present "<<x<<"\n"
#define ... | ALGO | 0.999974 | 3.788138 |
b7cb77d2-a347-47f2-acdb-e2918e1ba89b | Yoo0lh/datastrcuture_leetcode_puzzel | leet_code/Guess-Number-Highter-or-Lower.cpp | #include <iostream>
using namespace std;
int guessNumber(int n) {
int left = 1;
int raight = n;
while(left <= raight){
int mid = left + (raight - left) / 2;
int res = guess(mid);
if (res == 0)
return mid;
else if (res > 0)
left = mid + 1;
else... | ALGO | 0.999989 | 4.322383 |
4c5249a0-2c30-4163-8fab-53c7de9dc07a | tridhapuku/DSP_MLIR | libc/src/math/amdgpu/sincosf.cpp | #include "src/math/sincosf.h"
#include "src/__support/common.h"
#include "declarations.h"
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(void, sincosf, (float x, float *sinptr, float *cosptr)) {
*sinptr = __ocml_sincos_f32(x, cosptr);
}
} // namespace LIBC_NAMESPACE
| TOOL | 0.925882 | 7.408187 |
73f0b844-acfa-4c2e-944e-f2b868cf464a | loma373/LeetCode | 1315-sum-of-nodes-with-even-valued-grandparent/1315-sum-of-nodes-with-even-valued-grandparent.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.999894 | 5.535063 |
56743a80-e0f2-4eb1-9bab-a390c6be251f | mohak-borole/GFG-potd | Easy/K distance from root/k-distance-from-root.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
... | ALGO | 0.999784 | 6.160731 |
a328013a-bf6b-4ee0-8275-b0ccc412b395 | zakaria-zoulati/CP-CodeForces | B. Nick and Array/solution.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <utility>
using namespace std;
int main() {
int t = 1 ;
while (t--) {
int n ; cin >> n ;
vector<pair<int,int>> arr(n) ;
int neg = 0 ;
for( int i=0 ; i<n ; ++i ){
int ai ; cin >> ai ;
... | ALGO | 0.999996 | 3.823143 |
13c91ea6-9972-42a4-9ee2-d6e5902ae3ed | objectio/openCV | Connected Component Labeling.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int global_threshold_value = 130;
int threshold_type = 0;
const int max_value = 255;
const int max_binary_value = 255;
Mat src, src_gray, global_dst;
Mat otsu_dst, otsu_blur_dst, labels;
Mat centroids, img_color, stats;
static ... | ALGO | 0.922443 | 4.761737 |
c3ffa732-0eb9-4735-ad00-96bf7040170f | SahilZaware/logic-building-activity | Program189.cpp | #include<iostream>
using namespace std;
class Number
{
public:
int iNo;
Number(int A)
{
iNo = A;
}
void DisplayFactor()
{
int iCnt = 0;
for( iCnt = 1; iCnt <= iNo/2; iCnt++) // Start from 1 to avoid division by zero
{
if(iNo % iCnt... | ALGO | 0.988757 | 5.171537 |
65c07415-940b-4da7-b2d2-a0d22c343302 | sharmakarish/Leetcode-Cpp-solutions | Minimum Multiplications to reach End - GFG/minimum-multiplications-to-reach-end.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int minimumMultiplications(vector<int>& arr, int start, int end) {
int mod=1e5; // Set a modulo value to ensure operations st... | ALGO | 0.99987 | 5.643092 |
c50a9a5f-cd9a-45f7-a7f4-3055bcd4eb02 | ProgramEngineeringKPI/assignment-1-marynych-sitnik | sort.cpp | #include "student.h"
#include "sort.h"
#include "count_scolarship_contenders.h"
void sort(Student*& students, int length)
{
for (int k = 1; k < length; k++){
Student swap = students[k];
int i = k - 1;
for (i;students[i].avarage < students[i + 1].avarage && i >= 0;){
students[i +... | ALGO | 0.982658 | 3.82391 |
b1b4440a-5a0e-4fe8-9500-d7e0a22fe0a7 | zhouyium/myoj | 8965/8965.cpp | //8965: 观展排队
//http://<IP_ADDRESS>/problem.php?id=8965
#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using PLL=pair<LL,LL>;
const LL INF=0x3f3f3f3f3f3f3f3f;
const double EPS=1e-10;
const LL MO=1e9+7;
const int N=5e5+10;
void solve() {
LL n;
cin>>n;
LL ans=0;
stack<LL> stk;//严格单调递减栈
for(LL i... | ALGO | 0.99977 | 4.245055 |
5ce16487-672a-43b8-a7c0-d6a00aeb2b98 | YB970902/CodingTest | 프로그래머스/4/72416. 매출 하락 최소화/매출 하락 최소화.cpp | #include <string>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
vector<int> salesCopy;
vector<vector<int>> dp;
unordered_map<int, vector<int>> tree;
int MAX_VALUE = 1e9;
// 워크샵에 갈 멤버를 찾는다.
int SearchMember(int nodeIdx/*현재 노드의 인덱스*/, bool isCount/*현재 노드가 참석하는지 여부*/)
{
int c... | ALGO | 0.998976 | 5.486156 |
04c93ceb-bc09-4908-a8b2-85cc32cbe3a8 | akrabulislam/UVA | 574.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int>res[110];
int num,n;
int ar[1110];
int j=0;
map<vector<int>,bool>my;
void backtrack(vector<int>v,int sum,int ind){
sum+=ar[ind];
v.push_back(ar[ind]);
if(sum==num){
if(!my[v]){
res[j++]=v;
my[v]=1;
}
}
for(int i=ind+1; i<n... | ALGO | 0.993252 | 3.654542 |
7ba9b643-cc5b-4c63-a8fe-b30d7e9d16ae | shivankar-p/codeforces | 753/A_Linear_Keyboard.cpp | #include<bits/stdc++.h>
using namespace std;
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define int long long
#define mod 1000000007
#define vi vector<int>
#define f first
#define s second
#define pb push_back
int mfun(int i, int m)
{
if(i < 0) retur... | ALGO | 0.999877 | 4.912194 |
744f7a88-4988-4b8a-9683-6b22fcdfd371 | Arkhavy/CodinGame_Fall_Challenge_2024 | .oldFallChallenge/srcs/main.cpp | #include <fallchallenge.hpp>
#include <debug.hpp>
#include <input_handling.hpp>
#include <action.hpp>
#include <fallmath.hpp>
#include <utils.hpp>
/* ************************************************************************** */
/* MAIN FILE */
/* *******... | TOOL | 0.946215 | 3.604942 |
4991e85d-f107-4dea-9e0b-2a80983d1dc9 | starfishda/Algorithm | BOJ/IO/BOJ - 11021 (A+B - 7).cpp | #include <iostream>
using namespace std;
int main() {
int t;
int a, b;
cin >> t;
for (int i = 1; i <= t; i++) {
cin >> a >> b;
cout << "Case #" << i << ": " << a + b << "\n";
}
return 0;
} | ALGO | 0.997743 | 5.939676 |
68e70c31-d63a-4639-8317-062975fa8fbd | uniqss/acwing | 0794/m.cpp | #include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector<int> div(const vector<int>& A, int B, int& r) {
vector<int> ret;
int t = 0;
for (int i = A.size() - 1; i >= 0; --i) {
t *= 10;
t += A[i];
ret.push_back(t / B);
t %= B;
}
r = t;
... | ALGO | 0.999892 | 4.256978 |
523eddaa-7ded-4109-bcab-4a0532ce90b5 | wangxinghu/leetcode_co | leetcode_chenhao/algorithms/validPalindrome/validPalindrome.cpp | // Source : https://oj.leetcode.com/problems/valid-palindrome/
// Author : Hao Chen
// Date : 2014-06-26
/**********************************************************************************
*
* Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
*
* For exa... | ALGO | 0.998776 | 6.2141 |
fc521742-5500-4302-9fb9-91a744af5097 | theeastwindz0/leetcode | 991-broken-calculator/991-broken-calculator.cpp | class Solution {
public:
int brokenCalc(int startValue, int target) {
int ct=0;
while(target>startValue)
{
if(target%2==0) target/=2;
else target++;
ct++;
}
return ct+startValue-target;
}
}; | ALGO | 0.999963 | 5.652394 |
481ac15e-8da5-4ade-8024-0db6392938ce | anugrahaswanda/Lab-AP1-Vector-Anugrah | No3.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void move_zero(vector<int>& arr) {
stable_partition(arr.begin(), arr.end(), [](int x){return x == 0;});
}
int main() {
vector<int> arr = {1, 2, 3, 0, 4, 5, 0, 0};
cout << "Input : ";
for (int i = 0; i < arr.size(); i++) ... | ALGO | 0.999932 | 6.361659 |
6b6df360-b028-4618-b0c9-295c910d3fb3 | himanshugupta09/LEETCODE_SOLUTIONS | TREES/path-sum.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.999954 | 6.08037 |
2c507fdc-55e3-44cd-b1f3-b28d91987f6c | Saarthakkj/DSA | sliding_window/854-making-a-large-island/making-a-large-island.cpp | class DisjointSet{
public:
vector<int> parent;
vector<int> rank ;
vector<int>size;
DisjointSet(int n){
size.resize(n+1);
parent.resize(n+1);
rank.resize(n+1) ;
for(int i = 0; i <= n ; i++){
parent[i]=i ;
size[i] = 1 ;
}
for(i... | ALGO | 0.999942 | 5.70366 |
c7497e14-3d96-43a1-a321-30555752c950 | SudShekhar/Programming | codechef/stack.cpp | #include<iostream>
#include<new>
#define f(i,start,end) for(i=start;i<end;i++)
using namespace std;
struct node{
int data;
node* p;
};
class stack{
private:
node* p;
public:
stack(int i)
{
p=new node;
p->data=i;
};
void push(int i)
{
node *t;
t=new node;
t->data=i;
t->p=p;
p=t;
}... | ALGO | 0.999527 | 3.399904 |
666308af-cbd7-4d54-af33-b2c7140fae97 | tagore15/SDCND_T3_P1_PATH_PLANNING | src/Eigen-3.3/blas/double.cpp | #define SCALAR double
#define SCALAR_SUFFIX d
#define SCALAR_SUFFIX_UP "D"
#define ISCOMPLEX 0
#include "level1_impl.h"
#include "level1_real_impl.h"
#include "level2_impl.h"
#include "level2_real_impl.h"
#include "level3_impl.h"
double BLASFUNC(dsdot)(int* n, float* x, int* incx, float* y, int* incy)
{
... | ALGO | 0.994707 | 5.138801 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.