uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
df9a7afc-7578-4827-991a-ed9864d8052d | bobby-mohanty/CodeForces | 800/1281A.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
int len;
string s;
cin>>n;
while(n--)
{
cin>>s;
len = s.length();
if(s.substr(len-2,len).find("po") != string::npos)
cout<<"FILIPINO\n";
else if(s.substr(len-4,len).find("desu") != string::npos ||
s.substr(len-4,len).fin... | ALGO | 0.954274 | 3.637257 |
2b1d02b2-59d3-4893-982e-deb3b61e6960 | pranavsindura/CompetitiveProgramming | MustDo_GeeksForGeeks/Greedy/minimum-spanning-tree.cpp | /*
Find Total edge weight of MST for the given graph
*/
/*
Approach 1 - Kruskal MST using DSU
*/
// Function to construct and print MST for
// a graph represented using adjacency
// matrix representation, with V vertices.
// graph[i][j] = weight if edge exits else INT_MAX
struct edge
{
int u, v, cost;
edge() ... | ALGO | 0.999688 | 5.503305 |
bc023a03-084c-4b68-83e6-1fd4406c8179 | deepwzh/leetcode_practice | 6.cpp | class Solution {
public:
string convert(string s, int numRows) {
if (s.empty()) {
return "";
}
if (numRows == 1) {
return s;
}
string res;
char chs[1000][1000];
for (int i = 0; i < 1000; i++) {
for (int j = 0; j < 1000; j++)... | ALGO | 0.999967 | 5.549103 |
4ba470a3-b29b-456b-a4d4-da211afe10dd | Johannyjm/c-pro | AtCoder/abc/abc038/c.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n;
cin >> n;
vector<ll> a(n);
for(int i = 0; i < n; ++i) cin >> a[i];
ll l = 1;
ll res = 0 ;
for(int i = 1; i < n; ++i){
if(a[i] ... | ALGO | 0.999909 | 3.882865 |
9909b474-8d9e-4f6f-a1d3-1d3d35b38e69 | dubshfjh/LeetCode | 131.cpp | class Solution {
public:
map<char,vector<int>> ch_index;
vector<vector<string>> res;
bool is_palin(int start,int end,string s){
while(start < end){
if(s[start] != s[end]){
return false;
}
start++;
end--;
}
return true;
... | ALGO | 0.999954 | 6.025501 |
ab91cc05-e29e-44d1-a353-70f1f18b02c2 | marcel-dev-acc/mobile-technology-comparison | flutter/chuck_norris_jokes_app/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.99809 | 6.763549 |
03f97c67-0556-4d55-b168-d9445e5bf246 | rupav/cp | competitive_coding/contests/AtCoder/abc167/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << endl
#define fr(i,n) for(int i=0; i<n; i++)
#define rep(i, st, en) for(int i=st; i<=en; i++)
#define repn(i, st, en) for(int i=st; i>=en; i--)
#define sq(a) (a*a)
typedef long long ll;
typedef pair<int, int> pii;
typedef pai... | ALGO | 0.999976 | 4.123096 |
13b7d6b2-8277-4a85-866c-607b5324db1f | yakuri354/cp | yandex/finals/h_geom.cpp | // #pragma GCC optimize("Ofast")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <algorithm>
#include <cmath>
#include <exception>
#include <fstream>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <ostream>
#include <random>
#include <set>
#include <stdexcept... | ALGO | 0.982409 | 4.082555 |
67807919-3ddb-434c-a74e-cf21b894480a | ishandutta2007/codeforces | galen_colin/normal/1400/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL); cout.tie(NULL);}
#define f first
#define s second
#define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
typedef long long ll;
typedef long double lld;
... | ALGO | 0.999786 | 3.692708 |
f2edc755-42c5-438c-a36c-bb2761e1e939 | shegzydev/TicTacToe | OnX/OnX.cpp | #include <iostream>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
#define W 512
#define H 512
SDL_Point *O(int x, int y);
int main(int args, char** argv) {
TTF_Init();
SDL_Init(SDL_INIT_VIDEO);
SDL_Window *window = SDL_CreateWindow("OnX", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, W, H, 0);
S... | ALGO | 0.889284 | 5.506095 |
eb0a9ca8-60f5-4317-9d9c-735373b7c3b1 | Vibha261/Leetcode | 1614-maximum-nesting-depth-of-the-parentheses/1614-maximum-nesting-depth-of-the-parentheses.cpp | class Solution {
public:
int maxDepth(string s) {
int depth =0;
int maxdepth=0;
for(int i=0; i<s.length(); i++)
{
if(s[i]=='(')
{
depth++;
maxdepth=max(maxdepth, depth);
}
else if(s[i]==')')
{... | ALGO | 0.999334 | 5.56411 |
d411972d-a5a7-4349-ba1d-46cd3d2fdeb1 | hjiang13/LLMs-in-IR | POJ-104/48/1127.cpp | #include <iostream>
using namespace std;
//**********************************
//*?????????.cpp *
//*? ????? *
//*? ??2013.12.4 *
//**********************************
void judge(int m , int n ,int (*p)[9])
{
int str[9][9] , i , j ;
if ( n == 0 ) //??n??0??????n???????
... | ALGO | 0.999591 | 3.338013 |
29cd6369-afbc-468b-bcd8-0efd7414b368 | RiditCodes/Cpp-Projects | recursive function.cpp | #include<iostream>
#include<cstdlib>
using namespace std;
int sum(int n);
int main()
{
system("cls");
int num;
cout<<"Enter no.: ";
cin>>num;
cout<<"Sum of "<<num<<" no.s is "<<sum(num);
}
int sum(int n)
{
if(n>1)
{
return n+sum(n-1);
}
else
{
return 1;
}
}
| ALGO | 0.989797 | 3.373129 |
620cf1b5-cfe8-409e-8de8-812037f30c26 | LuckyPigeon/CPE_Previous_Questions | 一星題/10929/method1/10929.cpp | /*
* Author: @1chooo
* Title: 10929 - You can say 11
* Required: Time limit: 3.000 seconds
* Link: https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1870
* Status: AC
*/
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main(void) {
s... | ALGO | 0.997805 | 4.693321 |
cea342bf-c809-44cf-bb7c-a35a5e082a8e | Garvit-1/DSA | 231-power-of-two/power-of-two.cpp | class Solution {
public:
bool isPowerOfTwo(int n) {
if(n==0 || n<0) return false;
double a=log2(n);
long x=a;
double z=a-x;
if(z>0) return false;
return true;
}
}; | ALGO | 0.998495 | 5.825027 |
d9c6fe63-ba4a-4444-a881-da44c65954f6 | URSec/Silhouette-Compiler-Legacy | lib/IR/TypeFinder.cpp | #include "llvm/IR/TypeFinder.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "l... | TOOL | 0.89693 | 7.879835 |
f7cea448-ca86-4cb2-a5cb-3124d9aecb1f | jriegel/FreeCAD | src/Mod/Robot/App/kdl_cp/path_composite.cpp | /*****************************************************************************
* \author
* Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven
*
* \version
* ORO_Geometry V0.2
*
* \par History
* - $log$
*
* \par Release
* $Id: path_composite.cpp,v 1.1.1.1.2.7 2003/07/24 13:49:16 rwaarsin Exp $
... | TOOL | 0.938938 | 4.390639 |
9629e849-f05e-428c-bcad-e263ee008761 | inho9606/Leetcode | Failed_Largest_Divisible_Subset.cpp | class Solution {
public:
vector<int> largestDivisibleSubset(vector<int>& nums) {
if(nums.size() <= 1) return nums;
set<int> s;
bool ok;
for(int i=0; i<nums.size()-1; i++) {
ok=0;
for(int j=i+1; j<nums.size(); j++) {
if(nums[i] % nums[j] == 0 || nums[j] % nums[i] == 0) {
s.insert(nums[j]);
o... | ALGO | 0.999977 | 5.10582 |
1f800fc3-4507-41f6-8d59-e290dd959dcf | ZekkaOwO/InfiniteInt | InfiniteInt.cpp | /**
* This is a class which can represent an "infinite"
* length of number, and its operations
* Name: Zhangfan Li
* WisID: 9080148449
* NetID: zli854
**/
#include "InfiniteInt.h"
using namespace std;
vector<unsigned int>* InfiniteInt::count(long val) {
vector<unsigned int>* count = new vector<unsigned int>;
... | ALGO | 0.983689 | 4.289395 |
05d024a3-b6f0-45a0-8b7f-d75b1aa50e49 | seoykwon/problem_solving | level28,29/29_q1.cpp | #include <iostream>
using namespace std;
int n;
int arr[101][101] = {0};
void input(){
cin >> n;
for(int i = 0; i<n ;i++){
for(int j = 0; j < n; j++){
cin >> arr[i][j];
}
}
}
void dfs(int now)
{
cout << now << " ";
for (int i = 0; i < n; i++) {
if (arr[now][i] == 1) {
... | ALGO | 0.999938 | 3.632177 |
13db7430-d0e0-4f71-85ee-acc341f6751e | ishandutta2007/codeforces | jiangly/normal/1684/C.cpp | #include <bits/stdc++.h>
using i64 = long long;
void solve() {
int n, m;
std::cin >> n >> m;
std::vector a(n, std::vector<int>(m));
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
std::cin >> a[i][j];
}
}
int x = 0;
while (x < n && std::is_... | ALGO | 0.999974 | 4.319851 |
f731e99c-d242-4f51-8636-f191662cb502 | Khyatikumari/Metacrafter-Avalanche-Module-3 | 2463-minimum-recolors-to-get-k-consecutive-black-blocks/2463-minimum-recolors-to-get-k-consecutive-black-blocks.cpp | class Solution {
public:
int minimumRecolors(string blocks, int k) {
int black_count = 0, ans = INT_MAX;
for (int i = 0; i < blocks.size(); i++) {
if (i - k >= 0 && blocks[i - k] == 'B') black_count--;
if (blocks[i] == 'B') black_count++;
ans = mi... | ALGO | 0.99962 | 5.883865 |
1f9f59b5-aae9-4adb-8587-357dca7326bc | Sjhunt93/Aserve-2.0 | JuceLibraryCode/modules/juce_audio_basics/effects/juce_IIRFilter.cpp | namespace juce
{
IIRCoefficients::IIRCoefficients() noexcept
{
zeromem (coefficients, sizeof (coefficients));
}
IIRCoefficients::~IIRCoefficients() noexcept {}
IIRCoefficients::IIRCoefficients (const IIRCoefficients& other) noexcept
{
memcpy (coefficients, other.coefficients, sizeof (coefficients));
}
IIRCo... | ALGO | 0.890687 | 5.776078 |
55010fd1-19ac-491a-8401-3599b4d42034 | fjmedinaaguayo/ClonOr_cpp | ClonOr_cpp/movetheta.cpp | #include "movetheta.h"
using namespace std;
namespace weakarg
{
MoveTheta::MoveTheta(Param * p,double a)
: Move(p,a)
{
description= "Update of the mutation rate theta";
name="Theta";
}
int MoveTheta::move()
{
numcalls++;
double t=param->getTheta();
double t2=t+(gsl_rng_uniform(rng)-0.5)*... | ALGO | 0.991138 | 5.731636 |
071ea612-76c6-4ab2-a53a-a5de08bbed4f | Zevinn/Seneca_OOP | OOP244/WS08/home/w8_at_home.cpp | // Workshop 8 - Virtual Functions and Abstract Base Classes
// File: w8_at_home.cpp
// Version: 2.0
// Date: 2017/12/11
// Author: Chris Szalwinski, based on previous work by Heidar Davoudi
// Description:
// This file tests at_home section of your workshop
///////////////////////////////////////////////////
#include ... | TEST | 0.884423 | 6.027963 |
2c1ff5c1-77fa-462f-ae9d-414406125345 | Khushi-2005/-CrackYourPlacement | Week/Climbing Stairs.cpp | class Solution {
public:
int climbStairs(int n) {
//since constraints r very low ,we can try O(N) approach
int prev2 = 1;
int prev1 = 1;
int curr;
//we have taken 2 pointers bec there are 2 ways to reach at the top
for(int i = 2;i<=n;i++){
//iterate t... | ALGO | 0.999967 | 6.181639 |
1bebde96-a715-4330-a50a-d2b61b3567ee | Bee0Theepob/Data_Struct | d65_q1a_delivery.cpp | #include<iostream>
#include <queue>
#include<vector>
#include <algorithm>
using namespace std;
int main(){
std::ios_base::sync_with_stdio(false); std::cin.tie(0);
int n,m,a,b,c;
queue<int> m1,m2;
vector<int> mon={0};
cin>>n>>m;
vector<int> target(m);
for(int i= 0;i<m;i++){
cin>>targe... | ALGO | 0.999983 | 3.778701 |
577d7e95-c7dc-4325-b150-f413fa313a39 | n-yata/AtCoder-ABC | B/B149.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
int main(){
ll a,b,k;
cin >> a >> b >> k;
ll x = a-k;
if(x >= 0) cout << x << " " << b << endl;
else{
ll y = b+x;
if(y >= 0) cout << 0 << " " << y << endl;
else... | ALGO | 0.999957 | 3.911391 |
9e4ff024-6f4b-43d5-a8d3-706e56fb2943 | EthanKim8683/High-School-Competitive-Programming | USACO/Guide/Gold/Point Update Range Sum/distinct.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
using I = int;
using B = bool;
const I N = 2e5;
const I Q = 2e5;
vector<I> vals;
I x_arr[N];
pair<I, I> q_arr[Q];
I fens[N + 1];
I inds[N];
I swps[Q];
I ress[Q];
I n;
I cps(I i) {
return upper_bound(vals.begin(), va... | ALGO | 0.999908 | 4.528275 |
d7f38f2a-4691-4360-8561-d15d29cfe4b1 | Utkarsh-Jain-LPU/Leetcode | 0066-plus-one/0066-plus-one.cpp | class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
int n = digits.size();
if (digits[n-1] != 9) {
digits[n-1]++;
return digits;
}
digits[n-1] = 0;
int x = n-2;
while (x >= 0 && digits[x]+1 > 9) {
digits[x] = 0;
... | ALGO | 0.999854 | 6.946745 |
04a021c3-8434-4ca8-b675-a22c309657ce | rutgers-apl/Atomicity-Violation-Detector | tdebug-llvm/llvm/lib/CodeGen/VirtRegMap.cpp | #include "llvm/CodeGen/VirtRegMap.h"
#include "LiveDebugVariables.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SparseSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/LiveStackAnalysis.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGe... | TOOL | 0.96835 | 3.078506 |
bdb9c326-fbb0-4378-9f40-a6b723bba572 | junghwan928/Basic-cpp-2024 | day13/Project_test/Project_test/test.cpp | /*
char ary[] = {'a','b', 'c', 'd', 'e', 'f'}
: while if 迭 ٲپ
*/
#include <iostream>
using namespace std;
int main() {
char ary[] = { 'a', 'b', 'c', 'd', 'e', 'f' };
int size = sizeof(ary) / sizeof(ary[0]);
int start = 0;
int end = size - 1;
while (start < end) {
// if Ư Ͽ Ҹ ȯ
... | ALGO | 0.997729 | 3.237932 |
7100e72d-0247-4c80-a18f-94df7eb0f296 | LordNerevar/external_chromium_org-third_party-WebKit | Source/core/rendering/shapes/ShapeInsideInfo.cpp | #include "config.h"
#include "core/rendering/shapes/ShapeInsideInfo.h"
#include "core/rendering/InlineIterator.h"
#include "core/rendering/RenderBlock.h"
namespace WebCore {
LineSegmentRange::LineSegmentRange(const InlineIterator& start, const InlineIterator& end)
: start(start.root(), start.object(), start.offs... | TOOL | 0.932914 | 7.739987 |
85edd03e-653f-47c0-8b99-f1e9ea0f3077 | AutonomousRoboticEvolution/AREFramework | experiments/common/fixed_controller.cpp | #include "fixed_controller.hpp"
using namespace are;
std::vector<double> FixedController::update(const std::vector<double> &sensorValues){
double input_noise_lvl = settings::getParameter<settings::Double>(parameters,"#inputNoiseLevel").value;
double output_noise_lvl = settings::getParameter<settings::Double>(... | TOOL | 0.931411 | 5.157807 |
2eedd15f-5e06-45e6-8311-c1e3f956bf98 | wit-women-in-tech/Practice | Binary-Search/two-sum-ii-input-array-is-sorted/Priyanka.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
vector<int> ans;
int i = 0;
int j = numbers.size() - 1;
while(i<j){
int sum = numbers[i] + numbers[j];
if(sum == target){
ans.push_back(i+1);
ans.pu... | ALGO | 0.999783 | 6.327696 |
af26d4c2-6dc1-4606-a663-c77cf545229e | 5Bh03m1k/Leetcode | 2182-find-the-minimum-and-maximum-number-of-nodes-between-critical-points/find-the-minimum-and-maximum-number-of-nodes-between-critical-points.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:
vector<int> nodesBetw... | ALGO | 0.999985 | 5.013998 |
2e884e0b-c6c4-4278-ab35-d0a42c1493bc | LaLlorona/Algorithms | CodeForce/EducationaiRound88/A.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
std::cout.tie(NULL);
// std::ifstream in("in.txt");
// std::streambuf *cinbuf = std::cin.rdbuf(); //save old buf
// std::cin.rdbuf(in.rdbuf()); //redirect std::cin to in.txt!
int nu... | ALGO | 0.993772 | 3.683425 |
cef5174b-f1d0-4693-9962-7f75bcd15109 | linkumokunn/code_la | CF/1616C.cpp | #include<bits/stdc++.h>
#define int long long
#define IO ios_base::sync_with_stdio(false);cin.tie(0);
#define pii pair<int,int>
#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define all(x) x.begin(),x.end()
using namespace std;
main(){
IO
int t;cin >> t;
while(t-... | ALGO | 0.999861 | 3.916653 |
d138ac59-b7fb-45c0-8c1b-8213b4cfd457 | pokaa3a/LeetCode | problems/0909_Snakes_and_Ladders.cpp | #include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <string>
#include <queue>
#include <stack>
#include <sstream>
#include <cmath>
#include <numeric>
using namespace std;
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode(... | ALGO | 0.999594 | 6.02758 |
5417208a-8edd-431b-8b54-a874d6491e55 | Xi0131/Miru_can_sort | prac/week3/A.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl
#define debug cout << "hi" << endl
using namespace std;
typedef long long ll;
typedef long double ld;
typedef ... | ALGO | 0.99994 | 4.582088 |
873b26aa-e2ce-4f19-a448-117795c083f9 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4868_13.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int n;
char str[N];
int maxScore[N], minScore[N], curScore[N];
int cnt[5 * N];
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%s", str);
int l = strlen(str);
minScore[i] = N;
for (int j = 0; j < l; j++) {
... | ALGO | 0.999735 | 4.051657 |
738c3002-c78b-4d07-b8ad-f008e5b8a5bf | YamadaTsuyoshi/Dproject | Libs/BaseLib/DxLib/physics_effects/src/base_level/collision/pfx_shape.cpp | #include "stdafx.h"
#include "../../../include/physics_effects/base_level/collision/pfx_shape.h"
namespace sce {
namespace PhysicsEffects {
void pfxGetShapeAabbDummy(const PfxShape &shape,PfxVector3 &aabbMin,PfxVector3 &aabbMax)
{
(void)shape,(void)aabbMin,(void)aabbMax;
}
void pfxGetShapeAabbSphere(const PfxShape... | ALGO | 0.963076 | 7.27563 |
2c7958ed-15ad-4527-b100-77673875957a | ryankert01/competitive-programming | 1star/UVA-10050.cpp | #include<iostream>
using namespace std;
void hDay(int (&day)[4000], int partyDay, int MaxDay){
for(int i = partyDay; i <= MaxDay; i += partyDay){
if(i%7 == 0 || i%7 == 6) continue;
day[i] = 1;
}
}
int main(){
int days, parties, t;
cin >> t;
while(t-- && cin >> days){
cin >>... | ALGO | 0.999628 | 4.018407 |
5ce3bb9c-2c5c-49a7-880f-1da41d1da296 | Reavolt/Cpp-Primer-Plus | Chapter 3/3.12_modulus.cpp | //modulus.cpp -- использует операцию % для преобразования фунтов в стоуны
//#include "stdafx.h" --- Visual Studio --- precompiled headers
#include <iostream>
using namespace std;
//-------------------------------------------------------------------------------------------------
int main()
{
const int Lbs_per_stn = ... | TOOL | 0.861332 | 3.329151 |
ac09dea1-896b-4a9e-9707-e49883e1c1ec | DrSwad/CP | Submissions/ICPC/AWC/2022/E.cpp | #include <bits/stdc++.h>
using namespace std;
void test_case() {
int n;
cin >> n;
string s;
cin >> s;
for (int l = 0; l < n; ) {
int r = l;
while (r < n and s[r] == s[l]) r++;
int len = r - l;
if (len > 1 and l > 0 and r < n) {
if (s[l] == '1') cout << l << " " << r + 1 << " " << l + ... | ALGO | 0.998499 | 3.488392 |
1eead403-ffb2-4b2d-b287-05775474cf3a | Moahmednour/fireauth | 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.998859 | 6.785645 |
7a1b9baa-781e-4dd7-831d-e4423da6971d | gaohongy/Algorithm-Competition-Code | 算法挑战赛/正式赛/E.cpp | /**
* 由于可以进行任意次调整,因此顺序是任意的
* 只需考虑一种最优顺序即可
* 我考虑的是贪心,结果一看标签给的是01背包
*
* 伤害就是背包问题中的价值,去掉人数等价于占用背包容量
*/
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
constexpr int N = 50;
int n;
int v[N], w[N];
int f[N][N];
void solve()
{
cin >> n;
for (int i = 1; i <= n; ++i) cin >> ... | ALGO | 0.999997 | 4.235111 |
6765499d-938e-4a69-a929-fdc24aa79a3c | ishandutta2007/codeforces | shnirelman/normal/1491/C.cpp | #include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
using li = long long;
using ld = long double;
using pii = pair<int, int>;
const int INF = 1e9 + 13;
const int M = 1e9 + 7;
const int N = 2e5 + 13;
/*
*/
void solve() {
int n;
cin >> n;
vector<int> a(n);
// vector<int> rg... | ALGO | 0.999851 | 4.061876 |
a5e80738-1cf4-4431-ab5e-43c7cf44c767 | pganesgh321/DSA0159-C- | 80.cpp | #include <iostream>
using namespace std;
// Base class Shape
class Shape {
protected:
double height;
double width;
public:
Shape(double h = 0.0, double w = 0.0) : height(h), width(w) {}
virtual double area() const = 0; // Pure virtual function
virtual double perimeter() const = 0; // Pure virtual... | ALGO | 0.971629 | 6.727873 |
4a9017c7-120e-4921-8c78-15998f17645d | pabloxid/samsa-ii | v8.2.5/src/_comentarios.cpp | // mov_alto_nivel.cpp created for project v8.2 on 06/05/2011 03:10:08
/* la intención de esta clase es convertirse en la clase universal de movs de alto nivel que
actualmente están en remote_control... el is_moving, los ángulos, etc., va a pasar a estar
todo acá, y va a ser controlable por todos los sensores, n... | TOOL | 0.913674 | 3.160115 |
1b45b1d9-9fa2-4c95-a4e2-487b5956e16c | skywhat/leetcode | Cpp/115.cpp | // Given a string S and a string T, count the number of distinct subsequences of
// S which equals T.
//
// A subsequence of a string is a new string which is formed from the original
// string by deleting some (can be none) of the characters without disturbing
// the relative positions of the remaining characters. (ie... | ALGO | 0.999921 | 7.307809 |
07616de2-f707-4eb8-b79e-7e7f12a85e8e | xavierbeast68/Leetcode-DCC | 3. March (2023)/Day-10 Linked List Random Node/382-linked-list-random-node.cpp | //* https://leetcode.com/problems/linked-list-random-node/description/
//* https://www.youtube.com/watch?v=qQDM1J02Sq4
//* https://www.youtube.com/watch?v=FoHIX3URFaM
//* https://www.geeksforgeeks.org/select-a-random-node-from-a-singly-linked-list/
/**
* Definition for singly-linked list.
* struct ListNode {
* ... | ALGO | 0.998557 | 5.556114 |
555d71a8-4e47-4d4d-aa3c-7d822d749100 | Ayush242/CodeWars | 8kyu/Quarter of the year.cpp | // Given a month as an integer from 1 to 12, return to which quarter of the year it belongs as an integer number.
// For example: month 2 (February), is part of the first quarter; month 6 (June), is part of the second quarter; and month 11 (November), is part of the fourth quarter.
// Constraint:
// 1 <= month <= 12... | ALGO | 0.986651 | 5.781903 |
0dca6ef5-baf9-484c-a0e4-d5f0aa78009e | 1180300515/leetcode-problem | 27 移除元素/main.cpp | #include <vector>
using namespace std;
class Solution {
public:
int removeElement(vector<int>& nums, int val) {
for (auto iter = nums.begin(); iter != nums.end();)
{
if (*iter == val)
{
nums.erase(iter);
}
else
{
... | ALGO | 0.998843 | 6.197624 |
47cc8055-e440-4b95-8766-3236c3495c58 | mqprichard/stockfishchess-ios-ipa | OldEngine/san.cpp | ////
//// Includes
////
#include <cassert>
#include <cstring>
#include <iomanip>
#include <string>
#include <sstream>
#include "history.h"
#include "movepick.h"
#include "san.h"
using std::string;
////
//// Local definitions
////
namespace {
enum Ambiguity {
AMBIGUITY_NONE,
AMBIGUITY_FILE,
AMBIGUITY... | ALGO | 0.995915 | 7.143489 |
67921a0c-8ffd-44af-95e0-b09cdfac2fe5 | sbn1/Competitive_programming | standart_problems/Arrays_and_Hashing/count_nr_of_strictly_increasing_subarrays.cpp | #include <iostream>
//Time:O(N)
//Space: O(1)
int count_strictly_increasing_subarrays(int arr[], int n)
{
int length = 1, count_inc_subarrays = 0;
for (int i=1; i < n; i++)
{
if (arr[i] > arr[i-1]){
count_inc_subarrays += length;
length ++;
}
else {
... | ALGO | 0.999941 | 5.427594 |
23d6b106-23de-44e4-92b2-44edcbc2b0bf | Shivuu2803/LeetCode-Problems | 61-sort array by parity II.cpp | class Solution
{
public:
vector<int> sortArrayByParityII(vector<int>& nums)
{
int n = nums.size();
for (int i = 0, j = 1; i < n; i += 2, j += 2)
{
while (i < n && nums[i] % 2 == 0)
{
i += 2;
}
while (j < n && nums[j] % 2 == 1)
{
j += 2;... | ALGO | 0.999957 | 5.488484 |
08fc4399-d899-4f26-9fbf-95f1b52c0716 | mapleelpam/boost | libs/graph/example/make_connected.cpp | #include <boost/graph/connected_components.hpp>
#include <boost/graph/make_connected.hpp>
using namespace boost;
int main(int argc, char** argv)
{
typedef adjacency_list
< vecS,
vecS,
undirectedS,
property<vertex_index_t, int>
>
graph;
graph g(11);
add_edge(0,1,g);
add_edge(2,... | ALGO | 0.990866 | 6.849315 |
b9712dc9-7219-413c-8454-a9d857836750 | whwh747/diff_gaussian_rasterization_with_mask | third_party/glm/test/core/core_func_integer_bit_count.cpp | // This has the programs for computing the number of 1-bits
// in a word, or byte, etc.
// Max line length is 57, to fit in hacker.book.
#include <cstdio>
#include <cstdlib> //To define "exit", req'd by XLC.
#include <ctime>
unsigned rotatel(unsigned x, int n)
{
if (static_cast<unsigned>(n) > 63) { std::printf("r... | ALGO | 0.998906 | 4.846448 |
b9fb79d1-6529-4957-8637-5e9e3dbf08bf | pgrit/var-aware-mis-pbrt | src/shapes/nurbs.cpp | // shapes/nurbs.cpp*
#include "shapes/nurbs.h"
#include "shapes/triangle.h"
#include "paramset.h"
#include "texture.h"
namespace pbrt {
// NURBS Evaluation Functions
static int KnotOffset(const Float *knot, int order, int np, Float t) {
int firstKnot = order - 1;
int knotOffset = firstKnot;
while (t > kn... | ALGO | 0.998274 | 5.520708 |
169f7b1c-f7bb-43ae-ad6f-f8182f9afe8f | WangSimiao2000/GAMES101-Assignments | opencv/sources/modules/objdetect/src/qrcode_encoder.cpp | #include "precomp.hpp"
#include "qrcode_encoder_table.inl.hpp"
#include "graphical_code_detector_impl.hpp"
namespace cv
{
using std::vector;
const int MAX_PAYLOAD_LEN = 8896;
const int MAX_FORMAT_LENGTH = 15;
const int MAX_VERSION_LENGTH = 18;
const int MODE_BITS_NUM = 4;
const uint8_t INVALID_REGION_VALUE = 110;
st... | TOOL | 0.939664 | 5.748504 |
d51bfac8-6dca-4080-9e22-562d769a0db5 | ecazuc/SPH | tp_ig-student/sfmlGraphicsPipeline/src/dynamics/SPH/PressureForceField.cpp | #include "./../../include/dynamics/SPH/PressureForceField.hpp"
PressureForceField::PressureForceField(const std::vector<ParticlePtr>& particles, float smoothingLength)
: smoothingLength(smoothingLength), kernel(smoothingLength), neighborSearch(smoothingLength){
for (const auto& particle : particles) {
... | ALGO | 0.99408 | 4.020359 |
5cc4ab0b-f488-4373-9abc-a937688837af | anranli2003/opencv_contrib | modules/superres/src/btv_l1_cuda.cpp | // S. Farsiu , D. Robinson, M. Elad, P. Milanfar. Fast and robust multiframe super resolution.
// Dennis Mitzel, Thomas Pock, Thomas Schoenemann, Daniel Cremers. Video Super Resolution using Duality Based TV-L1 Optical Flow.
#include "precomp.hpp"
using namespace cv;
using namespace cv::cuda;
using namespace cv::supe... | ALGO | 0.995175 | 4.993545 |
e0964658-fff8-424b-81ef-5759f6d3e813 | tkNimGni/LeetCoding | LeetCode041.cpp | class Solution {
public:
int firstMissingPositive(vector<int>& nums) {
int size = nums.size();
for (int i = 0; i < size; i++) {
const int num = nums[i];
if (num > 0 && num <= size && num != nums[num - 1]) {
int temp = num;
nums[i] = nums[num - ... | ALGO | 0.999932 | 5.331719 |
967d7d7a-2296-4c7b-8fbd-1134090ab2e1 | injeChoi/Problem_Solving | BOJ/BOJ_1600_말이되고픈원숭이.cpp | #include <bits/stdc++.h>
using namespace std;
int K, W, H;
int Map[201][201];
bool visited[201][201][31];
int hx[8] = {1, 2, 2, 1, -1, -2, -2, -1};
int hy[8] = {-2, -1, 1, 2, 2, 1, -1, -2};
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, -1, 1};
void init() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
... | ALGO | 0.999813 | 4.153677 |
798a66a1-53c7-4155-89de-4bd5154965e4 | DinoPy/AoC23 | day5/main.cpp | #include "../split_custom.h"
#include <fstream>
#include <iostream>
#include <sstream>
using std::cerr;
using std::fstream;
typedef vector<int> seeds;
struct map {
unsigned long destination;
unsigned long source;
unsigned long range;
};
struct mapping {
vector<map> sts; // seed to soil
vector<ma... | ALGO | 0.990009 | 4.278122 |
40b361a8-8b66-4d59-abe1-c9ec3efc07b3 | suehtaMFr/Library | Solutions/UVA/1210 - Sum of Consecutive Prime Numbers.cpp | #include <bits/stdc++.h>
using namespace std;
//Regular show
#define sz(x) ((int)x.size())
#define fin freopen ("a.txt","r",stdin);
#define fout freopen ("b.txt","w",stdout);
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
//rapadura é doce, mas não é mole não
#define ff first
#define ss... | ALGO | 0.99945 | 4.125254 |
6b234257-d8aa-4494-b9f7-f99a5479b95f | rajibdpi/leetcode-sol-mkdocs | main/solutions/0290. Word Pattern/0290.cpp | class Solution {
public:
bool wordPattern(string pattern, string str) {
const int n = pattern.length();
istringstream iss(str);
vector<int> charToIndex(128);
unordered_map<string, int> stringToIndex;
int i = 0;
for (string word; iss >> word; ++i) {
if (i == n) // Out of bound
... | ALGO | 0.999269 | 6.695127 |
4a36af87-6e1e-4784-8838-a123ddeaa270 | ymin431/CppProgramming | Prac_04/048_Std::accumulate/accumulate_func.cpp | #include <vector>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <numeric>
int main() {
int N; std::cin >> N;
std::vector<double> vec;
std::generate_n(std::back_inserter(vec), N, [] () { return *(std::istream_iterator<double>{std::cin}); });
double sum = accumulate(vec.begin(... | ALGO | 0.998131 | 4.811588 |
2972cbe0-cd7b-4a3a-87ca-c67188c5502f | mwy3055/Algorithm-codes | baekjoon/cpp/c++/1074.cpp | #include <iostream>
using namespace std;
int r, c, ans = 0;
bool flag = false;
bool isin(int i, int j, int y, int x, int siz)
{
return y <= i && i < y + siz && x <= j && j < x + siz;
}
void div(int y, int x, int size)
{
int src[4][2] = {{0, 0}, {0, 1}, {1, 0}, {1, 1}};
if (size == 2)
{
for (i... | ALGO | 0.998944 | 3.166762 |
7289c338-df31-484a-bb3c-6cdd32f7a72c | saifullah-talukder/Competitive_Programming | Codes/Codeforces/Accepted/CF_930_C.cpp | /*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*/
#include <bits/stdc++.h>
using namespace std; /*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace __gnu_cxx;*/
#define fi first
#define se second
#define ... | ALGO | 0.999969 | 4.105585 |
dc8cc621-e427-4fc9-9895-916b76b60af3 | Leon-LXA/blocks_robotics | block_robo/ConsoleApplicationx64/ConsoleApplication1/eigen3/unsupported/doc/examples/BVH_Example.cpp | #include <Eigen/StdVector>
#include <unsupported/Eigen/BVH>
#include <iostream>
using namespace Eigen;
typedef AlignedBox<double, 2> Box2d;
namespace Eigen {
Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point
}
struct PointPointMinimizer //how to compute squa... | ALGO | 0.999924 | 6.502348 |
f054d3a6-6cb5-4a9e-bf5e-f2618d3864a1 | SnowySparks/Algorithm_Solve | BackJoon_solved/그리디/28437_막대만들기.cpp | #include <iostream>
#include <algorithm>
#define f(a,b,c) for (int a=b ; a<= c ; a++)
using namespace std;
const int inf = 1e5+2;
int dp[inf];
int arr[inf];
int q[inf];
int main(void) {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int n; cin >> n;
f(i,1,n) {cin >> arr[i]; dp[arr[i]]++;}
in... | ALGO | 0.999919 | 3.386215 |
626c7a81-37cf-4d3b-afd3-28c5e59a681c | 400Luxury/DataStruct4learning | lab2/main.cpp | #include"blockchain.h"
#include<bits/stdc++.h>
using namespace std;
Input input_L[3000];
Output output_L[33000];
Transaction T[33000];
int main(){
char row[1000];
int valid_num = 0, trans_num = 0;
FILE *fi = fopen("./demo/inputs.csv","r");
if (fi!=NULL)
{
fseek(fi,58L,SEEK_SET);
i... | TOOL | 0.894002 | 3.577384 |
078d27e4-601d-4174-8e12-d331618d1245 | Crazm/My_Cpp_primer_Answer | cpp_primer/10.12.cpp | #include <iostream>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <algorithm>
#include <numeric>
using namespace std;
class Sales_data {
friend istream &read(istream &is, Sales_data &item); //Ԫ
friend ostream &print(ostream &os, const Sales_data &item);
friend Sales_data add(const S... | ALGO | 0.964447 | 4.387089 |
a9bb1524-b3c4-416a-a78a-6d5f1b91babb | fuad1502/skiena | chapter4/4-45/src/file-heap.cpp | #include "file-heap.hpp"
#include "gtest/gtest.h"
FileHeap::FileHeap(std::vector<std::string> fileNames) {
// Fill fileNodes
for (auto fileName : fileNames) {
fileNodes.push_back(new FileNode(fileName));
}
// Heapify
for (int i = fileNames.size() / 2; i >= 0; i--) {
bubbleDown(i);
}
}
std::string ... | TEST | 0.857644 | 5.580634 |
0ca52dba-2795-4efc-9f26-16e97aac6538 | gconant0/ORIS | map_orthology/graph.cpp | #include <iostream>
#include "graph.h"
#include "linked_list.h"
#include <queue>
using namespace::std;
template <class LIST_UNIT>
Linked_list<LIST_UNIT>::Linked_list(Linked_list *new_last, LIST_UNIT *new_element)
{
last=new_last;
this_element=new_element;
next=0;
}
template<class LIST_UNIT>
Linked_list<LIST_UNIT>... | ALGO | 0.896721 | 4.465211 |
da16a4ad-3e9b-4025-b835-2788ff28005c | kaluginpeter/Algorithms_and_structures_tasks | CodeWars/7kyu/Shift_Left.cpp | /*
You are given two strings. In a single move, you can choose any of them, and delete the first (i.e. leftmost) character.
For Example:
By applying a move to the string "where", the result is the string "here".
By applying a move to the string "a", the result is an empty string "".
Implement a function that calculat... | ALGO | 0.999967 | 5.993886 |
113ea2f7-833a-4b9a-8491-1e93b13c085e | AcaiHi/Sunny | 433B.cpp | // 433B.cpp
#include<iostream>
#include<algorithm>
using namespace std;
using ll = long long;
const int N = 1e5 + 5;
int t, n, i = 1;
int main(){
cin >> n;
ll q[n], p[n + 1][2] = {};
for (ll &it : q) cin >> it, p[i][1] = p[i - 1][1] + it, i++;
sort(q, q + n);
for (int i = 1; i <= n; i++){
p[i][0] = p[i - 1][0] +... | ALGO | 0.999916 | 4.156823 |
648b08bd-a8fb-4ea1-8eb9-9b27f3cc2322 | arpitsangwan/Friendly-contests | 03 Third/115. Distinct Subsequences.cpp | //https://leetcode.com/problems/distinct-subsequences/
class Solution {
public:
int count(string s,string t,int si,int ti,int**dp){
if(ti==t.length()){return 1;}
if(si==s.length()){return 0;}
if(dp[si][ti]!=-1){return dp[si][ti];}
if(s[si]==t[ti]){
dp[si][ti]= count(... | ALGO | 0.999987 | 6.393884 |
589cc8ce-15ec-4271-9979-3c3e60d09805 | Ehsan-aghapour/ARM-CO-UP | src/runtime/NEON/functions/NEMeanStdDev.cpp | #include "arm_compute/runtime/NEON/functions/NEMeanStdDev.h"
#include "arm_compute/runtime/NEON/NEScheduler.h"
#include "src/core/NEON/kernels/NEFillBorderKernel.h"
#include "src/core/NEON/kernels/NEMeanStdDevKernel.h"
namespace arm_compute
{
NEMeanStdDev::~NEMeanStdDev() = default;
NEMeanStdDev::NEMeanStdDev()
... | ALGO | 0.970332 | 6.864746 |
b0c5c097-38e8-410c-a433-5eb789e26c51 | Palmkonde/CompetitiveProgramming | USACO/Subsequences Summing to Sevens_Return_to_Problem_List/Subsequences_Summing_to_Sevens_Return_to_Problem_List.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 5e4 + 5;
int n;
ll arr[N], pf[N];
int main() {
ifstream fin("div7.in");
ofstream fout("div7.out");
fin >> n;
for(int i=1; i<=n; i++) {
fin >> arr[i];
pf[i] = (pf[i-1] + arr[i])%7;
}
... | ALGO | 0.999925 | 3.891826 |
2b5f6d94-6be2-4ba0-9a72-6c05a45edc0c | sarvex/leetcode-zsh | solution/2100-2199/2186.Minimum Number of Steps to Make Two Strings Anagram II/Solution.cpp | class Solution {
public:
int minSteps(string s, string t) {
vector<int> cnt(26);
for (char& c : s) ++cnt[c - 'a'];
for (char& c : t) --cnt[c - 'a'];
int ans = 0;
for (int& v : cnt) ans += abs(v);
return ans;
}
}; | ALGO | 0.999995 | 5.973835 |
baaf3443-9453-4f8f-831e-c7efe0c72b06 | vasav-prashar/DSA-Leetcode | 20. Binary Tree to DLL - GFG/20.-binary-tree-to-dll.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
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.999595 | 7.134976 |
ecd5a6a9-4944-45c9-a3de-a964d09e866a | priyanshukoshta5/MOB100-Leetcode-GFG | 0402-remove-k-digits/0402-remove-k-digits.cpp | class Solution {
public:
string removeKdigits(string num, int k) {
stack<char> s;
int i = 0;
while(i < num.length())
{
while(!s.empty() && k > 0 && s.top() > num[i])
{
s.pop();
k--;
}
s.push(num[i]);
... | ALGO | 0.99999 | 6.796951 |
d36df29a-fd0b-4981-87bd-b06c769a4b30 | shubhamarman13/80-Days-Coding-challenge-DSA-by-Abdul-Bari-Sir | Passing_structure_as_parameter_in_function_callby_reference.cpp | //call by reference in the function of structre
// passing entire structure as parameter in the function and in the end it returing the value as claculation of Area as length*breath;
// it is an example of call reference in the function
#include<iostream>
using namespace std;
struct Rectangle
{
int lenght;... | TOOL | 0.943089 | 4.05309 |
e65bb0e6-646f-4d23-b529-e60492ed854f | vinhuchi/cp-chap-may-thang-nhoc | VNOJ/Bedao/bedao_m21/a.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int T;
cin >> T;
while (T--){
int A,B,X,Y;
cin >> A >> B >> X >> Y;
}
} | ALGO | 0.998714 | 3.22668 |
f43080f2-7d8e-4676-8f28-d68169aacf75 | haderech/libcxx | test/std/numerics/rand/rand.dist/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp | // <random>
// template<class RealType = double>
// class student_t_distribution
// template<class _URNG> result_type operator()(_URNG& g);
#include <random>
#include <cassert>
#include <vector>
#include <numeric>
#include "test_macros.h"
template <class T>
inline
T
sqr(T x)
{
return x * x;
}
int main(int, ch... | TEST | 0.895329 | 4.546034 |
f4827f43-2300-4cbb-b9ca-54cffda80716 | SidMox120897/EstructuraDatosCpp | Ordenamiento/Lib/selectionsort.cpp | #include "selectionsort.h"
#ifndef SELECTIONSORT_CPP
#define SELECTIONSORT_CPP
template <typename any>
selectionsort<any>::selectionsort(/* args */)
{
}
template <typename any>
selectionsort<any>::~selectionsort()
{
}
template <typename any>
void selectionsort<any>::sortVector(std::vector<any>& Arr) {
int n = A... | ALGO | 0.996194 | 4.685536 |
a6823a55-efa2-4195-b4ea-e2881868fc82 | Dominiklt84/Algoritmai_ir_duomenu_strukturos | 4_kontrolinis_darbas_1/main.cpp | //Sukurti dinamini vienkrypti sarasa, realizuojant elemento iterpimo, pasalinimo,
//spausdinimo bei paieskos funkcijas. Perkelti to saraso visus elementus i AVL medi.
//Atspausdinti visus AVL medzio elementus.
#include <iostream>
using namespace std;
struct sarasas {
int duom;
sarasas* kitas;
};
struct Medis... | ALGO | 0.999045 | 4.583459 |
088ea630-54b9-4ac2-92fa-5b90d4a6f2bb | ayushman7899poddar/DSA-in-Visual-Studio-code | Linled_List/file.cpp | #include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node *next;
};
Node* top = NULL;
void push(int value) {
struct Node *newNode;
newNode = (struct Node *)malloc(sizeof(struct Node));
newNode->data = value;
if (top == NULL) {
newNo... | ALGO | 0.999799 | 4.628827 |
7a5b5786-397a-4d44-9500-35b2b365792e | fridec13/codetree | 241111/G or H 3/G-or-H-3.cpp | #include <iostream>
#include <algorithm>
using namespace std;
char alpha[10000];
int main() {
// 여기에 코드를 작성해주세요.
int n, k;
cin >> n >> k;
// 0 5 = k == 5;
for (int i = 0; i < n; i++)
{
int idx;
char gliph;
cin >> idx >> gliph;
alpha[idx] = gliph;
}
i... | ALGO | 0.999077 | 3.561145 |
79a1b42e-2c33-434e-a9e9-6004282b8284 | S4adShafiq/DSA-CPP | c++/Linked List/DoublyLLSwapNodes.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node *prev=NULL;
Node* next=NULL;
Node(int data){
this->data=data;
this->prev=NULL;
this->next=NULL;
}
};
void InsertAtHead(Node *&head,int data){
Node *n=new Node (data);
n->next=head;
if(he... | ALGO | 0.999996 | 4.721523 |
8dbcf2f7-7e53-4fbf-96a8-9187bf3a3534 | thentnucyborg/CyborgRobot | src/navigation/amcl/src/amcl/sensors/amcl_laser.cpp | ///////////////////////////////////////////////////////////////////////////
//
// Desc: AMCL laser routines
// Author: Andrew Howard
// Date: 6 Feb 2003
// CVS: $Id: amcl_laser.cc 7057 2008-10-02 00:44:06Z gbiggs $
//
///////////////////////////////////////////////////////////////////////////
#include <sys/types.h> //... | ALGO | 0.985552 | 5.96144 |
6c99b311-bb18-4e93-a639-ee73b004f282 | zzq-beyond/pcl | features/vfh.cpp | #include <pcl/features/normal_3d.h>
#include <pcl/features/vfh.h>
#include <pcl/io/pcd_io.h>
int main(){
//定义
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal>());
pcl::search::KdTree<pcl::PointXY... | ALGO | 0.95058 | 4.12922 |
1fe14290-d844-44b6-9a42-551f3686aefc | lemoneid/1.do-exercises | Algorithm/LeetCode/167.两数之和-ii-输入有序数组.cpp | /*
* @lc app=leetcode.cn id=167 lang=cpp
*
* [167] 两数之和 II - 输入有序数组
*/
// @lc code=start
class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
int l = 0, r = numbers.size() - 1;
while (l < r) {
if (numbers[l] + numbers[r] == target) break;
if (n... | ALGO | 0.999959 | 6.56166 |
27ee8d4e-21e2-460a-9b36-cfbf3ec60d82 | abhi5404/cpp-DSA | 2D ARRAY/DIAGONAL_SUM.CPP | #include<iostream>
using namespace std;
void diagonalSum(int mat[][4], int n) {
int sum = 0;
for(int i = 0; i < n; i++) { // rows
for(int j = 0; j < n; j++) { // cols
if(i == j) {
sum += mat[i][j]; // Primary diagonal
}
else if(j == n - i - 1) {
... | ALGO | 0.999879 | 5.206041 |
3fd33351-77c6-46ef-b5cc-fab4ef0b665d | Ryexocious/problemsolving | iutindividual24s(5)/b1+2.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef map<string,int> mp;
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;
#define all(x) (x).begin(), (x).end()
#define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pob... | ALGO | 0.999943 | 3.426039 |
a49d2ba5-1006-4d2a-803e-effe49b1a466 | kiwibrowser/src | buildtools/third_party/libc++/trunk/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_comp.pass.cpp | // <algorithm>
// template<InputIterator InIter1, InputIterator InIter2, typename OutIter,
// CopyConstructible Compare>
// requires OutputIterator<OutIter, InIter1::reference>
// && OutputIterator<OutIter, InIter2::reference>
// && Predicate<Compare, InIter1::value_type, InIter2::value_type... | TEST | 0.960562 | 6.906991 |
02ab0051-22ce-43a5-a2ba-302188df32b4 | saurabhkumar2001/CPP_PRACTICE | RCPL/DAY 12/array2.cpp | #include<iostream>
#include<array>
#include<algorithm>
using namespace std;
int main(){
array<int,5> arr = {67,33,12,444,55};
cout<<"Value before sort : "<<endl;
for (auto i : arr)
{
cout<<i<<" ";
}
sort(arr.begin(),arr.end());
cout<<"\n Value after sort: "<<endl;
for (auto i : ar... | ALGO | 0.998144 | 3.936064 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.