uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f2b8f42f-24e6-4ed8-9c79-e3592d4d729d | raincross7/code-similarity | codes/train_code/problem257/problem257_143.cpp | #include<bits/stdc++.h>
#define pb emplace_back
#define ll long long
#define mp make_pair
#define PI acos(-1)
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll i,j,k,x,y,z,m,n,t,a,b,c,l,r;
cin>>n>>m>>k;
string s[8];
for(i=0; i<n; i++)
cin... | ALGO | 0.999972 | 3.923205 |
81dba4df-9a48-4da5-905c-9b5f80e98aeb | sunilkumarmaurya786693/solution-leedcode-codechef-codeforces-gfg-interviewbits-hackerEarth-HackerRank | leetcode/dynamic programming/save.cpp | #include <bits/stdc++.h>
#define SPEED ios::sync_with_stdio(false);cin.tie(0); cout.tie(0);
#define pii pair<int,int>
#define inf_neg -100000000000000ll
using namespace std;
typedef long long int ll;
ll m=1000000007;
int solver(vector<int>&arr)
{
}
int main()
{
SPEED;
#ifndef ONLINE_JUDGE
freopen("i.txt"... | ALGO | 0.999948 | 4.088774 |
7bc9e3fe-c01e-497e-af8c-dc0f17c47f07 | chaharnishant11/InterviewBit-and-GFG | Recursion and Backtracking/sudoku.cpp | bool checkRow(int board[][9],int row,int n){
for(int j=0;j<9;j++){
if(board[row][j]==n)
return false;
}
return true;
}
bool checkCol(int board[][9],int col,int n){
for(int j=0;j<9;j++){
if(board[j][col]==n)
return false;
}
return true;
}
bool checkBox(in... | ALGO | 0.999506 | 5.964665 |
429d0dc5-60af-4210-816b-27335e3f0754 | lyx3911/srtp | src/dual_ur5_arm-master/raw_totg/src/Test.cpp | #include <cstdlib>
#include <list>
#include <Eigen/Core>
#include "Trajectory.h"
int numTests = 0;
int numTestsFailed = 0;
void test(std::string name, std::list<Eigen::VectorXd> waypoints, double maxDeviation, const Eigen::VectorXd& maxVelocities, const Eigen::VectorXd& maxAccelerations, double timeStep) {
Trajector... | TEST | 0.882227 | 6.588347 |
7b9cd1ee-0a15-4130-b7a7-70c5ef623507 | ZYLZhuPP/OI | Luogu/P5345.cpp | #include<bits/stdc++.h>
using namespace std;
#define Fail { puts("Impossible"); exit(0); }
#define For(i, l, r) for (int i = (l); i <= (r); ++i)
typedef long long ll;
const int N = 1e3 + 5, inf = 1e9;
int Mo;
inline int ml(const int &x, const int &y) { return 1ll * x * y % Mo; }
inline void mul(int &x, const int &y) {... | ALGO | 0.999954 | 3.499318 |
3f2826ac-d547-4854-a4da-f2b168306b45 | Jyotika999/Competitive-Programming-Preparation | DAILY CODEFORCES/1227B.cpp |
// Problem: B. Box
// Contest: Codeforces - Technocup 2020 - Elimination Round 3
// URL: https://codeforces.com/problemset/problem/1227/B
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
... | ALGO | 0.999844 | 4.876374 |
e7e77616-a891-4680-bab7-afbcae64e893 | sayan112/Leetcode_Sayan | Largest subarray with 0 sum - GFG/largest-subarray-with-0-sum.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
/*You are required to complete this function*/
class Solution{
public:
int maxLen(vector<int>&A, int n)
{
// Your code here
unordered_map<int,int>mp;
int sum=0... | ALGO | 0.999862 | 6.185611 |
86f13609-294e-44b6-bf35-870a5e92d627 | amallia/SIGIR2016 | LB_Single_Ideal_Code/QPtrec06/hash.cpp | /* hash.cpp */
#include <stdio.h>
#include <stdlib.h>
#include "hash.h"
/*********************************************************/
/* implementation of hash tables based on double hashing */
/*********************************************************/
/****************************************/
/* routines implementi... | ALGO | 0.998903 | 5.285792 |
2a73a679-ede8-4449-9a2a-9849d7675f69 | asifcsai/Competitive-Programming-Problem-Solution | NSUps prebootcamp/AV.cpp | #include<iostream>
int main(void)
{
int t = 0, a = 0, b = 0, temp = 0, digit = 1, count = 0;
std::cin>>t;
for(int i = 0; i < t; i++)
{
std::cin>>a>>b;
for(; a <= b; a++)
{
temp = a;
while(temp != 0)
{
digit = temp % 10;
temp = temp / 10;
... | ALGO | 0.999731 | 4.429653 |
bc50f267-31c2-44fe-881e-72857f99d0ee | EvgenijGod/HSE | c++/contest7/test.cpp | #include <iostream>
#include <typeinfo>
using namespace std;
template<typename T>
class Matrix {
private:
T **data;
size_t rows, columns;
public:
Matrix(size_t m, size_t n) : rows(m), columns(n) {
data = new T *[rows];
size_t i = 0;
try {
for (; i != rows; ++i)
... | TOOL | 0.983845 | 4.207336 |
f45f7c70-f644-45e9-a6a9-6044d297cbdd | swex/boost_ci | libs/spirit/classic/example/fundamental/number_list.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This sample demontrates a parser for a comma separated list of numbers
// This is discussed in the "Quick Start" chapter in the Spirit User's Guide.
//
// [ JDG 5/10/2002 ]
//
///////////////////////////////////////////////////////... | TOOL | 0.947883 | 7.075739 |
8d7804c3-c52e-4ad4-a213-76ba792b01b4 | kacper0276/Programming_Challenges | PTCLTZ.cpp | #include <iostream>
using namespace std;
int p;
int c(int n,int p);
int main()
{
int ile,n,wynik;
cin>>ile;
while(ile--)
{
p =0;
cin>>n;
wynik=c(n,p);
cout<<wynik<<endl;;
}
return 0;
}
int c(int n,int p)
{
if(n==1)return p;
else if(n%2==0)
{
... | ALGO | 0.999934 | 3.922303 |
ad0f07c7-29c9-4e99-baba-c22f068853c9 | ishandutta2007/codeforces | alvingogo/normal/1672/C.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define AquA cin.tie(0);ios_base::sync_with_stdio(0);
#define fs first
#define sc second
#define cd complex<double>
#define p_q priority_queue
using namespace std;
int main(){
AquA;
int t;
cin >> t;
while(t--){
int n;
cin >> n;
... | ALGO | 0.999935 | 4.187418 |
267e6f88-adb6-4948-9077-0b55d5d120db | ishandutta2007/codeforces | heart_blue/normal/1154/G.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999984 | 3.345773 |
7af3148f-a314-4e20-9d6b-d148569fc7f6 | Abd44Arfat/respnisve_dashboard | 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 |
836d048c-9ca8-4a24-a645-7371b4ba2f84 | BinomialSheep/CompetitiveCpp | AtcoderContest/AHC013/04ForTest.cpp | #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 namespace chrono;
using ll = long long;
using vi = vector<in... | ALGO | 0.999728 | 4.425903 |
ee15ee77-1025-4f75-b199-29405353aaee | pg2005230/GarciaPaul_CIS5_44187 | Hmwk/Assignment_1/Gaddis_8th_Chap2_Prob16_DiamondPattern/main.cpp | /*
File: main.cpp
Author: Paul Garcia
Created on February 28, 2017, 1:50 AM
Purpose: Program which displays a diamond made of "*"
*/
//System Libraries
#include <iostream>
using namespace std;
//User Libraries
//Global Constants
//Such as PI, Vc, -> Math/Science values
//as well as conversions from syst... | ALGO | 0.969124 | 4.515923 |
03406db9-cd79-4fd9-a5bc-6bb58acb102f | ishandutta2007/codeforces | natofp/normal/1738/A.cpp | #include <bits/stdc++.h>
#include <random>
#define ll long long int
#define pb push_back
#define st first
#define nd second
#define pii pair<int,int>
#define mp make_pair
#define pll pair<long long,long long>
#define ld long double
#define ull unsigned long long
#define mt make_tuple
using namespace std;
const int na... | ALGO | 0.999997 | 4.07798 |
1e6cbc86-e54e-4c7e-b431-7083f9d7219b | dareDEVil-aynur/COMP.CS.110 | examples/04/waterdrop_game_v1/square.cpp | #include "square.hh"
#include <cstdlib>
#include <iostream>
Square::Square(int x, int y, int drops, Board* board ):
x_(x), y_(y), drops_(drops), board_(board) {
// Square has been initialized with too much water,
// it pops before game starts :)
if( drops_ > MAX_CAPACITY ) {
pop();
}
}
Square::~... | TOOL | 0.876775 | 5.838976 |
75e50684-83b8-48a2-af62-38527e885e93 | PranshuSrivastava/Data-Structures-And-Algorithms | sourav_solution_problem_onr.cpp | #include <vector>
#include <string>
#include <sstream>
#include <unordered_map>
#include <iostream>
using namespace std;
string res ="";
int main(){
string language ;
string word;
getline(cin, language);
getline(cin, word);
int size = language.size();
for(int i=0; i<size; i++){
if(isalpha(language[i]))... | ALGO | 0.99983 | 3.986254 |
1b6c7a3f-5c9f-430f-9162-b981a75a0a4d | sanket9673/CP | LC_860/main.cpp | #include <iostream>
#include <vector>
using namespace std ;
class Solution {
public:
bool lemonadeChange(vector<int>& bills) {
if (bills[0] > 5) {
return false ;
}
int count5 = 0 ;
int count10 = 0;
for (int i = 0; i < bills.size(); i++) {
if ... | ALGO | 0.998364 | 5.42844 |
48ae2d5a-76cd-42c2-a3a0-57ee3a465dbf | Fred159/CarND-Term3-Path-Planning-Project | src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
VectorXf v(2);
MatrixXf m(2,2), n(2,2);
v << -1,
2;
m << 1,-2,
-3,4;
cout << "v.squaredNorm() = " << v.squaredNorm() << endl;
cout << "v.norm() = " << v.norm() << endl;
cout << "v.lpN... | ALGO | 0.991327 | 4.034017 |
2f6120b9-5a32-4baf-8fe5-98d5b817a3f2 | thegamer1907/Code_Analysis | contest/1542501319.cpp | #include <bits/stdc++.h>
#define ll long long
const int INF = 1e9;
const int N = 1e5 + 10;
const int K = 25;
using namespace std;
ll n, k, d[N];
ll f[K][N], l = 1, r;
ll num[N], sum;
bool used[N];
void rev(int x) {
if(used[x] ^= 1) sum += num[d[x]]++;
else sum -= --num[d[x]];
}
void solve(int L, i... | ALGO | 0.99995 | 3.842998 |
9d5c5137-a6e0-4a66-b798-ff0daee71f11 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Gemma/top0-100/sum-of-special-evenly-spaced-elements-in-array-Solution.solve/177832_nan.cpp | walk_string(fz_context *ctx, int uni, int remove, editable_str *str)
{
int rune;
if (str->utf8 == NULL)
return;
do
{
char *s = &str->utf8[str->pos];
size_t len;
int n = fz_chartorune(&rune, s);
if (rune == uni)
{
/* Match. Skip over that one. */
str->pos += n... | ALGO | 0.999592 | 5.544847 |
ea5fecd0-4d16-4d14-9f27-e4913f6c9f98 | vladIev/AOC24 | src/day5/day5.m.cpp | #include "day5_1.hpp"
#include "day5_2.hpp"
#include "day5_input.hpp"
#include <filesystem>
#include <iostream>
#include <iterator>
#include <ranges>
int main()
{
const auto [rules, requests] = parseInput("/home/vladlev/projects/AOC24/inputs/day5.txt");
d51::RulesBook book(rules);
std::cout << d51::validateRequest... | ALGO | 0.987881 | 5.631027 |
e65e4eb7-632f-4968-b58a-af5ad9e71d65 | Przemol/seqplots_electron | app/Rmac/Versions/3.4/Resources/library/Rcpp/examples/ConvolveBenchmarks/convolve9_cpp.cpp | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
// this version expands convolve8_cpp by making Vec mimic the structure of
// NumericVector. It peforms well, so this is is not the structure of
// NumericVector that is the problem. So what is it then ?
//
// could it be because NumericVector is... | ALGO | 0.994644 | 6.450036 |
5c692b02-ac54-41dd-bee7-6e5d05c257c6 | TwTravel/OpenGlBooks | 游戏编程精粹/游戏编程精粹:G898.2 T386/G898.2 T386/Source Code/06 Audio/06 Burk/src/Circuit_RainPlops.cpp | #include <math.h>
#include "ggsynth.h"
#include "Circuit_RainPlops.h"
/**
* Circuit_RainPlopss uses a RedNoise modulated ringing LowpassFIlter
*
* @author (C) 2002 Phil Burk, SoftSynth.com, All Rights Reserved
*/
Circuit_RainPlops::Circuit_RainPlops()
{
modRate = 9.9f;
modDepth = 90.0f;
frequency = 25... | TOOL | 0.943872 | 4.403083 |
bc855f20-0abc-47a8-8182-40f9c7a19ddd | VanirAOSP/external_skia | src/pathops/SkDLineIntersection.cpp | #include "SkIntersections.h"
#include "SkPathOpsLine.h"
/* Determine the intersection point of two lines. This assumes the lines are not parallel,
and that that the lines are infinite.
From http://en.wikipedia.org/wiki/Line-line_intersection
*/
SkDPoint SkIntersections::Line(const SkDLine& a, const SkDLine& b) ... | ALGO | 0.998706 | 5.890026 |
00cd8e05-672e-411a-8509-ca52585374dc | altafahmad623/Advanced-Numerical-Techniques | pdeADI2.cpp | #include <bits/stdc++.h>
using namespace std;
#define lli long long
#define PI 3.14159265358
// \frac{ \partial u}{\partial t} = \nu [ \frac{ \partial^2 u}{\partial x^2} + \frac{ \partial^2 u}{\partial y^2}] \; , 0 < x, y < 1;
// \nu = 1, u(x,y, 0 ) = sin (pi * x )* sin (pi * y ) \And u(t, (1&0) , y) = 0 , u ( t, ... | ALGO | 0.999948 | 3.294746 |
02bf1c39-4232-40d3-89dc-01e056632b60 | dipzza/ETSIIT-FP | Ejercicios/Suma de factoriales.cpp | #include <iostream>
using namespace std;
int main()
{
long long suma = 0, f = 1;
int n, i, j;
cout << "Introduce el valor de n" << endl;
cin >> n;
for(j = 1; j <= n; j++)
{
/*
for (i = 2; i <= j; i++)
{
f = f * i;
}
suma = suma + f;
f = 1;
*/
f = f * j;
suma = suma + f;
}
... | ALGO | 0.999858 | 4.221487 |
9175d2e7-cb48-4f0d-b97c-569fe8af72ed | Kennyarlexy/Algorithms | merge_sort/marge_sort.cpp | #include <iostream>
#include <vector>
#include <utility>
#include <tuple>
using namespace std;
void print(const vector<int> &array) {
for (auto& data : array) {
cout << data << " ";
}
cout << "\n";
}
pair<vector<int>, vector<int>> split(const vector<int> &array) {
int mid = (array.size() + 1) ... | ALGO | 0.999859 | 5.71235 |
85544eb7-68e4-4d3f-be43-e32b37bc4b65 | FlutterBaba/FlutterBaba-Flutter---Beginners-Course-3.4 | 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.998693 | 6.797273 |
73522693-6db0-4a94-bf4d-3322b9708083 | ry0u/SRM | SRM501/FoxPlayingGame.cpp | // BEGIN CUT HERE
// END CUT HERE
#line 5 "FoxPlayingGame.cpp"
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <set>
#include <map>
#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
class ... | ALGO | 0.997611 | 3.812625 |
124f81d6-b0d7-44b4-a94b-9008a786418d | mahim007/Online-Judge | codeforces/C. Hexadecimal's Numbers.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
vector<ll>V,P;
map<ll,ll>M;
void calc(){
ll sz=V.size();
if(sz>=1 && sz<=10){
ll z=0;
for(ll i=0;i<sz;i++){
z=z*10+V[i];
}
M[z]=1;
}
if(sz==10) return;
V.push_back(0);
calc();
... | ALGO | 0.999497 | 4.003308 |
909ca577-4645-4801-bafb-612853171e45 | ishandutta2007/codeforces | l7-56/normal/1696/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <pii> vp;
#define fir first
#define sec second
template <typename __Tp> void read(__Tp &x) {
int f = x = 0; char ch = getchar();
for (; !isdigit(ch); ch = getchar... | ALGO | 0.999966 | 4.139892 |
b375d5c3-fe80-489d-ab47-72c9095af489 | xjs-js/leetcode | 0079.Word.Search/sol.cpp | /**
* @date: 2021-04-18 23:09 Sun.
*/
class Solution {
private:
bool _result;
public:
void dfs(vector<vector<char>>& board, string word, int cur, int i, int j, bool** isVisit) {
if (_result == true) {
return ;
} else {
if (cur == word.size()) {
_result ... | ALGO | 0.999846 | 6.089743 |
3d5202bc-48f5-4c16-b546-791ce1effead | 4f0m4/ComputerScience | ComputerGraphics/Line-Drawing-Using-DDA/p2.cpp | //4f0m4
//JKKNIU
#include <graphics.h>
#include <iostream>
#include <math.h> // For abs() and round()
using namespace std;
int main() {
int gd = DETECT, gm;
float x1, y1, x2, y2, dx, dy, steps, xIncrement, yIncrement, x, y;
// Initialize graphics mode
initgraph(&gd, &gm, "");
cout << "Enter th... | ALGO | 0.999265 | 3.677103 |
24bde98a-f5bc-4dd3-9f38-afee1efef7de | vishwanath-ek/ProgrammingPractice | C++/trickyPrograms/Trees/levelOrderTraversalRecursive.cpp | #include <iostream>
#include "TreeNode.h"
using std::cout; using std::endl;
void levelOrderTraversePrint(Node *node, size_t level){
if(!node){
return;
}
if (level == 1){
cout << node->data << " ";
} else {
levelOrderTraversePrint(node->left, level - 1);
levelOrderTraver... | ALGO | 0.998439 | 4.988071 |
23282f16-fac6-41b6-aeac-b0b6d8c81c5f | shell-fire/shellfire-vpn.android | app/src/main/cpp/asio/asio/src/examples/cpp11/executors/priority_scheduler.cpp | #include <asio/dispatch.hpp>
#include <asio/execution_context.hpp>
#include <condition_variable>
#include <iostream>
#include <memory>
#include <mutex>
#include <queue>
using asio::dispatch;
using asio::execution_context;
namespace execution = asio::execution;
class priority_scheduler : public execution_context
{
pub... | TOOL | 0.892111 | 6.713433 |
6186308a-30f6-4405-ae3c-03d1e89d79ea | Vaibhavi1707/Leetcode | 95.unique-binary-search-trees-ii.cpp | /*
* @lc app=leetcode id=95 lang=cpp
*
* [95] Unique Binary Search Trees II
*/
// @lc code=start
/**
* 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)... | ALGO | 0.999855 | 7.291101 |
c1b6a4e9-e1a4-49e6-99e6-d5a3b9f45a99 | tianbiandeshenghuo/OI-Code | CodeForces/cf1836/A_Destroyer.cpp | #include<bits/stdc++.h>
using namespace std;
int t, n;
void Solve(int n){
int a[105] = {0};
//cin >> n;
int maxx = -1;
for (int i = 1, x; i <= n; i++){
cin >> x;
a[x]++;
maxx = max(maxx, x);
}
if ((a[0] == 0) || (maxx == 1 && a[1] > a[0])){
cout << "NO\n";
return ;
}
for (int i = 0;... | ALGO | 0.999841 | 4.477315 |
468f7ef1-3d36-42cf-95ce-40df950fa7a2 | sourabhossain/codeforces | A/158.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int T, n;
scanf("%d%d", &T, &n);
vector <int> v;
int Max;
for(int i = 0; i < T; ++i) {
int t;
scanf("%d", &t);
v.push_back(t);
if(i + 1 == n) {
Max = t;
}
}
int c = 0;
fo... | ALGO | 0.99977 | 3.779084 |
45dea499-8da9-494e-8102-530276eb22f6 | Advanced-Programming2025/AP2025supplementary | code/lesson07/stltest15.cpp | #include <algorithm>
#include <iostream>
#include <list>
#include <vector>
using namespace std;
void print(int a) { cout << a << endl; }
int main() {
vector<int> v1(3);
list<int> l1;
v1[0] = 2;
v1[1] = 1;
v1[2] = 7;
l1.push_back(5);
l1.push_back(3);
l1.push_back(9);
for_each(v1.begin(), v1.end(), p... | TOOL | 0.957502 | 3.868152 |
cac6d6d4-3110-49b3-af08-3a774c431f0d | LiuLiC/LeetCodePractice | algorithm/237.delete-node-in-a-linked-list.cpp | /*
* @lc app=leetcode id=237 lang=cpp
*
* [237] Delete Node in a Linked List
*
* https://leetcode.com/problems/delete-node-in-a-linked-list/description/
*
* algorithms
* Easy (51.68%)
* Total Accepted: 261.4K
* Total Submissions: 505.9K
* Testcase Example: '[4,5,1,9]\n5'
*
* Write a function to delete ... | ALGO | 0.999947 | 6.489206 |
c918a2c7-2adb-45ad-97e6-3bd4b3226405 | leikang123/LLVM-NMX | llvm/lib/CodeGen/MachineTraceMetrics.cpp | #include "llvm/CodeGen/MachineTraceMetrics.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SparseSet.h"
#include "llvm/CodeGen/MachineBasicBlock.... | TOOL | 0.992816 | 7.906433 |
957d4790-9857-42d1-a529-adcde2c3aa7e | wzao1515/R2S | ra2sql/ra2sql/include/boost_1_55_0/libs/multiprecision/example/integer_examples.cpp | #include <boost/multiprecision/cpp_int.hpp>
#include <iostream>
#include <iomanip>
#include <vector>
//[FAC1
/*`
In this simple example, we'll write a routine to print out all of the factorials
which will fit into a 128-bit integer. At the end of the routine we do some
fancy iostream formatting of the results:
*/
/*... | TOOL | 0.979752 | 5.523633 |
3c37e2b5-c907-4690-b4c1-342290afe5b6 | AngryWalrus/C---examples | c++/practice/dynamic_variables.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
int *p1;
int x;
p1 = new int;
x = 5;
*p1 = 5;
cout<<"x is: "<<x<<endl;
cout<<"the address of x is: "<<&x<<endl;
cout<<"*p1 is: "<<*p1<<endl;
cout<<"the address of p1 is: "<<p1<<endl;
x=7;
int *p2;
p2 = new int;
int *p3;
p3 = new int;
p3=p1;
dele... | ALGO | 0.990856 | 3.378331 |
dee3d123-25ce-418d-814e-91d980545fcd | Morpa/flutter-linktr.ee | 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 |
b84b05a7-b1a6-414e-973c-c2ecca477a09 | SsalHub/baekjoon | solved/25304/main.cpp | #include <iostream>
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(0);
int X, N, a, b;
std::cin >> X >> N;
while (N--)
{
std::cin >> a >> b;
X -= a * b;
}
if (X)
std::cout << "No" << "\n";
else
std::cout << "Yes" << "\n";
return ... | ALGO | 0.999894 | 3.979155 |
fb80a7f4-fc04-428e-95e0-b9da932d053a | ashib11/Sub_Zero_ | B_XOR_Average.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
#define ll long long
#define pi acos(-1.0)
#define ull unsigned long long
#define endl "\n"
#define all(v) v.begin(), v.end()
#define allr(v) v.r... | ALGO | 0.999867 | 4.159566 |
0f4057a1-e66e-49b7-a290-8bd0f2d19cd6 | TURING132/Game | leetcode/n0205-Isomorphic_Strings.cpp | #include <vector>
#include <iostream>
#include <unordered_map>
using namespace std;
class Solution {
public:
bool isIsomorphic(string s, string t) {
unordered_map<char, char> sMaps;
unordered_map<char, char> tMaps;
if (s.size() != t.size()) return false;
for(int i = 0; i < s.size()... | ALGO | 0.999951 | 6.081127 |
3912aee7-3a22-4c25-83e3-aa44ea9a7d29 | rohan920git/DSA-C- | SearchInRotatedarray.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int s = 0 ;
int e = nums.size()-1;
int mid = s+(e-s)/2;
while ( s <= e){
if(nums[mid] == target){
return mid;
}
if(nums[s]<=nums[mid])
{
... | ALGO | 0.999953 | 6.210693 |
6b8468f4-47f0-45d8-b125-5b7bd7c29d63 | AlbinStenqvist/Programmering-1 | Bonus4/main.cpp | #include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main() {
float tal1, tal2, summa;
cout << "Ange ett tal: ";
cin >> tal1;
cout << "Ange ett till tal: ";
cin >> tal2;
summa = tal1 - tal2;
if (summa == 0) {
... | TOOL | 0.966681 | 3.476732 |
da01c93a-4f26-47cb-935e-2719c275258e | emonislive/codeforce-problems | c++/1742B.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define endl '\n'
#define ll long long
void solve(ll n) {
vector <ll> v(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
}
// sorting the vector to check the duplicates values in ordered form
sort(v.begin(), v.end... | ALGO | 0.999913 | 4.446822 |
10419f82-5e55-4207-a89f-a9c450f1d0d2 | AnsulChauhan/DSA | STL/stll.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> a;
int h;
for (int i = 0; i < 5; i++)
{
cout << "Enter element in vector " << i << " :" << endl;
cin >> h;
a.push_back(h);
}
for (int i = 0; i < 5; i++)
{
cout << a.at(i) <... | ALGO | 0.935325 | 3.172143 |
dbbb2767-42aa-44ad-9cc1-a6ae17615193 | ashhek/Leetcode_solution | 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlin... | class Solution {
public:
bool canBeEqual(string s1, string s2) {
string t = s1;
for(int i=0; i<2; ++i){
if(t[i] != s1[i]){
swap(t[i], t[i+2]);
}
}
if(t==s2) return true;
for(int i=0; i<2; ++i){
if(s2[i] != s1[i... | ALGO | 0.999959 | 5.530827 |
bd104b5e-205c-474b-a05b-2ef6691a2b41 | kobe24o/LeetCode | algorithm/LCP09.cpp | class Solution {
public:
int minJump(vector<int>& jump) {
int i, n = jump.size(), t = 0, size, tp, prevPos = 0;
vector<bool> vis(n,false);
vis[0] = true;
queue<int> q;
q.push(0);
while(!q.empty())
{
size = q.size();
t++;
whi... | ALGO | 0.999996 | 5.073052 |
3193a4cb-f2ed-4f08-86d6-b0a6da798278 | miyajiro/competitive_programming | atcoder/arc108/c/c.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
#define fr first
#define sc second
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i <= (n); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rrep1(i, n) for (int i = (n); i >= 1; --i)
#define srep(i, s, t) for (int i = s... | ALGO | 0.999934 | 4.257008 |
cdf35707-2cbd-47be-8047-242c6a49b581 | yidyetebeje/A2SV | ChalkReplacer.cpp | #include <vector>
using namespace std;
int chalkReplacer(vector<int> &chalk, int k)
{
int n = chalk.size();
int sum = 0;
for (int i = 0; i < n; i++){
sum += chalk[i];
}
k = k % sum;
for (int i = 0; i < n; i++){
if (chalk[i] > k){
return i;
}
k -= chalk... | ALGO | 0.999778 | 5.289409 |
fad5ef8a-666d-4189-aa7b-27cb353ced44 | DakshitBodar/CPP | PR-4 Assortment/Q-1.cpp | #include <iostream>
using namespace std;
int main() {
int no,a[50],i,j;
cout<<"Enter the number of elements in the array: ";
cin>>no;
cout<<"Enter"<<no<<"elements: ";
for (i=0;i<no;i++){
cin>>a[i];
}
cout<<"Negative elements in the array: ";
for (j=0;j<no;j++) {
if (a... | ALGO | 0.997412 | 3.392612 |
5a0a36a5-9fa7-4f10-ac8c-cef0f1b413de | YastrebkovaLV/System-programming | Базовые алгоритмы и константы/Задание 3/ConsoleApplication4/ConsoleApplication4.cpp | #include <iostream>
#include <vector>
#include "constants.h"
using namespace std;
double calculateHeight(double initialHeight, int seconds) {
double height = initialHeight - (myConstants::GRAVITY * seconds * seconds) / 2;
return height < 0 ? 0 : height;
}
int main() {
double initialHeight;
cout << "E... | ALGO | 0.997937 | 6.767986 |
a42a9d85-86f0-4fd2-991e-6db914340bb6 | ishandutta2007/codeforces | hyperhyperhypercubelover/normal/558/C.cpp | #include<cstdio>
int r[111111];
int t[111111];
int upd(int x,int y,int z)
{
while(x<111111&&z--)
{
t[x]++;
r[x]+=y;
x<<=1;
y++;
}
}
int main()
{
int i,j,k,l,n;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&j);
k=0;
l=1e9;
while(j)
{
upd(j,k,l);
if(j%2)l=1e9;
... | ALGO | 0.999992 | 3.864715 |
6b9a33c6-9b89-429b-af8d-9db47731aab1 | Abhishekkumar02/DSA | STL/set.cpp | #include<bits/stdc++.h>
using namespace std;
#include <stdio.h>
int main()
{
set<int> s;
s.insert(3);
s.insert(3);
s.insert(3);
s.insert(3);
s.insert(4);
cout<<"\n";
cout<<s.count(3)<<"\n";
cout<<s.count(5)<<"\n";
cout<<s.count(4)<<"\n";
s.erase(3);
s.insert(6);
cout... | ALGO | 0.991661 | 3.465832 |
261faf68-78dd-4059-8121-fc1536d5d1c2 | jesuswr/cp-codes-and-problems | CSES/DP/1745.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <unordered_map>
#include <assert.h>
#include <array>
#include <random>
#include <chrono>
using namespace std;
typedef long long ll;... | ALGO | 0.99993 | 3.422654 |
3cdac7d4-1dd3-448e-9029-ab94e7e8c195 | ZamzamNiaz/DSA-preparation | arrays/arrayProblems.cpp | #include <iostream>
#include <vector>
using namespace std;
// Find Unique element in array
uniqueElement(int array[], int n){
int ans =0;
for(int i =0; i<n; i++){
ans = ans^array[i];
}
return ans;
}
int main(){
int n;
cout<<"Give size to array ";
cin>>n;
int array[n];
... | ALGO | 0.974295 | 4.665875 |
3d7c81f3-e0bd-48e8-b539-820545b820c1 | xuzx1210/LeetCode | 2391. Minimum Amount of Time to Collect Garbage.cpp | class Solution
{
private:
int collect(const vector<string> &garbage, const vector<int> &travel, const char type)
{
int last = -1;
for (int i = garbage.size() - 1; i >= 0; --i)
if (find(garbage[i].begin(), garbage[i].end(), type) != garbage[i].end())
{
last... | ALGO | 0.997686 | 5.007907 |
6fedc694-f9ef-46c5-bf7d-7a3ac4a7a180 | strengthen/LeetCode | C++/287.cpp | __________________________________________________________________________________________________
sample 4 ms submission
class Solution {
public:
int findDuplicate(vector<int>& nums) {
for(int i = 0; i < nums.size(); i++)
{
if(nums[i] != (i+1))
{
... | ALGO | 0.999999 | 5.316844 |
649d560e-cb62-419a-8aba-4d71065c1881 | gabwowce/Algoritmai-DuomenuStrukturos-Kontroliniai | Gabriele_Tamaseviciute_PI23S_Praktinis_Darbas_Programa2.cpp |
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
#include <stdio.h>
using namespace std;
//Medzio funkcijos ------------------------------------------------>
struct MedzioMazgas {
int duomuo;
MedzioMazgas* left;
MedzioMazgas* right;
};
MedzioMaz... | ALGO | 0.998926 | 4.691556 |
16da5b28-18d1-4cdf-889b-2dd51af4ad85 | nickbetsworth/Image-Classifier | library/Histograms.cpp | #include "Histograms.h"
cv::Mat get_1d_histogram(cv::Mat image_data, int bins) {
const int dims = 1;
const int sizes[] = { bins, bins, bins };
const int num_channels = 3;
const int channels[] = { 0, 1, 2 };
float rRange[] = { 0, 256 };
float gRange[] = { 0, 256 };
float bRange[] = { 0, 256 };
const float *rang... | TOOL | 0.981197 | 6.080875 |
f1aa6762-6300-4d3c-8682-79d3733cd180 | risharthpardeshi/DSA-Series-Busted | Lecture061 Queue Interview Questions/negativeInteger.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
vector<long long> printFirstNegativeInteger(long long int arr[],
long long int n, long long int k);
// Driver program to test above functions
int main() {
long long int t, i;
cin >> t;
while ... | ALGO | 0.999861 | 5.716298 |
6a89f1db-840f-48c6-a21e-c3a938d23646 | Abhrajyoti00/Competitive_Programming | ATCODER/A_Sort_Left_and_Right.cpp | #include<bits/stdc++.h>
using namespace std;
void solve(){
int n;
cin>>n;
vector<int>v(n);
for(int i =0; i<n; i++){
cin>>v[i];
}
if(is_sorted(v.begin(), v.end())){
cout<<0<<endl;
return;
}
if(v[0] == n && v[n-1] == 1){
cout<<3<<endl;
return;
}... | ALGO | 0.999933 | 4.064148 |
6931d42f-f3cd-4eb8-8280-b8caf2d76af2 | nonayan/AtCoderProblems | ABC346/c.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF 1010000000
int main(){
ll n, k;
cin >> n >> k;
map<ll, ll> mp;
ll a[n];
rep(i, n) {
cin >> a[i];
mp[a[i]] = a[i];
}
ll sum = 0;
sum = (k*(k+1))... | ALGO | 0.999956 | 3.640751 |
c0e8275c-c118-4b14-a879-db5ccee29c34 | caiotheodoro/lesma-gram | frontend/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.998473 | 6.785645 |
2c83d50d-92e8-41e9-923c-e4a8d7f8ee19 | truong11062002/IT001 | 20522087_03/Bai_151/Bai_151.cpp | #include<iostream>
#include<iomanip>
#include<ctime>
using namespace std;
void Nhap(int[], int&);
void Xuat(int[], int);
void DuaVeDau(int[], int);
int main()
{
int b[100];
int k;
Nhap(b, k);
Xuat(b, k);
cout << "\nChuyen so chia het cho 3 ve vi tri dau mang: ";
DuaVeDau(b, k);
for (int i = 0; i < k; i++)
{
... | ALGO | 0.99854 | 3.064853 |
a056f54f-0edf-4606-98c8-430bb1157041 | hello-world0421/Algorithm-Code-Repository | codeforces_code/CGR28/B.cpp | #include <bits/stdc++.h>
void solve() {
int n, k; std::cin >> n >> k;
std::vector<int> a(n);
int j = 1;
for (int i = k - 1; i < n; i += k) {
a[i] = j++;
}
for (int i = 0; i < n; i += 1) {
if (a[i] == 0) a[i] = j++;
}
for (int i = 0; i < n; i++) {
std::cout << a[... | ALGO | 0.999936 | 4.325827 |
46dbf376-26b1-4482-b831-402274c98265 | Tarin10/CG_Project_E | array.cpp | #include<iostream>
using namespace std;
int main()
{
int array[5],item,value;
cout<<"Enter the Values :";
for(int i=0; i<5; i++)
{
cin>>array[i];
}
cout<<"Print the Array :"<<endl;
for(int j=0; j<5; j++)
{
cout<<array[j]<<" "<<endl;
}
cout<<"Enter the element ... | ALGO | 0.998789 | 3.729407 |
458d3868-98f6-46cf-9543-298599e102fc | ohsngjun/3D-4DGS | diff-gaussian-rasterization/third_party/glm/test/core/core_func_integer_find_msb.cpp | #include <glm/glm.hpp>
#include <cstdio>
#include <cstdlib> // To define "exit", req'd by XLC.
#include <ctime>
#define LE 1 // 1 for little-endian, 0 for big-endian.
int pop(unsigned x) {
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
x = (x + (x >> 4)) & 0x0... | ALGO | 0.998741 | 3.60046 |
81be019c-4cce-4ffc-afb0-321c8b0d00d9 | tushar54594/LeetcodeQuestions | Path With Minimum Effort - GFG/path-with-minimum-effort.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int MinimumEffort(vector<vector<int>>& heights) {
int n = heights.size();
int m = heights[0].size();
priority_queue<pair<int, pair<int,int>>,
vector<pair<i... | ALGO | 0.999974 | 6.102473 |
7cf9c7dc-de31-4c3c-a53d-7b2dc7f17647 | mlinking/parallel-distributed_computing | odd-even-sort/sequential/src/runner.cpp | //
// Created by cjdcoy on 04/09/19.
//
#include <unistd.h>
#include <tuple>
#include <fstream>
#include "timer.h"
#include "runner.h"
#include "odd_even_sort.h"
/**
*
* @param content content to display
* @param size length of the array
* @param n display until n
*/
static void print_data(int *content, int siz... | ALGO | 0.99438 | 5.058348 |
65fbcd26-5d92-4396-9607-bbfacc073491 | NovaPigeon/Introduction_to_Computing_A | 第三阶段编程练习/第三阶段编程练习(五)/分割乘积/分割乘积/main.cpp | //
// main.cpp
// 分割乘积
//
// Created by 寿晨宸 on 2021/11/25.
//
#include <iostream>
#include<stdlib.h>
#include <cstring>
#include<climits>
using namespace std;
char num[1000]={'\0'};
int main()
{
int max=0;
char a[1000]={'\0'},b[1000]={'\0'},c[1000]={'\0'};
cin>>num;
int p=0;
int min=INT_MAX;
... | ALGO | 0.999727 | 3.614639 |
15a764dc-5796-47a1-813f-68d26aa835fb | KaiqueSantos720/C-LG1 | Sala 5/Exercício 06.cpp | #include <stdio.h>
#include <conio.h>
#include <locale.h>
int main()
{
setlocale(LC_ALL, "portuguese");
int v[30], vb[30], i, j, n, aux;
printf("Preencha o vetor:\n");
for(i=0; i<30; i++){
scanf("%i", &v[i]);}
for(i=0; i<30; i++){
vb[i]=v[i]*v[i]*v[i];}
printf("Matriz B\n");
for(i=0; i<30; i++){
pr... | ALGO | 0.996151 | 3.135847 |
1aa43e11-7ef0-4309-a8b3-43dbab4d9e62 | Hao-yu-lin/Leetcode | BT/0105-Construct_Binary_Tree_from_Preorder_and_Inorder_Traversal.cpp | /*
題目:
https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
解說:
有使用到的觀念:
Hash Map, Divide and Conquer
*/
#include "../code_function.h"
class Solution {
unordered_map<int, int> ump;
public:
TreeNode* buildTree(vector<int>& preorder, vector<int>& inorder)
{
int... | ALGO | 0.999989 | 6.766536 |
4d51ed78-8016-472a-9619-572ca501f3d2 | sujalpahwa30/ProgrammingWithDSAUsingCPP | BinaryTree/ConstructTreefromLevelOrder.cpp | #include<iostream>
#include<queue>
using namespace std;
class Node{ // BFS -> Queue , DFS -> Stack
public:
int val;
Node* left;
Node* right;
Node(int val){
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
Node* Construct(int arr[] , int n){
queue<Node*>q;... | ALGO | 0.999996 | 4.691368 |
52e5bf5a-1c71-4154-a89a-8a385f95bc1d | LINUX87HN/Estructuras-de-Datos | ClaseListas.cpp | #include <iostream>
using namespace std;
class nodo{
public:
//constructor
nodo(int v, nodo *sig=NULL)
{
valor=v;
siguiente=sig;
}
private:
int valor;
nodo *siguiente;
friend class lista;
};
typedef nodo *pnodo;
class lista{
private:
pnodo primero;
public:
lista()
{
primero... | ALGO | 0.998827 | 3.808362 |
f35fa9cc-1584-4d67-9908-5a6581343008 | emdiya/goroute_trainning | 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 |
8d51db0d-2632-4b69-acf8-d3affda2588b | tanujdhiman/Data_Structure_and_Algorithms | Stack/Infix to Postfix Using Stack.cpp | using namespace std;
#include<iostream>
char infix[100], postfix[100];
int top = -1, n = 100;
int isFull()
{
if(top == n-1)
{
return 1;
}
else
{
return 0;
}
}
int isEmpty()
{
if(top == -1)
{
return 1;
}
else
{
return 0;
}
}
void push(int x)
{
if(isFull())
{
cout << "Stack is full or Overflow... | ALGO | 0.999854 | 4.227674 |
e5fd7926-7a8a-48b3-a798-2c566d4dec16 | mitesh-goswami/DSA | c++-leetcode/bitwise/MagicNumber.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define tc(t) \
int t; \
cin >> t; \
while (t--)
#define pb push_back
#define fi first
#define se second
#define debug1(x) cerr << #x << " = " << x << '\n';
#define debug2(x, y) cerr << #x << " = " << x << " " << #y << " = " << y << "\n... | ALGO | 0.999776 | 4.745521 |
44a36ded-8aae-43af-bd0f-088d341f877b | raincross7/code-similarity | codes/train_code/problem175/problem175_110.cpp | #include <vector>
#include <iostream>
using namespace std;
using ll = long long int;
int main(){
int n; cin >> n;
int min_b = 1e9 + 10;
ll total = 0;
bool anydiff = false;
for(int i=0; i<n; i++){
int a, b; cin >> a >> b;
total += a;
if(a > b){
min_b = min(min_b,... | ALGO | 0.999981 | 3.848959 |
0a34127e-ab14-470a-b404-e8e2cf2ba8cd | MrSajidShaikh/advance_flutter_ch1 | 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.998756 | 6.772262 |
c5263e7f-b5df-4be6-816d-1af9e83b36cc | roodolv/atcoder | cpp/abc175_a.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int maxSeq = 0;
for(int i = 0; i < S.size(); i++) {
if(S.at(i) == 'R') {
if(i != 0 && S.at(i - 1) == 'R') {
maxSeq++;
} else if(maxSeq == 0) {
maxSeq = 1;
}
}
}
cout << maxSeq << endl... | ALGO | 0.999739 | 4.437194 |
45b1f9cb-92fa-47b0-b21a-fd097af3b368 | Shubham-Raj-25/LeetCode-Solutions | 2811-determine-the-minimum-sum-of-a-k-avoiding-array/2811-determine-the-minimum-sum-of-a-k-avoiding-array.cpp | class Solution {
public:
int minimumSum(int n, int k) {
set<int> st;
int i=1;
int ans = 0;
while(n){
if(st.find(k-i)==st.end()){
st.insert(i);
ans += i;
i++;
n--;
}
else
... | ALGO | 0.99997 | 5.166985 |
bb71897f-8b0b-4874-957a-5517e5fe4c53 | icedman/flutter_editor | libs/tm-parser/textmate/theme/theme.cpp | #include "theme.h"
#include "colors.h"
#include "util.h"
#include <iostream>
static theme_t* current_parsed_theme = 0;
static std::map<int, color_info_t> trueColors;
static int termColorCount = 256;
static color_t* termColors = (color_t*)termColors256;
int nearest_color(int r, int g, int b)
{
color_info_t c(r, ... | TOOL | 0.854733 | 6.209508 |
e82c8df8-1da1-407a-9151-f659cddbb3fc | pralinkhaira/Leet-Code-Solutions | 2551-apply-operations-to-an-array/apply-operations-to-an-array.cpp | class Solution {
public:
vector<int> applyOperations(vector<int>& nums) {
int n = nums.size();
// Apply operations
for (int i = 0; i < n - 1; i++) {
if (nums[i] == nums[i + 1]) {
nums[i] *= 2;
nums[i + 1] = 0;
}
}
... | ALGO | 0.999981 | 7.063477 |
a5ebfe00-6446-449a-b1ac-18a62d913b87 | hsutimwei/Coding | zerojudge/f816.cpp | /********************************************************************************************
*
* 就是看到解答可以理解的那種
* 但我想不出來。
* 加油
****************************************************************************... | ALGO | 0.999821 | 3.300258 |
cf8c70d6-352b-4f4a-a212-c1d73a1df5fa | Ibrahim-898/Solved_problem | B_Sets_and_Union.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ld long double
#define ios() ios_base:: sync_with_stdio(0);cin.tie(0);
bool cmp(const pair<int,int> &a,const pair<int,int> &b){
if(a.first!=b.first)
return (a.first>b.first);
else
return (a.second<b.second);
}
... | ALGO | 0.999696 | 3.694502 |
dd831d22-9f39-4d78-a13a-19b0cedb3281 | trojinx/Dead-Pixel-Checker-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.998809 | 6.763549 |
96a5d63a-c4d1-4445-bb07-d619f2b9053f | ishandutta2007/codeforces | lucina/normal/1359/E.cpp | #include<bits/stdc++.h>
using namespace std;
int const nax = 5e5 + 10;
const int mod = 998244353;
void plusle (int &a, int b) {
if ((a += b) >= mod) a -= mod;
}
int mul (int a, int b) {
return 1LL * a * b % mod;
}
int power (int a, int b) {
int res = 1;
for (; b > 0 ; b >>= 1, a = mul(a, a))
... | ALGO | 0.999992 | 4.831308 |
5cf2747a-583d-4a1f-81bb-7371b094d153 | Vaibhav14072004/DSA-Problems | 2665-minimum-time-to-repair-cars/minimum-time-to-repair-cars.cpp | // Approach ->> Using Binary Search
// (We have to minimize the maximum time)
// TC= O[log(maxRank* cars*cars)* (N)]
class Solution {
public:
bool binarySearch(vector<int> &ranks, long long mid, int cars)
{
int n= ranks.size();
long long cnt= 0;
for(int i=0; i<n; i++)
{
... | ALGO | 0.999981 | 5.779092 |
12c0103a-11b2-4b6c-a98b-db46dc551b6e | SyedaShafi/C_programming | CPP/finding_primes.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int N = 1e7 + 1;
bool mark[N];
ll v[N];
int main()
{
memset(mark, true, sizeof(mark));
for (ll i = 2; i * i <= N; i++)
{
if (mark[i])
{
for (ll j = i * i; j <= N; j += i)
{
ma... | ALGO | 0.999695 | 4.244747 |
cf748c23-1493-477f-9873-76289d9e58ad | DISASTER-RUMBLING/CODE | 算法/Leetcode/Leetcode 100. 相同的树.cpp | #define _CRT_SECURE_NO_WARNINGS
using namespace std;
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), lef... | ALGO | 0.999978 | 5.866158 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.