uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
708eb2be-77a7-4453-94a9-536c56b67583 | ishandutta2007/codeforces | zdolny_kaczor/normal/1360/D.cpp | //Konrad Paluszek,University of Warsaw(former XIV LO Staszic)
//#STAY AT HOME
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#define TIME (chrono::steady_clock::now().time_since_epoch().count())
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define xfm(a,b)a##b
#de... | ALGO | 0.999947 | 4.957761 |
3fe5340a-1c5a-4f20-a4be-78634e93e766 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_5126_2.cpp | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int N = 2e7 + 9, M = 1e7, OO = 0x3f3f3f3f;
int main() {
int t;
scanf("%d", &t);
while (t--) {
int n, array[101], freq[101], i, diffrents[101], k = 0, x;
scanf("%d %d", &n, &x);
for (i = 0; i < n; ++i) {
scanf("%d"... | ALGO | 0.999957 | 3.939711 |
7a0e4c78-702e-45af-87c3-5f2d2cccfdb1 | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J00054/explore/explore.cpp | #include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 1005;
int T, n, m, k, ans, x, y, d, nx, ny;
string s;
bool land[MAXN][MAXN];
bool vis[MAXN][MAXN];
char ch;
int main(){
freopen("explore.in", "r", stdin);
freopen("explore.out", "w", stdout);
ios::sync_with_stdio(0);
cin >> T;
while(... | ALGO | 0.999751 | 4.184602 |
3cf93877-f103-4dbc-b1c4-fbac98ef9e9d | sgpk0717/2020_AlgorithmStudy_PNU | 그래프이론/11404.cpp | /* 11404 ÷̵
2024KB 92ms C++14
÷̵ ͼ ˰
*/
#include <iostream>
#include <algorithm>
using namespace std;
int n,m;
int Answer[101][101];
int INF = 1<<20;
int main(void){
int f,t,c;
cin >> n >> m;
for(size_t i=1; i<=n; i++){
for(size_t j=1; j<=n; j++){
if(i==j) Answer[i][j] = 0;
else Answer[i][j] = INF... | ALGO | 0.999933 | 3.534366 |
0a9b2bdb-8c3b-4b27-b270-661e54d043f7 | Jawad-Akbar/leetcode | binary search/make_mountain_array.cpp | class Solution {
public:
int dp[1005];
int minimumMountainRemovals(vector<int>& nums) {
int n=nums.size();
int l=n;
for (int j=1;j<n-1;j++){
for (int i=1;i<=n;i++)
dp[i]=2e9;
int mxl=0;
for (int i=0;i<=j;i++){
int k=uppe... | ALGO | 0.999982 | 5.793307 |
8b0bd169-052e-403e-9a94-f3fd133abbde | out0/selfdrive | libfastrrt/src/python_bind.cpp | #include "../include/fastrrt.h"
#include <driveless/search_frame.h>
extern "C"
{
void *fastrrt_initialize(
int width,
int height,
float perceptionWidthSize_m,
float perceptionHeightSize_m,
float maxSteeringAngle_deg,
float vehicleLength,
int timeout_ms,
... | ALGO | 0.983102 | 4.077439 |
d302acad-1856-4d46-9671-bc16de1b5e27 | 777wendy777/lab-oop | 1.2/lab1.2.cpp | #include "pch.h"
#include "windows.h"
#include <iostream>
#include <vector>
#include <fstream>
#include "Complex.h"
using namespace std;
const Complex readNumber(ifstream&); // Считывает одно комплексное число из файла
int main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
system("color 0A");
ifstream f("... | ALGO | 0.95274 | 3.668339 |
5fafddc7-0b62-4f15-b151-06b5df49ce7e | sh940701/cpp | 객체지향과STL/클래스/class-memberFuncPointer/class-memberFuncPointer.cpp | #include <iostream>
#include <functional>
using namespace std;
// class Person {
// public:
// void print(int i) {
// cout << i << endl;
// }
// };
// int main() {
// // 위 Person class의 멤버함수를 가리키는 포인터를 만들어보자
// // 형식 : return type, (class name::, *, 변수명), (parameter) = &, class name::, 함수명
//... | TOOL | 0.965016 | 5.025832 |
2d91b852-016b-453b-ad7b-6943b289a32c | MathProgrammer/CodeForces | 2020/Div 2/678 Div 2/Programs/Sum Over Subsets.cpp | #include <iostream>
#include <vector>
#include <map>
using namespace std;
const int MAX_N = 1e5 + 5, MOD = 998244353;
vector <int> mu(MAX_N, 1);
vector <int> A(MAX_N);
map <int, long long> frequency;
long long square(long long n)
{
return (n*n)%MOD;
}
long long power_mod(long long x, long long power)
{
long... | ALGO | 0.999694 | 5.206962 |
50207de9-ae98-452b-ac5e-9fa70da91b19 | guilhermeleobas/maratona | SPOJ/tree.cpp | #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
using namespace std;
// typedef pair<int, int> no;
typedef vector<vector<int> > graph;
void imprime (graph g){
for (int ... | ALGO | 0.999968 | 4.459121 |
d872560f-0e79-4f75-bd3c-f40fc96dafa2 | vestronv/Interview-Preparation | Linked List All/Singly Linked List/mergeSLL.cpp | /**
Description : Merge two linked list alternatively selecting nodes from both.
**/
#include <bits/stdc++.h>
using namespace std;
struct node{
int data;
node *next;
};
node *makenode(int data){
node *temp = new node();
temp->data = data;
temp->next = NULL;
return temp;
}
void die(node *root){
if(root==NU... | ALGO | 0.999921 | 4.538225 |
66e23958-d07a-48ac-b87a-47497b9a4d39 | thiago-sydow/AndroidRobotCamera | jni/cv/src/cvdistransform.cpp | #include "_cv.h"
#define ICV_DIST_SHIFT 16
#define ICV_INIT_DIST0 (INT_MAX >> 2)
static CvStatus
icvInitTopBottom( int* temp, int tempstep, CvSize size, int border )
{
int i, j;
for( i = 0; i < border; i++ )
{
int* ttop = (int*)(temp + i*tempstep);
int* tbottom = (int*)(temp + (size.heig... | ALGO | 0.998974 | 3.886395 |
db302324-a2df-4847-b50a-4b38e8bbd247 | Avnish1519/Cpp_Programming | Arrays/Even_Digits_Numbers.cpp | //class solution is created
class Solution {
public:
int findNumbers(vector<int>& nums) {
int ans = 0;
for(int val : nums) {
string s = to_string(val);
if(!(s.length() & 1))
ans++;
}
return ans;
}
... | ALGO | 0.999673 | 5.408067 |
c187c0f3-d21c-417c-97a9-d0b6ccde4d37 | nowek7/competitive-programming-solutions | LeetCode/easy/867_transpose_matrix.cpp | #include <cassert>
#include <vector>
std::vector<std::vector<int>> transpose(std::vector<std::vector<int>>& matrix)
{
std::vector<std::vector<int>> transposed(matrix.front().size(), std::vector<int>(matrix.size(), 0));
for (int i = 0; i < matrix.size(); ++i) {
auto& row = matrix[i];
for (int j = 0; j < row... | ALGO | 0.999901 | 6.850499 |
530573c6-b342-4d2d-8bb9-511c21064e90 | osmansajid/Contest-Problems | LightOJ/1122/14221228_AC_20ms_1688kB.cpp | #include<bits/stdc++.h>
using namespace std;
int n,m,a[11],dp[11][11];
int call(int indx,int cur)
{
if(indx>=m){
return 1;
}
if(dp[indx][cur]!=-1) return dp[indx][cur];
int res=0;
for(int i=0;i<n;i++){
if(abs(cur-a[i])<=2){
//cout<<cur<<a[i]<<endl;
res+=call(... | ALGO | 0.999961 | 4.163603 |
4abd5fcc-6fdc-4fc5-a1f5-497175663d64 | Sarthak-IET2019/DailyDsa | LeetcodeDaily/daily103.cpp | class Solution {
public:
long long zeroFilledSubarray(vector<int>& nums) {
// so let's say a continous length of 0's is 5 then total number of subarrys possible is 15! how? for n it's n*(n+1)/2;
int j;
long long ans=0;
for(int i=0;i<nums.size();i++){
if(nums[i]==0) {
... | ALGO | 0.99999 | 6.061903 |
b0229723-c15f-45a9-88ca-85e925ec47fb | bthneee/CS150-Practice-PE-Problems | PE03/14 - stringSplosion.cpp | #include <iostream>
#include <string>
using namespace std;
string stringSplosion(const string& str)
{
string result = "";
size_t len = str.size();
for(int i = 0; i < len + 1; i++)
{
result += str.substr(0, i);
}
return result;
}
int main()
{
cout << stringSplosion("Code")... | ALGO | 0.999676 | 5.701063 |
31f55101-21ad-46ab-b3ee-4f9236212c13 | hamidallaei/SPP | serial/main.cpp | #include "../shared/parameters.h"
#include "../shared/c2dvector.h"
#include "../shared/particle.h"
#include "../shared/cell.h"
#include "../shared/set-up.h"
#include "box.h"
inline void timing_information(clock_t start_time, int i_step, int total_step)
{
clock_t current_time = clock();
int lapsed_time = (current_t... | ALGO | 0.997255 | 3.604171 |
203e2f0b-fe41-4d40-8953-743c3b718020 | Shreya241/Cpp-problems | Backtracking/soduko solver.cpp | #include <bits/stdc++.h>
using namespace std;
#define UNASSIGNED 0
#define N 9
class Solution
{
public:
bool solve(int grid[N][N])
{
for(int i=0;i<9;i++)
{
for(int j=0;j<9;j++)
{
if(grid[i][j]==0)
{
for(int ... | ALGO | 0.999229 | 6.33309 |
bca17cf5-e6bb-4508-bb64-498dd2c36c14 | Ashvani-2000/C-file | Q9.cpp | // nested loop
#include <iostream>
using namespace std;
int main()
{
for (int i = 1; i <= 5; i++)
{
for (int j = 1; j <= 5; j++)
{
cout << "(" << i << "," << j << ")";
}
cout << endl;
}
return 0;
} | TOOL | 0.895153 | 3.648003 |
7f6fad6f-46e2-4fc6-9169-af0aba4ce812 | versatran01/fruit_detection | mex/fastig.cpp | extern "C" {
#include "mex.h"
#include "stdint.h"
#include "string.h"
}
#include <vector>
#include <cmath>
/**
* @brief IG = fastig(X,Y,colidx,labels) calculates the information gain of X and Y
* @param X Matrix (of logicals) where rows are observations, columns are features (M x N)
* @param Y Rows ... | ALGO | 0.964403 | 6.297172 |
2735a92f-3734-449b-9129-7b88fcacf1f6 | AvishekChandraDas/Codeforces-Solutions | 1030A - In Search of an Easy Problem/1030A.cpp | //AvisCodeX
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a, i, b, sum = 0;
cin >> a;
if(a >= 1 && a <= 100)
{
for( i = 1 ; i <= a ; i++ )
{
cin >> b;
sum += b;
}
if( sum == 0 )
{
cout << "EASY" << endl;
... | ALGO | 0.997846 | 3.34845 |
339ab572-5a05-49ea-a33f-b5ab45eb8c64 | pullasunil/elements-of-programming-interviews | AddingCredits.cpp | #include <cassert>
#include <map>
#include <string>
#include <unordered_set>
#include <unordered_map>
using std::map;
using std::string;
using std::unordered_map;
using std::unordered_set;
// @include
class ClientsCreditsInfo {
public:
bool insert(const string& s, int c) {
if (credits_.emplace(s, c - offset_).... | TOOL | 0.937955 | 6.463507 |
9d4f610d-d19b-4950-871a-976f3935e566 | akshaykumar89/Codeforces-Contests | C_1_Good_Subarrays_Easy_Version.cpp | #include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define inf 1e18
#define ninf 1e18*(-1)
#define ff first
#define ss second
#define pb push_back
#define ppb pop_back()
#define vi vector<int>
#define mp make_pair
#define pii pair<int,int>
#define mii map<int,int>
#define pqb priority_queue<int>
#de... | ALGO | 0.999797 | 4.2062 |
9c74c572-bcbb-46cd-bac9-9942150d586f | DrkWiz/AnalisisNumerico | ajust curv/trazadoracubica/eigenn/eigen-3.4.0/bench/sparse_lu.cpp |
// g++ -I.. sparse_lu.cpp -O3 -g0 -I /usr/include/superlu/ -lsuperlu -lgfortran -DSIZE=1000 -DDENSITY=.05 && ./a.out
#define EIGEN_SUPERLU_SUPPORT
#define EIGEN_UMFPACK_SUPPORT
#include <Eigen/Sparse>
#define NOGMM
#define NOMTL
#ifndef SIZE
#define SIZE 10
#endif
#ifndef DENSITY
#define DENSITY 0.01
#endif
#ifnd... | ALGO | 0.992375 | 4.187482 |
97a1bf24-c4d7-4e85-bfa5-4de7d1bae163 | shantorohmat/Md.-Rohmat-Ulla | ALL File/teach Yourself C++/4th Lesson/4.1 Arrays of objects/Arrays of objects 04.cpp | #include <bits/stdc++.h>
using namespace std;
class shanto
{
int a,b;
public:
shanto(int a,int b) { this -> a = a; this -> b = b; }
int get_a() { return a;}
int get_b() { return b;}
};
int main()
{
shanto ob[4][2] = {shanto(78,85),shanto(97,52),shanto(89,87),shanto(45,65),
... | ALGO | 0.988754 | 3.157506 |
c1fc40e7-42c4-4391-90a3-186444cba57e | AndhikaBagusWA/andhika2100018232-prac-alpro | Pertemuan 1/Postest/Postest1.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main(){
int x1, x2, y1, y2; // input
int px, py; // output
float jarak; // output
cout << "Program mencari jarak antara 2 titik \n";
cout << "========================================\n";
cout << "Input titik A1 : "; cin >> x1;
c... | ALGO | 0.998902 | 4.336199 |
4d6b90c8-1ba7-4ab5-81a0-a00518af25a9 | RaviDeepu/atomicCPP | random/stringMatching.cpp | #include<iostream>
#include<string.h>
// In a string replace all occurrence of the given pattern to 'X'
using namespace std;
bool Matched(char *str, char *pat)
{
int i=0;
cout<<str<<endl;
while(pat[i] != '\0')
{
if(pat[i] != str[i])
return false;
else
i++;
}
return true;
}
char * replace(char *str, ... | ALGO | 0.999545 | 3.951877 |
60f5b7b7-932f-4c4b-8837-0dc181e4e40e | RMB1803/DSA | 06_Hashing/hashing_2.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int hash[256] = {0};
for(int i = 0; i < s.size(); i++) {
hash[s[i]]++;
}
int query;
cin >> query;
while(query--) {
char c;
cin >> c;
//FETCHING
cout << "Number of ti... | ALGO | 0.999826 | 4.551509 |
c6078029-73e1-40c7-8ced-5d7500872a79 | mursalin117/Compiler-Design-Lab | c++/new/One_d.cpp | #include <bits/stdc++.h>
using namespace std;
int isVowel (char ch) {
if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'))
{
if (ch == 'A' || ch == 'a' || ch == 'E' || ch == 'e' || ch == 'I' || ch == 'i' || ch == 'O' || ch == 'o' || ch == 'U' || ch == 'u')
{
return 1;
... | ALGO | 0.999888 | 4.906326 |
2c3fbf13-3d8a-4288-9efb-eba9d63fe18c | ishandutta2007/codeforces | shadowatyy/normal/1097/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define PII pair<int, int>
#define VI vector<int>
#define VPII vector<PII>
#define LL long long
#define LD long double
#define f first
#define s second
#define MP make_pair
#define PB push_back
#define endl '\n'
#define ALL(c) (c).begin(), (c).end()
#define SIZ(c) (int)(c)... | ALGO | 0.999932 | 3.754857 |
a971c3eb-86b7-43e8-9a84-461a2878c408 | ashokabairwaideology/Leet-code-problem | solution/1600-1699/1641.Count Sorted Vowel Strings/Solution2.cpp | class Solution {
public:
int countVowelStrings(int n) {
int f[5] = {1, 1, 1, 1, 1};
for (int i = 0; i < n - 1; ++i) {
int s = 0;
for (int j = 0; j < 5; ++j) {
s += f[j];
f[j] = s;
}
}
return accumulate(f, f + 5, 0);
... | ALGO | 0.999888 | 6.733495 |
36e3ecd2-04be-417b-a143-f548cb4e6ca8 | ankitraj03/leetcode | 0162-find-peak-element/0162-find-peak-element.cpp | class Solution {
public:
int findPeakElement(vector<int>& nums) {
return recurse(nums,0, nums.size()-1);
}
int recurse(vector<int> &nums, int low, int high){
if(low==high){
return low;
}
int mid=(low+high)/2;
if(nums[mid]>nums[mid+1]){
return r... | ALGO | 0.999951 | 5.690334 |
5c536b93-6a8b-443d-b309-78c50024f517 | stance-project/snxt-core | src/chain.cpp | #include "chain.h"
using namespace std;
/**
* CChain implementation
*/
void CChain::SetTip(CBlockIndex* pindex)
{
if (pindex == NULL) {
vChain.clear();
return;
}
vChain.resize(pindex->nHeight + 1);
while (pindex && vChain[pindex->nHeight] != pindex) {
vChain[pindex->nHeight] ... | ALGO | 0.997434 | 5.527294 |
a61581a4-ce82-4a23-b23a-cfa20b431e96 | shubham10divakar/Path-Planning-Udacity-Projrct-Highway-Driving- | src/Eigen-3.3/failtest/qr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
HouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.887556 | 3.076401 |
9ac530f0-6d4a-4856-b2ae-fe3896cefc9c | YuKiJuDai1006/leetcode | 621.cpp | class Solution {
public:
int leastInterval(vector<char>& tasks, int n) {
int sum = tasks.size();
unordered_map<char, int> tab;
for(char& ch : tasks) ++tab[ch];
int h = 0;
for(auto& it : tab){
if(it.second > h) h = it.second;
}
int w = 0;
fo... | ALGO | 0.999987 | 6.60803 |
b126ebc9-c519-4c5b-a2b5-db3164813a49 | ishandutta2007/codeforces | huangxiaohua/normal/1096/E.cpp | #include <stdio.h>
typedef long long ll;
#define M 998244353
int i,j,k,n,m,sb;
ll res,inv[10050],jc[10050],tmp;
ll ksm(ll a,int p){ll res=1;while(p){if(p&1){res=res*a%M;}a=a*a%M;p>>=1;}return res;}
ll c(int n,int m){
if(n==-1&&m==-1){return 1;}
if(n<0||m<0||n<m){return 0;}return jc[n]*inv[m]%M*inv[n-m]%M;
}
int main(... | ALGO | 0.999954 | 4.327882 |
964d2ec4-2e8b-44ea-9e01-a6c9154f5cf8 | itlezy/eMule-mods-archive | eMule-0.50a-XCA_1.3-src_VS2010-16.12.11/crypto/iterhash.cpp | // iterhash.cpp - written and placed in the public domain by Wei Dai
#ifndef __GNUC__
#define CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES
#endif
#include "iterhash.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
template <class T, class BASE> void IteratedHashBase<T, BASE>::Update(const byte *input, size_t len)
{
HashW... | ALGO | 0.995837 | 6.892172 |
bd95bef9-a88e-4ed2-b85f-66763af695a4 | ishandutta2007/codeforces | ugly2333/normal/38/H.cpp | //CF 38H
#include<iostream>
#include<cstdio>
#include<fstream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<cstring>
#include<cstdlib>
using namespace std;
typedef long long LL;
typedef double DB;
const int N = 55;
const int inf = 1e9;
int n,m,g1,g2,s1,s2;
in... | ALGO | 0.999708 | 3.697349 |
a767a3a9-46ff-4cbf-a152-6b1db569b036 | Theunis-Kok/Oeber | 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 |
98ced635-9c0f-4257-b622-83b861ca5f45 | KAWtech/Oneshot | OpenSplat/rasterizer/gsplat-cpu/gsplat_cpu.cpp | #include "bindings.h"
#include "../gsplat/config.h"
#include <cstdio>
#include <iostream>
#include <cmath>
#include <tuple>
using namespace torch::indexing;
torch::Tensor quatToRot(const torch::Tensor &quat){
auto u = torch::unbind(torch::nn::functional::normalize(quat, torch::nn::functional::NormalizeFuncOption... | ALGO | 0.998206 | 4.389931 |
1ff3f56b-2f63-4696-a597-5400202f0173 | andrerodrig/algorithms-cpp | tests/test.cpp | #include <vector>
#include <string>
#include <random>
#include <iostream>
#include <cassert>
#include <dummy_class.hpp>
#include <compare_helper.hpp>
#include <memory_cell.hpp>
#include <algorithm>
#include <square.hpp>
#include <tree.hpp>
void test_find_max()
{
std::vector<int> v1;
std::vector<double> v2;
... | TEST | 0.918868 | 5.125277 |
3c864a45-e357-4cf8-a8c0-120bed3f1f54 | N1kZet/algorithms-and-data-structure | Pr16/The_Dynamic_Method.cpp | #include <iostream>
using namespace std;
struct Node{
int data;
Node *next;
};
struct Queue{
int size;
Node *first;
Node *last;
};
void Creation(Queue *Q){
Q->first = new Node;
Q->first->next = NULL;
Q->last = Q->first;
Q->size = 0;
}
bool Full(Queue *Q){
if (Q->first == Q->last... | ALGO | 0.990285 | 4.105741 |
3b04e45e-9b35-483a-aef2-dd4704fc3c12 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/abc106/B/4441327.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
int main(){
int N;
cin >> N;
int ans;
if(105 > N){
ans = 0;
}
else if(135 > N){
ans = 1;
}
else if(165 > N){
ans = 2;
}
else if (189 > N){
... | ALGO | 0.999796 | 3.398249 |
a7852795-3037-49ba-8b9e-09aa22af1950 | omjcnkn/elevator-simulator | CSE127_ElevatorProject/main.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
class node {
private:
node* prev;
node* next;
int current;
int target;
public:
node() : prev(NULL), next(NULL), current(0), target(0) {}
void setTarget(int t) {
this->target = t;
}
int getTarget() {
return this->target;
}
void setCurrent(int... | ALGO | 0.988252 | 4.035183 |
061bb263-4dac-48bc-8e62-77ff005c353b | dhanashreeg368/DSA-Practice-Questions | 0647-palindromic-substrings/0647-palindromic-substrings.cpp | class Solution {
public:
int countPalindromesAroundCenter(string &s, int l, int r) {
int count = 0;
while (l >= 0 && r < s.length() && s[l] == s[r]) {
count++;
l--;
r++;
}
return count;
}
int countSubstrings(string s) {
int res... | ALGO | 0.999963 | 6.341077 |
d74d4027-a342-4da1-8004-387fe4b371ad | GCMango/ps-codes | BOJ/13006.cpp | #include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MXN = 15, MXC = 50;
int N, C, arr[MXN], cost[MXC], ... | ALGO | 0.999996 | 3.982159 |
0b2f9994-bc6d-46db-8c29-f7f04e824fe3 | basta/vrgineers | lib/CImg/examples/wavelet_atrous.cpp | #include "CImg.h"
using namespace cimg_library;
#ifndef cimg_imagepath
#define cimg_imagepath "img/"
#endif
// Define convolution mask.
CImg<float> mask(const unsigned char dirIdx, const unsigned char scale) {
const int
d1 = 1 << (scale-1),
d2 = 1 << scale,
c = d2,
vecLen = (1 << (scale + 1)) + 1;
... | ALGO | 0.998808 | 5.091944 |
f7167570-8618-479e-b46d-7dce351297ee | TosakaUCW/CompetitiveProgramming | 蓝桥杯/2025 省赛/F - 水质检测.cpp | #include <bits/stdc++.h>
using i64 = long long;
#define int i64
#define pb push_back
#define ep emplace
#define eb emplace_back
using namespace std;
template <class T1, class T2> ostream &operator<<(ostream &os, const std::pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ... | ALGO | 0.999963 | 4.352612 |
0661ae40-e1b9-44ea-ba7a-d454fe8393d6 | Yasirraiyan/Leet-Code-SolvIing-Problem | Leetcode 303 Range Sum Query/Question.cpp | Given an integer array nums, handle multiple queries of the following type:
Calculate the sum of the elements of nums between indices left and right inclusive where left <= right.
Implement the NumArray class:
NumArray(int[] nums) Initializes the object with the integer array nums.
int sumRange(int left, int right) R... | ALGO | 0.998607 | 6.716117 |
758e8d2b-4f81-43d4-88c3-8d117f82e392 | mohit1721/Leetcode | 0040-combination-sum-ii/0040-combination-sum-ii.cpp | class Solution {
public:
int n;
vector<vector<int>>result;
void solve(int idx,vector<int>& candidates,int target, vector<int>& temp )
{
if(target==0)
{
result.push_back(temp);
return;
}
for(int i=idx;i<n;i++)
{
if (candidates[i] > target) break; //
//check duplicates
if(i>idx && candidat... | ALGO | 0.999988 | 6.120491 |
8920d5f7-e811-4a5e-830e-ea6a89fe7dea | tioace/atividade-c | codigos/AULA/PROVA/NICK-VICTOR-Q4.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
void cabecalho(){
printf("\tINSTITUTO FEDERAL DA BAHIA - CAMPUS BARREIRAS\n");
printf("\tData: 16/05/2023\n");
printf("\tProfessor: Djalma Filho. Turma: 732.\n");
printf("\tDupla: Nicholas Rafael e Victor Galvao\n\n");
}
float credito(){
flo... | TOOL | 0.978947 | 3.81891 |
1e69d1cd-eaac-4e2d-be16-5d0e21703a5e | RyanPaulMcKenna/algorithms_and_data_structures_and_design_patterns | algos_and_ds/DataStructures/Stack.cpp | #include <iostream>
const int MAXSIZE(7);
// Each of the three stack operations take linear time O(1).
class Stack {
private:
int top;
int MAX;
int* S;
public:
Stack()
{
top = 0;
MAX = MAXSIZE;
S = new int[MAX];
}
int ... | ALGO | 0.975248 | 4.733216 |
e7bc3c60-ea47-44eb-8a97-a0c721dd58f8 | guomhua/uva | 299.cpp | /*--------------------
UVa 299 - Train Swapping
mguo.ca
--------------------*/
#include <iostream>
#include <vector>
using namespace std;
void swap (int* a, int* b, int &ops) {
int temp = *a;
*a = *b;
*b = temp;
ops++;
}
int main () {
int n, l, c, ops;
bool sorted = false;
cin >> n;
for (int i = 0; i < n;... | ALGO | 0.999896 | 3.874499 |
b36ef01b-938e-4ca6-ba56-fca8e6413c94 | clongbupt/algorithm_cookbook | ACM/starter/poj2255.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
#define MAX 27
//n为树的长度,s1是先序遍历,s2是中序遍历
void build(int n, char *s1, char *s2, char *s)
{
if (n <= 0) return;
int p = strchr(s2, s1[0]) - s2; //找到根节点在中序遍历中的位置
//printf("n:%d p:%d\n", n, p);
build(p, s1 + 1, s2, s); //递归构造左子树的后续... | ALGO | 0.999993 | 3.319542 |
f4c68065-dcf1-47c5-90a8-07cdc7e758b9 | lijiancheng0614/poj_solutions | Volume1/1120/1120.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
#define N 20
#define M 16
typedef vector<int> vi;
typedef vector<vi> vvi;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
const string OUTPUT = ".!X#";
class Solution
{
public:
void solve(vector<string> & outputs, int day, ... | ALGO | 0.999892 | 4.032848 |
36a773ab-c851-454a-a4a9-b76fa38375a5 | mvancompernolle/ai_project | data/gim_trimesh_ray_collision.cpp | #include "GIMPACT/gim_trimesh.h"
//! Trimesh Ray Collisions
/*!
\param trimesh
\param contact
\return 1 if the ray collides, else 0
*/
int gim_trimesh_ray_collision(GIM_TRIMESH * trimesh,vec3f origin,vec3f dir, GREAL tmax, GIM_TRIANGLE_RAY_CONTACT_DATA * contact)
{
GDYNAMIC_ARRAY collision_result;
GIM_CREATE_BOX... | ALGO | 0.998966 | 5.122838 |
0c861e5b-3166-43e2-9aaa-5cf0d3f07b2b | amchp/CompetitivePrograming | Practice/DrawingBook.cpp | #include <iostream>
using namespace std;
int main(){
int n, p, pages, page, middle;
cin >> n >> p;
pages = n / 2 + 1;
page = p / 2 + 1;
middle = pages /2;
if(page <= middle) cout << (page - 1) << endl;
else cout << pages - page << endl;
} | ALGO | 0.99989 | 3.1854 |
0a4476be-c6b6-45b1-9c74-de25e77e89e1 | Faiaz98/LeetCodeSolves | multiply_strings.cpp | class Solution {
public:
string multiply(string num1, string num2) {
int m = num1.size();
int n = num2.size();
vector<int> result(m + n, 0);
for (int i = m - 1; i >= 0; i--) {
for (int j = n - 1; j >= 0; j--) {
int product = (num1[i] - '0') * (num2[j] - '... | ALGO | 0.999987 | 6.475429 |
a461aa32-766a-4a4d-8c2a-7984a57c0782 | darshancool25/Leetcode | C++/Range Sum Query - Immutable.cpp | // https://leetcode.com/problems/range-sum-query-immutable/
/*Dynamic Programming, Prefix Sum*/
class NumArray {
public:
vector <int> dp;
NumArray(vector<int>& nums) {
if (nums.size() == 0)return;
dp = vector<int>(nums.size());
dp[0] = nums[0];
for (int i = 1; i < nums.size(); i... | ALGO | 0.999843 | 7.285426 |
d997159b-86f8-40af-b75e-ff284bffe209 | pacha2880/competitive_programming_codes | E. Assiut Chess.cpp | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/rope>
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)a.size()
#define eq(a, b) (fabs(a - b) < EPS)
#define md(a, b) ((a) % b +... | ALGO | 0.998586 | 4.538519 |
83ad362c-f31c-456f-80e8-dda9c3c3f161 | MoniqueeSilva/SistemasOperecionais | threads/threads.cpp | #include <iostream>
#include <thread> // manipulação de threads
#include <mutex> // controle de mutex
using namespace std;
// mutex para sincronização entre threads
mutex mtx;
// Função para a primeira thread
void thread1(int &var1) {
for (int i = 0; i < 5; i++) {
lock_guard<mutex> lock(mtx); // ... | ALGO | 0.982688 | 5.872085 |
bbfcd1d8-4935-4ca4-a272-aea9019e8e52 | 7princekumar/competitive_coding | uva/12157.cpp | /*
Id : 12157
Name : Tariff Plan
Section: Easy - CP3
Link : https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=608&page=show_problem&problem=3309
*/
#include <iostream>
#include <cstring>
#include <cstdbool>
#include <cmath>
#include <utility>
#include <vector>
#include <queue>
#include ... | ALGO | 0.999434 | 3.715713 |
2f489e7c-f846-4d05-9714-cef1b41d122c | Ashishmangal06/FaceMaskDatasetMLAIProject | opencv-master/opencv-master/modules/objdetect/src/qrcode.cpp | #include "precomp.hpp"
#include "opencv2/objdetect.hpp"
#include "opencv2/calib3d.hpp"
#ifdef HAVE_QUIRC
#include "quirc.h"
#endif
#include <limits>
#include <cmath>
#include <iostream>
#include <queue>
#include <limits>
#include <map>
namespace cv
{
using std::vector;
static bool checkQRInputImage(InputArray img, ... | ALGO | 0.999572 | 3.794562 |
b9285e1f-cf49-4085-86bc-f273f4aed018 | Krythz43/CP-Archieve | codeforces/1131b.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define rep(i,n,z) for(int i=z;i<n;i++)
#define rrep(i,z) for(int i=z;i>=0;i--)
#define lli long long int
#define nl cout<<endl
#define vi vector<int>
#define vlli vector<long long int>
#define umap u... | ALGO | 0.999863 | 4.066726 |
93f2caf4-40f6-4041-a3bf-bb3e9f50c18c | HAR0070/PX4-Autopilot | src/lib/geo/geo.cpp | /**
* @file geo.cpp
*
* Geo / math functions to perform geodesic calculations
*
* @author Thomas Gubler <<EMAIL>>
* @author Julian Oes <<EMAIL>>
* @author Lorenz Meier <<EMAIL>>
* @author Anton Babushkin <<EMAIL>>
*/
#include "geo.h"
#include <float.h>
using matrix::wrap_pi;
using matrix::wrap_2pi;
/*
* A... | ALGO | 0.995985 | 4.493402 |
79e7e34d-a992-4eb6-bb17-ca98be682d79 | LEZEgit/-OS-Project---SerenityOS | Userland/Libraries/LibCrypto/BigInt/Algorithms/Multiplication.cpp | #include "UnsignedBigIntegerAlgorithms.h"
namespace Crypto {
/**
* Complexity: O(N^2) where N is the number of words in the larger number
* Multiplication method:
* An integer is equal to the sum of the powers of two
* according to the indices of its 'on' bits.
* So to multiple x*y, we go over each '1' bit in x ... | ALGO | 0.999857 | 5.484631 |
ca7ea569-e110-4fee-9534-21f10b2118e8 | AbdulrahmanJ204/cp | D_Vlad_and_Division.cpp | #include <bits/stdc++.h>
using namespace std;
#define test \
int t; \
cin >> t; \
while (t--)
#define ll long long
#define endl '\n'
#define cendl cout << endl
#define cyes cout << "YES" << endl
#define cno cout << "NO" << endl
#define InTheNameOfAllah \
ios_base::sync_with_stdio(0); \
... | ALGO | 0.999752 | 4.539945 |
6888b18e-6802-4fa5-96cc-a71b6ab1959d | lhdgriver/leetcode | easy/binary_tree_level_order_traversal_102.cpp | class Solution {
public:
vector<vector<int>> levelOrder(TreeNode* root) {
vector<vector<int>> ret;
if (root == NULL) return ret;
vector<vector<int>> left_result = levelOrder(root->left);
vector<vector<int>> right_result = levelOrder(root->right);
vector<int> now;
now.push_back(root->val);
ret.push_back(... | ALGO | 0.999987 | 6.025741 |
caf4cb28-6f5c-4115-9de0-9719b496d302 | viddya673/DSA-solutions-medium | BinaryTree/basicStruct.cpp | #include <iostream>
#include <stack>
using namespace std;
struct Node{
int data;
struct Node* left;
struct Node* right;
};
struct Node* newNode(int val){
struct Node* node = (struct Node*)malloc(sizeof(struct Node));
node->data = val;
node->left = NULL;
node->right = NULL;
return node;... | ALGO | 0.999955 | 5.343609 |
abc01a79-7fe5-4130-88e4-123e5052f9ae | istiak7/CompettiveProgramming | atcoder/dp/D.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
const int NN = 105 ;
ll w[NN] , v[NN] ;
ll N , W ;
ll dp[NN][100005];
ll knapsack(int i , ll weight) {
if ( i == N + 1)return 0 ;
if (dp[i][weight] != -1)return dp[i][weight];
long long int ans = knapsack(i + 1 , weight);
if (weight + w[i... | ALGO | 0.999996 | 4.554237 |
eb3ce6e8-3759-4816-b772-f232efd8bd20 | fx-dev-playground/gecko | gfx/skia/skia/src/pathops/SkPathOpsWinding.cpp | // given a prospective edge, compute its initial winding by projecting a ray
// if the ray hits another edge
// if the edge doesn't have a winding yet, hop up to that edge and start over
// concern : check for hops forming a loop
// if the edge is unsortable, or
// the intersection is nearly at the ... | ALGO | 0.999871 | 6.820954 |
f183215e-4d6e-47ec-ac3a-06a81cf73f44 | TaskaPaska/Codeforces-Solutions | 1140/A[Detective Book].cpp | #include <bits/stdc++.h>
using namespace std;
int n, a[1000000], b[1000000], ans, xx;
int main() {
cin>>n;
for (int i = 1; i <= n; i ++) {cin>>a[i]; if ((xx = max(xx, a[i])) > i) ans--;}
cout<<ans+n;
} | ALGO | 0.999826 | 3.199323 |
c74a40f8-c352-4f98-8fd3-ade045e275cb | sergiogutierrez2/Intro_to_C_plus_plus_Projects-DeAnza-2014 | Examples/Chapter 8/Program 8- 8 code for string arrays but idk about what.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
const int NUM_NAMES = 20;
string names[NUM_NAMES] = {"Collins, Bill", "Smith, Bart", "Allen, Jim",
"Griffin, Jim", "Stamey, Marty", "Rose, Geri",
"Taylor, Terri", "Johnson, Jill", "Al... | TOOL | 0.850992 | 4.172973 |
af940ebb-4880-4797-a28b-f7d42f5b5d8f | allydev/android_frameworks_base | media/libstagefright/codecs/amrwb/src/pvamrwbdecoder.cpp | /*
------------------------------------------------------------------------------
Filename: pvamrwbdecoder.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
----------------------------------------------------------------------... | ALGO | 0.998319 | 3.683612 |
0dbac16a-9635-4154-a3f9-5f7a622a9052 | sharath-66b6/leetcode_solution | 2564-most-profitable-path-in-a-tree/2564-most-profitable-path-in-a-tree.cpp | class Solution {
public:
int mostProfitablePath(vector<vector<int>>& edges, int bob,
vector<int>& amount) {
const int n = amount.size();
vector<vector<int>> tree(n);
vector<int> parent(n);
vector<int> aliceDist(n, -1);
for (const vector<int>& edge : edges) {
const ... | ALGO | 0.999853 | 5.348316 |
3331c8f8-2047-4a2d-a138-ebc1de2608c1 | alexandraback/datacollection | solutions_6404600001200128_1/C++/fuzopobofu/2015_1a_a.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <iterator>
#include <utility>
#include <iomanip>
#include <cmath>
#include <climits>
#include <stdio.h>
#include <str... | ALGO | 0.999659 | 3.839263 |
df5b8c7f-e948-4c54-9ffb-5d12f57d644b | NiharRanjan53/HacktoberFest_2022 | reverse_integer.cpp | #include <bits/stdc++.h>
using namespace std;
int reverse(int x) {
long long flag=1;
long long y =x;
if(y<0)
{
flag=-1;
y*=-1;
}
long long c=0;
while(y>0)
{
if(c*10 >INT_MAX)
return 0;
c*=10;
... | ALGO | 0.999895 | 4.932395 |
b9301d47-fb93-4a19-b40c-c62b4a444bad | Lucas1Rodrigues/Studies-Competitive-Programming | 002-Filas/testes.cpp | #include<iostream>
#include<queue>
using namespace :: std;
int main(){
//declarando uma fila
queue<int> q;
//insere elementos na fila
q.push(2);
q.push(3);
q.push(1);
//retorna o elemento mais antigo
cout << q.front() << endl;
//remove elemento mais antigo
// q.pop();
cout << q.front() << endl;
//re... | ALGO | 0.981447 | 3.977723 |
69333232-b02d-4b94-802f-4838f3782b71 | Vandan121/VS-code | Coding/Leetcode/40. Combination Sum II.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define cd complex<ld>
#define pi pair<int, int>
#define pl pair<ll,ll>
#define pd pair<ld,ld>
#define vi vector<int>
#define vd vector<ld>
#define vl vector<ll>
#define vpi vector<pi>
#define vpl vector<pl>
#define vcd vecto... | ALGO | 0.99981 | 4.622964 |
6669bd5f-9e52-453b-a206-d8977d1ade67 | austinmw/Cpp-code | tttwinner/tttwinner.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
using namespace std;
vector<string> getFileData()
{// Open file, read in, close, return string vector to main
ifstream tttboards;
string line;
vector<string> iflines;
tttboards.open("tictactoeboards.txt");
while (getline(tttboards, line)... | ALGO | 0.998824 | 4.839302 |
d13dcb67-7a14-4a86-80e4-eb956b6fbd4c | sarvex/cpp-leetcode | 2291.Maximum Profit From Trading Stocks.cpp | class Solution {
public:
int maximumProfit(vector<int>& present, vector<int>& future, int budget) {
int n = present.size();
int f[n + 1][budget + 1];
memset(f, 0, sizeof f);
for (int i = 1; i <= n; ++i) {
for (int j = 0; j <= budget; ++j) {
f[i][j] = f[i -... | ALGO | 0.99975 | 5.386044 |
dcfba8f2-9dbd-4b30-b0b0-f513b1bf11fd | Vedang12d/leetcode | Longest K unique characters substring - GFG/longest-k-unique-characters-substring.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 longestKSubstr(string s, int k) {
// your code here
unordered_map<char,int> mp;
int n=s.size();
int ans=... | ALGO | 0.999755 | 6.340686 |
420cb00b-c431-4173-bcc7-8bacdc4eff3c | Ishwarendra/CompetitiveProgramming | CodeForces/GNU C++20 (64)/1343D_Constant Palindrome Sum/1343_D.cpp | #include "bits/stdc++.h"
#ifdef LOCAL
#include "F:\CPP\Debug\debug.h"
#else
#define print(...) 1;
#endif
using i64 = long long;
void solve()
{
int n, k;
std::cin >> n >> k;
std::vector<int> a(n);
for (int i = 0; i < n; i++)
std::cin >> a[i];
std::vector<int> cnt(2 * k + 2), sum(2 * k... | ALGO | 0.999732 | 4.751388 |
1d65b73f-130e-44dc-a0b5-cb2c4034a749 | mattiasgustavsson/steem-crt | 3rdparty/ArchiveAccess/CPP/7zip/UI/Common/UpdatePair.cpp | // UpdatePair.cpp
#include "StdAfx.h"
#include <time.h>
#include "Common/Defs.h"
#include "Common/Wildcard.h"
#include "Windows/Time.h"
#include "SortUtils.h"
#include "UpdatePair.h"
using namespace NWindows;
using namespace NTime;
static int MyCompareTime(NFileTimeType::EEnum fileTimeType, const FILETIME &time1... | TOOL | 0.950631 | 6.356612 |
54e96d80-27ac-47ae-a06d-23be30cfeace | Bill-Gray/lunar | cospar2.cpp | #include <math.h>
#include <string.h>
#include "watdefs.h"
#include "afuncs.h"
#include "lunar.h"
/* Older version of the COSPAR code to compute orientations of planets
and natural satellites. The newer version is in 'cospar.cpp'. This
version is being kept around for reference, and in case somebody has
been using ... | ALGO | 0.999924 | 4.357019 |
75c5bef8-adc9-4ee9-931f-539b1d1cae00 | nikhil-x24/DSA_Practics | Day_09-ArrayProblem1/02-ReverseArr.cpp | #include<iostream>
using namespace std;
void reverese(int arr[], int size) {
int start = 0;
int end = size-1;
while (start < end)
swap(arr[start++], arr[end--]);
}
int main() {
int arr[] = {1, 2, 3, 4, 5, 6, 7};
cout << "Reversed array is" << endl;
reverese(arr, 7);
//print array
for(int i = 0; i < 7... | ALGO | 0.998909 | 4.853309 |
150439db-83d7-4180-9f8c-e794837b9d77 | dilsekhpatnaik7/Leet-Sync | 1797-goal-parser-interpretation/goal-parser-interpretation.cpp | class Solution {
public:
string interpret(string command) {
string ans = "";
for(int i = 0;i < command.size(); i++) {
if(command[i] == 'G') {
ans += "G";
} else if(command[i] == '(' && command[i + 1] == ')' && i+1 < command.size()) {
ans += "o... | ALGO | 0.998285 | 4.716866 |
2f00dd5c-0631-49e0-b72d-36281006cc31 | LingNc/LingNc | school/暑假集训/acwing/848.有向图的拓扑序列-2.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#define int long long
#define foe(i,a,b) for(int i=a;i<=b;i++)
#define endl '\n'
using namespace std;
//记得改1e5+10
const int N=1e5+10;
//链表
int h[N],e[2*N],ne[2*N],idx;
// 队列
int q[N];
int n,m,in[N];
//添加邻接表
void add(int a,int b){
e[idx]=b... | ALGO | 0.999993 | 4.396955 |
950d0240-65f0-4a64-9f21-2dbb8f1be9e6 | raviprakash7367/coding-solution | leetcode/matrix-chain-multiplication-gfg.cpp | /*
name= matrix chain multiplication
link- https://practice.geeksforgeeks.org/problems/matrix-chain-multiplication0303/1
author- Parth garg
time complexity- o(n^3)
space complexity- o(n^2)
method 1;
*/
//{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace ... | ALGO | 0.999985 | 5.156972 |
da0ed17b-3b15-44e4-9045-3d6e9d3d5fa0 | MaestroOso/UVA-Solutions | Vector y Map (UVA - 11991).cpp | #include <bits/stdc++.h>
using namespace std;
int queso(map<int, vector<int> > &numeros, int n, int oc){
oc--;
if(numeros.find(n)==numeros.end())
return 0;
if(numeros[n].size()-1<oc)
return 0;
return numeros[n][oc]+1;
}
int main()
{
int tam, bus, aux;
while(cin>>tam>>bus){
... | ALGO | 0.999657 | 4.066775 |
3c6762b6-91cc-470e-959d-0c625e6642bc | dreamerweee/Algorithm | LeetCode/delete_duplicates.cpp | /*
给定一个排序链表,删除所有含有重复数字的节点,只保留原始链表中 没有重复出现 的数字。
*/
ListNode* deleteDuplicates(ListNode* head)
{
if (head == nullptr || head->next == nullptr) {
return head;
}
ListNode tmp(-1);
ListNode *tmp_curr;
ListNode *prev = head;
ListNode *curr = head->next;
int count = 1;
while (curr) {... | ALGO | 0.999956 | 5.188343 |
1dfd7735-d90a-4848-9c12-acac2da72bda | shahbazcse/DataStructures | LS/Recursion/printAlternateNodes.cpp | // Link: https://www.geeksforgeeks.org/print-alternate-nodes-linked-list-using-recursion/
// Approach: Recursion [TC: O(N) / SC: O(1)]
#include <bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
struct Node* next;
Node(int data){
this->data = data;
... | ALGO | 0.9999 | 5.516324 |
bfbbe1a0-69d9-4d49-b73c-6f774b9444c5 | dihanrh/Competitive-Programming | RemovePrefix.cpp | <<<<<<< HEAD
//https://codeforces.com/contest/1714/problem/B
#include <bits/stdc++.h>
#define FAST ios::sync_with_stdio(0) ; cin.tie(0); cout.tie(0) ;
using namespace std ;
void solve()
{
int n ;
cin >> n ;
int ar[n] ;
for ( int i = 0 ; i < n ; i ++)
{
cin >> ar[i] ;
}
set<int ... | ALGO | 0.999372 | 5.131109 |
0347f0b2-d3c5-40e4-b9b0-728907f54093 | hrit-ikkumar/hritikkumar-cp | Part-II Graph Algorithms/Chapter 11 (Basics of graphs)/3_edge_list.cpp | // @hritikkumar
#include<bits/stdc++.h> // all header files
#define endl '\n'
using namespace std; // namespace created as std
int main(void)
{
std::ios::sync_with_stdio(false); // fastio
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int vertices, edges;
... | ALGO | 0.999623 | 4.280077 |
910b12fb-1188-4046-bdff-9ae4e91b6076 | cxreet/11vm | clang/test/SemaCXX/constexpr-ackermann.cpp | // RUN: %clang_cc1 -std=c++11 -fsyntax-only %s
constexpr unsigned long long A(unsigned long long m, unsigned long long n) {
return m == 0 ? n + 1 : n == 0 ? A(m-1, 1) : A(m - 1, A(m, n - 1));
}
using X = int[A(3,4)];
using X = int[125];
| ALGO | 0.990715 | 3.247344 |
2b7b7b05-b01e-4da7-b387-38cad9252919 | BinomialSheep/Competitive | AtcoderContest/ABC307/G.cpp | #pragma region header
#include <bits/stdc++.h>
// デバッグ用マクロ:https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
using namespace std;
using ll = long long;
using vi = vector<int>... | ALGO | 0.999926 | 5.143072 |
67f95c47-1a77-4bb6-ac5a-1d24accbcf99 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_8990_0.cpp | #include <bits/stdc++.h>
using namespace std;
typedef struct {
int l, p;
} Song;
bool songCompare(Song a, Song b) {
return a.p * (100 - b.p) * a.l > b.p * (100 - a.p) * b.l;
}
int main() {
int n;
Song s[50000];
cin >> n;
for (int i = 0; i < n; i++) cin >> s[i].l >> s[i].p;
sort(s, s + n, songCompare);
d... | ALGO | 0.999489 | 3.885769 |
3d0eac7f-37d3-4665-9f32-652c0075686f | allwinner-ics/platform_external_llvm | lib/CodeGen/CalcSpillWeights.cpp | #define DEBUG_TYPE "calcspillweights"
#include "llvm/Function.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/CodeGen/CalcSpillWeights.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#in... | TOOL | 0.965807 | 7.776109 |
6003877c-4985-417b-af0f-1d52f2a296dd | otoyaa/past-contest | C++/Japan High School Programming Contest - Preliminares/2019/2の累乗.cpp | #include <bits/stdc++.h>
#define read(x) cin>>x
#define vi vector<int>
#define l(i,s,n) for (int i=int(s);i<int(n);i++)
#define pb push_back
#define f first
#define s second
#define no cout<<"NO"<<"\n"
#define yes cout<<"YES"<<"\n"
#define pii pair<int,int>
typedef long long ll;
using namespace std;
void solve(){
... | ALGO | 0.999928 | 4.279798 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.