uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
cfe6db49-5188-430b-bfcc-3c5678037fa6 | farhanaiubat95/Codeforces-Problem-Solve | Chat room_58A.cpp |
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s,s1="hello";
cin>>s;
int c=0,j=0;
for(int i=0;i<s.size();i++)
{
if(s[i]==s1[j])
{
j++;
if(j==5)
{
c=1;
}
}
}
if(c==1)
{
cout<<"YES"<<endl;
}else{
... | ALGO | 0.999934 | 3.060199 |
0855388e-6b11-4f3c-a410-357ae810e068 | kavya98527/Data-Structures | lab/experiment5.cpp | #include <iostream>
using namespace std;
struct node
{
int data;
struct node *next;
};
class link
{
private :
node *top;
public:
link()
{
top=NULL;
}
void push(int n)
{
node *temp=new node;
temp->data=n;
temp->next=NULL;
if(top==NULL)
{
... | ALGO | 0.997277 | 3.676841 |
6d6680bd-7d46-43bb-ba97-b3ed978a3100 | ria28/Data-Structures-And-Algorithms | codechef/CookOff/novCook/flip.cpp | #include <iostream>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <queue>
#define ll long long
using namespace std;
int main()
{
// ios_base::sync_with_stdio(false);
// cin.tie(NULL);
int t;
cin >> t;
// 0100111001
// 1010100... | ALGO | 0.999974 | 4.408022 |
8341488b-3f6c-48c7-b370-ea170739c3db | ishandutta2007/codeforces | dotorya/normal/1242/C.cpp | #include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string... | ALGO | 0.999986 | 3.195908 |
a81a4c72-cdcc-4940-8421-56291b6f6889 | parikk/kuliah | modul 2/kasus5.cpp | #include <stdio.h>
int main() {
int bil1, bil2;
float hasilBagi;
printf("Masukkan bilangan pertama: ");
scanf("%d", &bil1);
printf("Masukkan bilangan kedua: ");
scanf("%d", &bil2);
if (bil2 == 0) {
printf("Error: Pembagian dengan nol tidak diizinkan!\n");
} else {
hasilBagi = (float) bil1 / b... | ALGO | 0.974825 | 4.599538 |
79cc16d5-03b0-4626-96c1-ece3ed2a351e | dashamel/LAB6.4rec | lab6.4rec.cpp | #include <iostream>
#include <cmath>
using namespace std;
int MinMod(int mas[], int n, int i, int minMod)
{
if (i >= n)
return minMod;
minMod = min(minMod, abs(mas[i]));
return MinMod(mas, n, i + 1, minMod);
}
int Sumzero(int mas[], int n, int i, bool foundZero)
{
if (i >= n || foundZero)
... | ALGO | 0.999944 | 3.888583 |
5e7eb7ef-1e0c-4433-b4b0-311f992a8140 | SuYouge/g2o-example | simple_optimize/simple_optimize.cpp | #include <iostream>
#include "g2o/core/sparse_optimizer.h"
#include "g2o/core/block_solver.h"
#include "g2o/core/optimization_algorithm_gauss_newton.h"
#include "g2o/core/optimization_algorithm_levenberg.h"
#include "g2o/solvers/csparse/linear_solver_csparse.h"
#include "g2o/core/factory.h"
#include "g2o/types/slam3d... | ALGO | 0.869085 | 6.693753 |
3b7076cb-5a03-4ee5-82cc-fc8d0826cb81 | tomlzk/leetcode | 119.杨辉三角-ii.cpp | /*
* @lc app=leetcode.cn id=119 lang=cpp
*
* [119] 杨辉三角 II
*/
// @lc code=start
class Solution {
public:
vector<int> getRow(int rowIndex) {
vector<vector<int>> C(rowIndex + 1);
for (int i = 0; i <= rowIndex; ++i) {
C[i].resize(i + 1);
C[i][0] = C[i][i] = 1;
f... | ALGO | 0.999917 | 6.571215 |
513839bf-5a64-4ece-abee-d256f6e438ae | keshav-kabra/competitive | check_palindrome.cpp | #include<bits/stdc++.h>
using namespace std;
bool palindrome(string s)
{
string s1 , s2;
//convert into lower case
transform(s.begin(), s.end(), s.begin(), ::tolower);
for(int i= 0;i<s.length();i++)
{
if((s[i] >= 'a' && s[i] <= 'z' )|| (s[i] >= 'A' && s[i] <='Z'))
{
s1 +=... | ALGO | 0.999863 | 4.614626 |
66b2aefd-f7e0-46b9-9168-e04073722b24 | areian13/PS_BOJ | 1. Bronze/Bronze 1/[B1] 09093 단어 뒤집기.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#define FastIO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
using namespace std;
int main()
{
FastIO;
int tc;
cin >> tc;
cin.ignore();
while (tc--)
{
string str;
getline(ci... | ALGO | 0.996836 | 5.444376 |
ab9e938b-06f6-4309-a3a3-3a979fef2620 | Aziz-Ru/Probelm-Solving | CF/841A.cpp | #include <bits/stdc++.h>
using namespace std;
#define TC int t; cin>>t;while(t--)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long int
#define nl '\n'
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define ff first
#define ss second
#define debug(x) cout<<#x<<... | ALGO | 0.999934 | 4.085715 |
c258627e-b3e5-440e-a789-9b680813fafe | jailsonzarur/Competitive-Programming-Problems | RPC/K.cpp | #include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define dbg(x) cout << #x << " = " << x << endl /*Útil para debugar, printa o nome da variavel e seu valor*/
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f... | ALGO | 0.999075 | 4.024457 |
fee4cc6a-c8e3-4ba3-95ff-6c721fa6aea3 | anonymousguy198/swiftshader-compiled | third_party/llvm-10.0/llvm/lib/CodeGen/LoopTraversal.cpp | #include "llvm/CodeGen/LoopTraversal.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/CodeGen/MachineFunction.h"
using namespace llvm;
bool LoopTraversal::isBlockDone(MachineBasicBlock *MBB) {
unsigned MBBNumber = MBB->getNumber();
assert(MBBNumber < MBBInfos.size() && "Unexpected basic block number.");
... | ALGO | 0.999213 | 7.627181 |
8473cbfe-20a2-4888-a290-492c64b6d2e9 | MdAjharulIslam/HackerRank | Inherited Code.cpp |
#include <iostream>
#include <string>
#include <sstream>
#include <exception>
using namespace std;
class BadLengthException {
private:
int n;
public:
BadLengthException(int errornumber){
n=errornumber;
}
int what(){return n;}
};
bool checkUsername(string username) {
bool isValid = t... | ALGO | 0.998473 | 4.274902 |
6837bd4a-33c8-4dd8-9063-80eeba10cf3a | im2781975/solved-cpp | Array/Execution/Max overlap.cpp | #include<bits/stdc++.h>
using namespace std;
void maxOverlap(vector<int>& start, vector<int>& end )
{
int n= start.size();
int maxa=*max_element(start.begin(), start.end());
int maxb=*max_element(end.begin(), end.end());
int maxc = max(maxa, maxb);
int x[maxc + 2];
memset(x, 0, ... | ALGO | 0.999954 | 4.940238 |
387383e7-6f15-4dea-b8b9-3f1852bccd4e | ichernev/triegraph | test/examples/main_cc.cpp | #include "triegraph/dna_config.h"
#include "triegraph/manager.h"
#include "triegraph/util/cmdline.h"
#include "triegraph/util/logger.h"
using namespace triegraph;
// struct Cfg : dna::DnaConfig<0> {
// static constexpr bool triedata_allow_inner = true;
// };
using triegraph::dna::CfgFlags;
using TG = Manager<dn... | ALGO | 0.997971 | 6.212823 |
c3d7b1e0-df89-4166-b3c8-aac2c8f7feb8 | Cai-Guang/TianNiYiKou-2024-Training-Records | Training/WuhanTraining/The 2025 ICPC Europe Championship/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
// void tst() {
// std::cerr << std::endl;
// }
// template<typename T, typename... Ts>
// void tst(T t, Ts... ts) {
// std::cerr << t;
// tst(ts);
// }
// #define test tst
void solve() {
int n;
std::cin >> n;
std::vector<s... | ALGO | 0.99995 | 4.4494 |
10986bd0-f5d2-4e25-9a39-00135504c677 | DionysiosB/HackerRank | Equations2.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
int main(){
const long solMod = 1000007;
long N(0); scanf("%ld", &N);
bool * primes = new bool[N + 1];
primes[0] = primes[1] = 0; for(int k = 2; k <= N; k++){primes[k] = 1;}
for(int k = 2; k <= sqrt(N); k++){... | ALGO | 0.999977 | 4.44758 |
f6c0f882-7ad8-4547-8444-9205ae85a8f8 | Damaniel/SLAC | CODE/src/maze.cpp | //------------------------------------------------------------------------------
// Maze::Maze
//
// Constructor.
//------------------------------------------------------------------------------
Maze::Maze() {
}
//------------------------------------------------------------------------------
// Maze::Maze
//
// Const... | TOOL | 0.856039 | 5.832863 |
39716cb9-011b-4273-9bb8-8e88f2b41448 | MateyApostolov/HomeWork | First steps/binary.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 10001;
int n;
bool nc[maxn];
bool pred (int num) {
return nc[num];
}
int main () {
char s;
cin >> n;
for(int i = 0; i < n; i++) {
cin >> s;
if(s == 'T') nc[i] = true;
}
int l = -1, r = n, mid;
while (l + 1 < r)... | ALGO | 0.999494 | 3.897491 |
2d20314b-f8b8-4b20-b60c-ea8274a8b558 | dechichichi/DoLeetCode | 单调栈/42.cpp | class Solution {
public:
int trap(vector<int>& height) {
int ans = 0;
stack<int> st;
for (int i = 0; i < height.size(); i++) {
while (!st.empty() && height[i] >= height[st.top()]) {
int bottom_h = height[st.top()];
st.pop();
if (st.... | ALGO | 0.999962 | 6.897035 |
ac79bc6e-8571-4be4-90f9-8f356ab6b57c | tmk-123/DSA | DSA07025.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
stack<long long> st;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
if (s == "+" || s == "-" || s == "*" || s == "/") {
... | ALGO | 0.999888 | 4.807636 |
dcc6da24-1f29-498e-b16b-f47dda4fbbc3 | Ultimaker/libArachne | src/main.cpp |
#include <cstdio>
#include <string.h>
#include <strings.h>
#include <sstream>
#include <stdio.h> // for file output
#include <fstream>
#include <iostream>
#include <algorithm> // random_shuffle
#include <tclap/CmdLine.h> // command line argument parser
#include "Arachne/BoostInterface.hpp"
#include <unordered_set>
... | TOOL | 0.94513 | 7.03858 |
2c40ebc1-ada5-416c-a731-ea12e1856934 | NowatariSoma/cpp_library | アルゴリズム/幅優先探索/迷路問題.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<ll>
#define v... | ALGO | 0.999947 | 4.412354 |
8d0e439c-8ad4-4055-a15d-a3cbccebee3b | Thinklab-SJTU/ML4CO-Kit | ml4co_kit/algorithm/mis/c_arw/kamis-source/wmis/extern/KaHIP/lib/parallel_mh/exchange/exchanger.cpp | /******************************************************************************
* exchanger.cpp
* *
* Source of KaHIP -- Karlsruhe High Quality Partitioning.
* Christian Schulz <<EMAIL>>
*****************************************************************************/
#include <mpi.h>
#include "exchanger.h"
#inclu... | ALGO | 0.998385 | 4.278316 |
60388ebd-efaf-4d68-9d5f-f11ba44002f4 | Sounne/UE_4.25_Totem | Engine/Plugins/Experimental/ControlRig/Source/ControlRig/Private/Units/Math/RigUnit_Noise.cpp | #include "Units/Math/RigUnit_Noise.h"
#include "Units/RigUnitContext.h"
FRigUnit_NoiseFloat_Execute()
{
DECLARE_SCOPE_HIERARCHICAL_COUNTER_RIGUNIT()
if (Context.State == EControlRigState::Init)
{
Time = 0.f;
return;
}
float Noise = FMath::PerlinNoise1D(Value * Frequency + Time) + 0.5f;
Result = FMath::Le... | ALGO | 0.897164 | 6.269146 |
6b76de01-2858-4620-b9c8-4675d68f298f | mfathirafa/STD_Muhammad_Fathi_Rafa_2311104022 | 03_Abstract_Data_Type/UNGUIDED/LATIHAN_01.cpp | #include <iostream>
#include <string>
using namespace std;
struct Mahasiswa {
string nama;
string nim;
float uts;
float uas;
float tugas;
float nilaiAkhir;
};
float hitungNilaiAkhir(float uts, float uas, float tugas) {
return (0.3 * uts) + (0.4 * uas) + (0.3 * tugas);
}
int main() {
c... | TOOL | 0.92631 | 5.621494 |
6952a9da-8d26-4d6f-9b1f-7bc714fb2452 | alhasanmridha/codejam | Kick Start/Kickstart Round A 2018/Problem B. Lucky Dip.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int tn;
cin>>tn;
for(int tc=1;tc<=tn;tc++){
int n,k;
cin>>n>>k;
double v[n];
double vs[n+1];
vs[0]=0;
for(int i=0;i<n;i++){
scanf("%lf",v+i);
}
sort(v,v+n);
for(int i=0;i<n;i++){
vs[i+1]=vs[i]+v[i];
}
double e=0;
for(int i=0;i<k+... | ALGO | 0.999761 | 3.319398 |
4881a212-b5ee-4429-81a1-46add63f11ae | HustStevenZ/mvg_dist_match | src/openMVG/sfm/pipelines/sfm_robust_model_estimation.cpp | #include "openMVG/sfm/pipelines/sfm_robust_model_estimation.hpp"
#include "openMVG/multiview/solver_essential_kernel.hpp"
#include "openMVG/multiview/projection.hpp"
#include "openMVG/multiview/triangulation.hpp"
#include "openMVG/robust_estimation/robust_estimator_ACRansac.hpp"
#include "openMVG/robust_estimation/ro... | ALGO | 0.99981 | 7.011561 |
f70209f4-8a35-4a43-83bc-2f0fdd30c111 | luoshunchong/Cplusplus-Leetcode | Leetcode/131.palindrome-partitioning.cpp | /*
* @lc app=leetcode id=131 lang=cpp
*
* [131] Palindrome Partitioning
*/
// @lc code=start
class Solution
{
public:
vector<vector<string>> res;
vector<string> ve;
vector<vector<string>> partition(string s)
{
backtracking(s, 0);
return res;
}
//回溯
void backtracking(stri... | ALGO | 0.999973 | 6.522351 |
983ae04e-fc74-4099-93f7-193e01d9198e | MridulGupta75/Leetcode-Daily-challanges-all | 0322-coin-change/0322-coin-change.cpp | class Solution {
public:
int func(int ind,int tar,vector<int>& nums,vector<vector<int>>&dp)
{
// if(tar==0)return 0;
if(ind==0)
{
if(tar%nums[ind]==0)
return tar/nums[ind];
return 1e9;
}
if(dp[ind][tar]!=-1)return dp[ind][tar];
... | ALGO | 0.999845 | 5.820575 |
c22877d3-9aed-4edc-86f5-71b7a37d0626 | DanielLukic/IntensiDroid | jni/modplug/fastmix.cpp | #include "stdafx.h"
#include "sndfile.h"
#include <math.h>
#ifdef MSC_VER
#pragma bss_seg(".modplug")
#endif
// Front Mix Buffer (Also room for interleaved rear mix)
int MixSoundBuffer[MIXBUFFERSIZE*4];
// Reverb Mix Buffer
#ifndef MODPLUG_NO_REVERB
int MixReverbBuffer[MIXBUFFERSIZE*2];
extern UINT gnReverbSend;
#en... | ALGO | 0.956078 | 4.438225 |
7ee48981-49e6-4be5-9284-9768ef0647ec | jMetal/jMetalCpp | src/util/comparators/OverallConstraintViolationComparator.cpp | #include <OverallConstraintViolationComparator.h>
/**
* Compares two solutions.
* @param o1 Object representing the first <code>Solution</code>.
* @param o2 Object representing the second <code>Solution</code>.
* @return -1, or 0, or 1 if o1 is less than, equal, or greater than o2,
* respectively.
*/
int Overall... | ALGO | 0.995162 | 5.436267 |
661192bd-2ade-444d-aa38-03ae938c35ba | austindoeswork/opsys1 | parser.cpp | // parser.cpp
// Partners: Austin Wilson, Samuel Johnston, Theodore Rice
#include "parser.h"
#define MAXSTRING 2048 //max length of a string
std::vector<class Process *> Parse(char const * filename);
//PRETTYPRINT
void PrintFile(char const * filename) {
std::vector<class Process *> pv = Parse(filename);
unsigned ... | TOOL | 0.923473 | 4.26559 |
19ab8498-f58e-4522-9c25-0f5f0fa34055 | heavenMOJANG/ICPC | .history/AtCoder/abc380/D_20241116213458.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
char rev(char c) {
return islower(c) ? toupper(c) : tolower(c);
}
int lowbit(int x) { return x & (-x); }
void solve() {
s... | ALGO | 0.999815 | 4.128979 |
c3b63d90-04b0-42b3-9bbe-b5fa795797fd | mattswest/MingdaD2-firmware | Marlin/src/lcd/menu/game/maze.cpp | #include "../../../inc/MarlinConfigPre.h"
#if ENABLED(MARLIN_MAZE)
#include "game.h"
int8_t move_dir, last_move_dir, // NESW0
prizex, prizey, prize_cnt, old_encoder;
fixed_t playerx, playery;
// Up to 50 lines, then you win!
typedef struct { int8_t x, y; } pos_t;
uint8_t head_ind;
pos_t maze_walls[50] = {
... | ALGO | 0.941442 | 5.005376 |
6b13537a-d7f6-425e-a3d5-5a75c49f03d4 | zxf-work/GraphProfile | boost_1_63_0/libs/numeric/odeint/examples/openmp/phase_chain.cpp | #include <iostream>
#include <vector>
#include <boost/random.hpp>
#include <boost/timer/timer.hpp>
//[phase_chain_openmp_header
#include <omp.h>
#include <boost/numeric/odeint.hpp>
#include <boost/numeric/odeint/external/openmp/openmp.hpp>
//]
using namespace std;
using namespace boost::numeric::odeint;
using boost::t... | ALGO | 0.999955 | 5.614108 |
68916226-91a9-4f0b-a126-4120d9550808 | vladchimescu/lpsymphony | src/SYMPHONY/Clp/src/ClpMain.cpp | /* $Id: ClpMain.cpp 2084 2015-01-12 14:25:28Z forrest $ */
#include "CoinPragma.hpp"
#include "AbcCommon.hpp"
#include "ClpSimplex.hpp"
#ifdef ABC_INHERIT
#include "AbcSimplex.hpp"
#endif
#ifndef ABC_INHERIT
void ClpMain0(ClpSimplex * models);
int ClpMain1(int argc, const char *argv[],ClpSimplex * model);
#else
void ... | TOOL | 0.983329 | 4.592878 |
3dba13d9-b022-44de-baed-66b0ece41063 | tiankonguse/ACM | manger/递推/递推/习题/source/杜昆泰/divide2.cpp |
#include <fstream>
using namespace std;
long long f[5000][5000];
// f[i][j]ָNֽM Ǹĺ͵ܷ
ifstream fin("divide2.in");
ofstream fout("divide2.out");
int main(void)
{
long sum,all,i,j,k;
fin>>sum>>all;
for(j=1;j<=all;j++)
for(i=0;i<=sum;i++)
{
if(j==1)
f[i][j]=1;
else
for(k=0;k<=i;k++)
f[i... | ALGO | 0.9997 | 3.645073 |
bbda4b1b-9ead-4006-b659-dea1197ed7c0 | kjwwwwww/Design-and-Analysis-of-Algorithms | 最优乘车.cpp | //#include <iostream>
//#include <cstring>
//#include <sstream>
//using namespace std;
//
//const int N = 510;
//
//int n, m;
//bool st[N];
//int dist[N], g[N][N], station[N];
//
//void dijkstra()
//{
// memset(dist, 0x3f, sizeof dist);
// dist[1] = 0;
//
// for (int i = 0; i < n; i++)
// {
// int t ... | ALGO | 0.999916 | 3.884809 |
aa66f49f-450f-4c43-867b-ae47245e7f16 | ishandutta2007/codeforces | rivalq/normal/192/B.cpp | //https://codeforces.com/contest/192/problem/B
#include<bits/stdc++.h>
#define lop(i,n,a) for(int i=0;i<n;i+=a)
#define rep(i,n,a) for(int i=a;i<n;i++)
#define ll long long int
#define pb push_back
#define all(v) v.begin(),v.end()
#define endl "\n"
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define... | ALGO | 0.999973 | 3.423528 |
1612612b-4426-484d-9d5b-50039b8e8584 | Pajamajoker/Leet-Us-Code | Day-17/Bottom View Of Binary Tree.cpp |
// Refer Top view before this. Exact same method. There, we add the first element that is in a level and then don't change it. Here, we keep updating elements in each lvl
// as we traverse..so at each lvl the last element that came at that level is present
//Function to return a list containing the bottom view of the... | ALGO | 0.99997 | 5.457016 |
eed11071-cce3-4b42-ae49-523954a72fb7 | Al-Nafi10/Data-structure-lab | Task2_Q1_21_45744_3.cpp | #include <iostream>
using namespace std;
int main()
{
int Array1 [5],Array2 [5],mergedArray[5],i=0,j=0,k=0,Input1,Input2;
cout<<"Enter your first array size : " <<" ";
cin>>Input1;
cout<<"Enter your first array elements : "<<" ";
for(i=0;i<Input1;i++)
{
cin>>Array1[i];
}
cout<<... | ALGO | 0.998762 | 3.593468 |
be9358f5-8311-42f8-bbb4-bfb9a09c052c | punityadav2512/dsa-using-cpp | arrays/linear_search.cpp | #include <iostream>
using namespace std;
// Linear Search
int linearSearch(int arr[], int n, int key)
{
for (int i = 0; i < n; i++)
{
if (key == arr[i])
{
return i;
}
}
return -1;
}
int main()
{
int key;
cin >> key;
int arr[5] = {2, 3, 4, -2, 5};
int... | ALGO | 0.999794 | 5.220908 |
adf79500-e384-48ba-86ff-283a7f85c77b | AndyZach08493/holy-shit-i-hope-this-works | SourceCode.5.0/ByPage/c02p67to122/c02p119b.cpp | // Exercise 14
int f(int n);
int main()
{
cout << "The value of f(8) is " << f(8) << endl;
return 0;
} // end main
/** @pre n >= 0. */
int f(int n)
{
cout << "Function entered with n = " << n << endl;
switch (n)
{ case 0: case 1: case 2:
return n + 1;
default:
return f(n-2) * f(n-4);
} ... | ALGO | 0.999509 | 4.736709 |
277dfec5-bbb3-4729-abf4-9c89e12f9bec | anshu1515/cb_cpp | 1D Arrays/inbuiltSort.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
bool compare(int a,int b){
// cout<<a<<b<<endl; //check the numbers comparison
return a > b; //descending order
// return a<b; //ascending order
}
int main(){
int n,i,j;
cin>>n;
int arr[10000];
for(int i=0; i<n; i++){
cin>>arr[i];
}
... | ALGO | 0.999895 | 4.441466 |
05a6109a-21a6-42a1-8634-d586792a0f43 | nafisatuli/codeforces | 1144C.cpp | #include<bits/stdc++.h>
using namespace std;
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
typedef long long ll;
vector<ll>inc,dc;
unordered_map<ll,ll>mp;
int main()
{
fastread();
ll n;
bool flag=true;
cin >> n;
ll aa[n+5];
for(ll i=0; i<n; i++)cin >> aa[i];
for(ll i=... | ALGO | 0.999987 | 3.615232 |
51cdfb47-b3bf-4598-99e0-143918acda2a | zhongshunji/PatMatchCom | Literal.cpp | #include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <brotli/encode.h>
#include <brotli/decode.h>
#include "Literal.h"
// Binary search approximation function
float binary_approximation_with_error(float num, float e, const std::string& error_bound_mode) {
float lower_bound = std::... | ALGO | 0.999618 | 5.789223 |
d98899f8-c0ff-4aa5-a0ec-995145a204b0 | softarts/myoj | ojcpp3/2442_distinctafterarrayreverse.cpp | #include <vector>
#include <unordered_set>
using namespace std;
class Solution {
public:
int countDistinctIntegers(vector<int>& nums) {
unordered_set<int> m;
auto myrev = [](int n) {
long ans; // 注意long,有时候overflow
while (n>0) {
ans=ans*10+n%10;
... | ALGO | 0.999097 | 5.835973 |
064c2666-809a-4697-81d1-34d76643374c | AdrianKPC/ICL-EEProjects | Game2048.cpp | #include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cmath>
#include <vector>
#include <ctime>
bool proc_num (std::vector<int>& v, int bi, int ei);
bool game_over(const std::vector<int>& v);
void print_grid(const std::vector<int>& v);
void rotate_anti_clock (std::vector<int>& v);
void g... | ALGO | 0.997567 | 3.901371 |
3e6bb2a8-a2f2-4871-aa47-21f9c154dfc8 | dhiman-64/DataStructures-and-Algorithms | Patterns/01.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=0 ; i<n ; i++)
{
for(int j=0 ; j<n ; j++)
{
cout<<"*"<<" ";
}
cout<<endl;
}
} | ALGO | 0.999745 | 3.439378 |
0585452b-21d3-4a9e-8967-1f637e163886 | cupeedrl/CODE | DSA PTIT/CODE PTIT/Greedy Algorithm/DSA03055_HAI_MANG_CON_CO_TONG_MAX.cpp | #include<bits/stdc++.h>
using namespace std;
int n,k, x[21];
long long greedy(int k)
{
long long sum1 =0, sum2=0;
for(int i = 0; i< k;i++)
{
if(i<k)
sum1 = sum1*10+x[i];
else
sum2 = sum2*10+x[i];
}
return abs(sum1-sum2);
}
int main()
{
int t;
cin >... | ALGO | 0.999895 | 4.116333 |
a73a179a-dd04-4fad-aa68-436851e7cbd3 | ishandutta2007/codeforces | andreasyan/normal/1552/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define fi first
#define se second
typedef long long ll;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rnf(2106);
const int N = 12;
int n;
int a[N];
v... | ALGO | 0.999946 | 3.929038 |
406ff8c3-56ee-4b4f-8aa0-a213ec2197e5 | RaymondMoorhead/CPlusPlus-Tutorial | Source/PracticalExamples/P14_BasicEncryption.cpp | /*
We can perform a basic type of encryption by simply
adjusting the value of a character up or down by a
known amount.
*/
#include <stdio.h>
void EncryptInternal(char* text, const char* password, char modifier)
{
int text_pos = 0;
int pass_pos = 0;
while(text[text_pos] != '\0')
{
text[text_pos] +... | ALGO | 0.999878 | 4.422622 |
05c85a03-6418-4a68-bf59-ff439ceeac10 | TranAnhQuoc23521313/UIT_MATRIX | 23520129_23520335_23521313_23521523_23521651_BT04/Bai161/Bai161.cpp | #include <iostream>
#include <iomanip>
using namespace std;
void Nhap(float[][500], int&, int&);
void Xuat(float[][500], int, int);
void Xoay90(float[][500], int, int);
int main()
{
float b[500][500];
int m, n;
Nhap(b, m, n);
cout << "Ma tran truoc khi xoay 90 do: " << endl;
Xuat(b, m, n);
Xoay90(b, m, n);
cou... | ALGO | 0.996018 | 3.445308 |
219fea22-fa26-42a3-8434-2c70ae514022 | sachleen11/Leetcode-Problems | valid-palindrome/valid-palindrome.cpp | class Solution {
public:
bool isPalindrome(string s) {
int left = 0;
int right = s.length() - 1;
while(left <= right){
if(!((s[left] >= 'a' && s[left] <= 'z') || (s[left] >= 'A' && s[left] <= 'Z') || (s[left] >= '0' && s[left] <= '9'))){
left++;
}
... | ALGO | 0.999912 | 6.435099 |
065116c4-9017-4db4-98af-17550b50b23d | mrdrivingduck/leet-code | 557.ReverseWordsInAStringIII.cpp | /**
* @author Mr Dk.
* @version 2021/03/11
*/
/*
切分出每个字符串并反转。
*/
#include <cassert>
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
using std::string;
using std::stringstream;
class Solution {
public:
string reverseWords(string s) {
string result;
result.res... | ALGO | 0.999551 | 5.843557 |
8d3a18d5-baea-4d1c-bc94-af3555541d22 | oodenX/answers-TSUWS | 数据结构/数据结构上期/957.cpp | #include <bits/stdc++.h>
using namespace std;
string s;
int n;
int main() {
cin >> n >> s;
for (int i = s.size() - 1; i >= 0; i--) cout << s[i] << ' ';
return 0;
} | ALGO | 0.956256 | 3.096381 |
a28e82b1-dc3b-41b6-8a82-6ffd110dadbb | JosephGwara/oxfordHackathon | oxfordhackathon/auction_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.997984 | 6.785645 |
6bbb48d8-5be3-435d-b103-475943fe69e4 | EVOS-DEV/evos-core | src/core_read.cpp | #include "core_io.h"
#include "primitives/block.h"
#include "primitives/transaction.h"
#include "script/script.h"
#include "serialize.h"
#include "streams.h"
#include "univalue/univalue.h"
#include "util.h"
#include "utilstrencodings.h"
#include "version.h"
#include <boost/algorithm/string/classification.hpp>
#includ... | TOOL | 0.863792 | 7.165897 |
9e272893-65e1-401a-a5bc-b44e6c357aaf | Bucephalus-lgtm/6Companies30Days | Amazon/Ques9.cpp | // https://practice.geeksforgeeks.org/problems/is-sudoku-valid4820/1/
class Solution
{
public:
int isValid(vector<vector<int>> mat)
{
// code here
int row[9][9] = {0}, col[9][9] = {0}, box[9][9] = {0};
for (int i = 0; i < 9; i++)
{
for (int j = 0; j < 9; j++)
... | ALGO | 0.999536 | 6.457627 |
f9824920-15fd-4f68-b83d-db7daf96b1c6 | wasa-rockoon/WOBC | src/components/Pressure/src/EnvironmentCalculations.cpp | #include "EnvironmentCalculations.h"
#include <Arduino.h>
#include <math.h>
#define hi_coeff1 -42.379
#define hi_coeff2 2.04901523
#define hi_coeff3 10.14333127
#define hi_coeff4 -0.22475541
#define hi_coeff5 -0.00683783
#define hi_coeff6 -0.05481717
#define hi_coeff7 0.00122874
#define hi_coeff8 0.00085282... | ALGO | 0.994228 | 4.64572 |
8deced93-f4ef-4652-993f-94287c29e089 | ChandlerNgo/CP | CFPractice/2025A.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
for(int i = 0; i < n; i++){
string first;
string second;
cin >> first >> second;
int seconds = first[0] == second[0];
... | ALGO | 0.999914 | 4.311321 |
595407a3-fe4c-47b9-b9a0-f6af6567a04f | Kunal2300/-6Companies30days | Microsoft/11_Generate_Binary_Numbers.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> generate(int N)
{
vector<string>res ;
queue<string>q;
q.push("1");
for(int count=0 ; count<N ; count++){
string curr = q.front();
res.push_back(curr);
q.pop();
q.push(curr + '0');
q.push(curr + '1');
}
return res ;
}
int main... | ALGO | 0.99998 | 4.347034 |
c1a840c7-676a-4244-bd83-13364ec14eeb | abubakaristiak/Leetcode-Problems | Easy/_66_Plus One.cpp | //https://leetcode.com/problems/plus-one/description/?envType=study-plan-v2&envId=programming-skills
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
int idx = digits.size()-1;
while(idx>=0){
if(digits[idx]==9){
... | ALGO | 0.999798 | 6.657808 |
2bdd5571-c6f7-4007-b72d-d76e79bce241 | angelahsu510021/SomeTasks | t15.cpp | #include<stdio.h>
//簡單遞迴
int f(int n){
return n == 0 ? 1: f(n-1)*n;
}
int main(){
printf("%d\n",f(3));
return 0;
} | ALGO | 0.999963 | 3.781242 |
7b711416-d068-46df-822e-c0479c2834c8 | URRealHero/Assignments | DA_E/计卓2201_U202215322_濮澍/LinearList/Funcs/MaxSubArray.cpp | #include "SQList.h"
ElemType MaxSubArray(SQList L){
if(L.elem==NULL || L.length == 0) return INFEASIBLE;
ElemType ThisSum = 0,MaxSum = 0;
int index;
for(index = 0 ; index < L.length ; index++){
ThisSum+=L.elem[index];
if(ThisSum < 0) ThisSum = 0;
if(ThisSum > MaxSum) MaxSum = ThisSum;
}
return MaxSum;
}... | ALGO | 0.999215 | 4.382514 |
a1d982e7-841a-40ea-b860-64d773c4c451 | ooooo-youwillsee/leetcode | 0000-0500/0441-Arranging-Coins/cpp_0441/main.cpp | #include <iostream>
//#include "Solution1.h"
//#include "Solution2.h"
#include "Solution3.h"
void test(int x) {
Solution solution;
cout << solution.arrangeCoins(x) << endl;
}
int main() {
test(5); // 2
test(8); // 3
test(2147483647); // 65535
return 0;
}
| ALGO | 0.999623 | 5.854312 |
02867598-7431-486e-94e4-17831e8e054b | Frozen1023/leetcode | 990.cpp | class Solution {
public:
bool equationsPossible(vector<string>& equations) {
vector<int> parent(26,-1);
for(int i = 0;i < 26;i ++)
parent[i] = i;
for(vector<string>::iterator it = equations.begin();it != equations.end();it ++)
{
if((*it)[1] == '=')
... | ALGO | 0.99993 | 5.482499 |
1b7df4ae-34ed-4d2d-87e1-8a5779af46e9 | abhiabhi0/Competitive-Programming | LeetCode/Array_set_matrix_zeros.cpp | class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
set<int> rows, cols;
int n = matrix.size(), m = matrix[0].size();
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < m; ++j)
{
if (matrix[i][j] == 0)
... | ALGO | 0.998651 | 6.755035 |
d3ed7326-e401-4109-bd3f-47b330b9f721 | sarvex/leetcode-guile | solution/1500-1599/1514.Path with Maximum Probability/Solution.cpp | class Solution {
public:
double maxProbability(int n, vector<vector<int>>& edges, vector<double>& succProb, int start, int end) {
vector<vector<pair<int, double>>> g(n);
for (int i = 0; i < edges.size(); ++i) {
int a = edges[i][0], b = edges[i][1];
double s = succProb[i];
... | ALGO | 0.999981 | 5.821889 |
e829286b-9e7f-40b4-801a-c4d46d38fc4a | mydre/abc | A/41.cpp | 算法训练 数的统计
时间限制:1.0s 内存限制:256.0MB
提交此题
问题描述
在一个有限的正整数序列中,有些数会多次重复出现在这个序列中。
如序列:3,1,2,1,5,1,2。其中1就出现3次,2出现2次,3出现1 次,5出现1次。
你的任务是对于给定的正整数序列,从小到大依次输出序列中出现的数及出现的次数。
输入格式
第一行正整数n,表示给定序列中正整数的个数。
第二行是n 个用空格隔开的正整数x,代表给定的序列。
输出格式
若干行,每行两个用一个空格隔开的数,第一个是数列中出现的数,第二个是该数在序列中出现的次数。
样例输入
12
8 2 8 2 2 11 1 1 8 1 13 1... | ALGO | 0.999956 | 3.544846 |
d714cb0f-863a-4e1a-94be-cf29ccb067e4 | chudinhhien/Algorithm | buoi-03/mang-1-chieu-trung-binh/bai30.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, k;
cin >> n >> k;
int a[n];
for(int &x : a) cin >> x;
k = min(k, n-k);
sort(a, a + n);
ll num1 = 0, num2 = 0;
for(int i = 0 ; i < k ; i++){
num1 += 1ll * a[i];
}
for(int i = k ; i < n ; i++){
num2 += 1ll... | ALGO | 0.999956 | 3.783523 |
0c7ef6df-76ea-42a0-be25-4d7863da8a3a | yew1eb/ACM-ICPC | leetcode/Easy/Implement strStr().cpp | class Solution {
public:
int strStr(char *haystack, char *needle) {
int i, j, n = strlen(haystack), m = strlen(needle);
if(!m) return 0;
int *next =(int *)malloc(sizeof(int)*m);
//getNext
i = 0; next[0] = j = -1;
while(i<m){
while(j>=0 && needle[i] != need... | ALGO | 0.999845 | 5.539951 |
1752e772-01c4-409d-90b4-a4a9de165555 | lachaka/IS-Introduction-to-Programming-2019-2020 | playground/solutions/task_04.cpp | #include <iostream>
#include <cstring>
using namespace std;
const int SIZE = 100;
void simplify(char* str);
int main() {
char str[100];
cin >> str;
simplify(str);
cout << str << endl;
return 0;
}
void simplify(char* str) {
int index = 1;
for (int i = 1; i < strlen(str); ... | ALGO | 0.999967 | 5.185604 |
a5b1aa43-ad13-4f51-a3ca-50c54a9b98f3 | scaledrecognition/opencv | modules/calib3d/src/calibration.cpp | #include "precomp.hpp"
#include <stdio.h>
#include <iterator>
/*
This is stright-forward port v3 of Matlab calibration engine by Jean-Yves Bouguet
that is (in a large extent) based on the paper:
Z. Zhang. "A flexible new technique for camera calibration".
IEEE Transactions on Pattern Analysis and Machi... | ALGO | 0.999866 | 5.45092 |
dab121c7-c5ee-4ef4-8d4a-fb45e4d39477 | Subrat29/CrackYourPlacement | Day37/871. Minimum Number of Refueling Stops/sol1.cpp | #include <bits/stdc++.h>
using namespace std;
// tc:
// sc:
int minRefuelStops(int target, int startFuel, vector<vector<int>> &stations)
{
priority_queue<int> pq;
int ret = 0, stationId = 0, range = startFuel;
while (range < target)
{
while (stationId < stations.size() && stations[stationId][0... | ALGO | 0.999838 | 4.702627 |
ebd801b0-f1eb-41cf-8748-b93e2f137ad8 | BetterOIer/competitive-cpp-code-backup | Competition/Competition48/ZJ-454/ZJ-454/dungeon/dungeon.cpp | #include<iostream>
using namespace std;
inline long long read(){
long long x=0,f=1;char c=getchar();
for(;!isdigit(c);c=getchar())if(c=='-')f=-1;
for(;isdigit(c);c=getchar())x=(x<<3)+(x<<1)+(c^48);
return x*f;
}
long long cir[100006],n;
long long MA=9223372036854775807ll;
void dfs(int p1,int p2,long long ma,long lo... | ALGO | 0.999625 | 3.310915 |
4303dc87-91a3-46f3-a51a-763a5fd504b5 | kvdzidev/skillset-portfolio | Understanding of C++ structures/ZAD018_000012_loop.cpp | // ----------- ZAD12 -----------
//(loop) Napisz program, który pobierze z parametrów dwie liczby naturalne w i h, reprezentujące szerokość i wysokość. Wydrukuj prostokąt z gwiazdek o wymiarach podanych w parametrach
//./rectangle 3 4 ➞ WYDRUKUJE:
//***
//***
//***
//***
// ROZWIĄZANIE POCZATEK
#include <iostream>
u... | ALGO | 0.994789 | 4.692366 |
eefbeaf2-1fc4-4e43-b6df-c64f4dfd5109 | mewmintlabs/mewmint | src/rpc/request.cpp | #include <rpc/request.h>
#include <common/args.h>
#include <logging.h>
#include <random.h>
#include <rpc/protocol.h>
#include <util/fs.h>
#include <util/fs_helpers.h>
#include <util/strencodings.h>
#include <fstream>
#include <stdexcept>
#include <string>
#include <vector>
/**
* JSON-RPC protocol. Bitcoin speaks v... | WEB | 0.930972 | 7.540875 |
b9a53080-52af-410c-afee-a1fbfe6d6bb6 | GHANGHASASHWANI/LEETCODE | 1886-minimum-limit-of-balls-in-a-bag/1886-minimum-limit-of-balls-in-a-bag.cpp | class Solution {
public:
bool possible(vector<int> &nums, int mid, int maxOperations){
int total = 0;
for(int i =0; i < nums.size(); i++){
if(nums[i] > mid ) total+= (nums[i] - 1)/mid;
if(total > maxOperations) return 0;
}
return 1;
}
int minimumSize(... | ALGO | 0.999985 | 5.697319 |
3c12edca-10bd-4a2b-9d44-b3d3fd50acba | megkob13/HW1_Q2 | main.cpp | #include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
// AERSP 424 Homework 1: Question 2
// Goal: Write a program to predict roll rate of aircraft
// for up to five seconds and print the result at every time step
int main()
{
// Design aircraft by picking favorite non-zero real numbers for ... | ALGO | 0.999278 | 5.976261 |
57cc93ac-5324-4d3b-9810-5e7c695038ea | ryanburgess173/Associates-Degree-Code | C++Chapter6/C++Chapter6/program1.cpp | // JOHNATHAN R. BURGESS, 10/12/2018
#include <iostream>
#include <string>
using namespace std;
int getProductAndSum(int x, int y, int &sum);
void main() {
int x;
int y;
int sum = 0;
x = 10;
y = 5;
int product = getProductAndSum(x, y, sum);
cout << product << " " << sum << endl;
system("pause");
}
int getPro... | ALGO | 0.986 | 5.223103 |
97a92e00-0c1e-47b2-9d45-29330258d72d | zhangxiaoyang/Lintcode-US-Giants | code/Linked-List/linked-list-cycle.cpp | 描述
判断链表中是否有环。
思路
使用快慢指针,快指针每次都2步,慢指针每次都1步,如果二者相遇,则有环。
代码
/**
* Definition of ListNode
* class ListNode {
* public:
* int val;
* ListNode *next;
* ListNode(int val) {
* this->val = val;
* this->next = NULL;
* }
* }
*/
class Solution {
public:
/**
* @param head: The f... | ALGO | 0.999956 | 5.677681 |
be95cc9c-1ecd-4d85-bc46-493e642a44fe | moucheh/URA-cpp | finals/t1/main.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <iomanip>
/*
data je definicija strukture Element ispod
dobije se std::list sa elementima tipa Element,
sortiranim po kljucu u opadajucem redoslijedu
napisati funkciju potpisa
template<typename K, typename V>
Element<K, V>* ... | ALGO | 0.999188 | 5.180105 |
0fb13d80-6381-4f7b-854a-a25b3f40e13b | ldyorchid/Multi_Angular_Epipolar_Geometry_Based_Light_Field_Angular_Reconstruction_Network | src/_maxpool3d_cpu.cpp | #include "wrapperMx.h"
#include "_maxpool3d_cpu.h"
#include <omp.h>
namespace {
const float VERY_NEGATIVE_NUM = -1e20f;
}
//// impl of public methods
maxpool3d_cpu::maxpool3d_cpu()
{
}
maxpool3d_cpu::maxpool3d_cpu(const maxpool3d &obj)
{
for (int i = 0; i < 6; ++i) pad[i] = obj.pad[i];
for (int i = 0; i < 3;... | TOOL | 0.994715 | 5.896563 |
9e36a044-5b5a-446f-adca-f75a5a07db17 | lukahabus/HONI | 2015-2016/kolo5_zamka.cpp | #include <cstdio>
#include <iostream>
using namespace std;
int zz(int broj)
{
int zbroj = 0, i = 0;
int znamenke[100];
do {
znamenke[i] = broj % 10;
++i;
} while (broj /= 10);
while (--i >= 0)
zbroj += znamenke[i];
return zbroj;
}
int main()
{
int l,d,x,N,M;
... | ALGO | 0.99991 | 3.497484 |
00111a74-32de-4f9c-b91e-61a17e17648e | raincross7/code-similarity | codes/train_code/problem145/problem145_346.cpp | #include <bits/stdc++.h>
#include <string>
#include <vector>
#include <algorithm>
#define rep(i,n) for (int i = 0;i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int INF = 1e9;
int dist[105][105];
char grid[105][105];
int dp[105][105];
int main(){
int h,w;cin >> h >> w;
rep(i,... | ALGO | 0.999746 | 4.24956 |
30839f89-e2de-4ff3-b344-9df4199b99ce | dward239/Thermodynamics_of_Solution | speciation.cpp | #include "speciation.h"
#include <iostream>
#include <cmath>
#include <limits>
#include <set>
#include <map>
#include <Eigen/Dense>
// === Main Speciation Solver Interface ===
void solveSpeciation(std::vector<AqueousSpecies>& species,
Solution& solution,
const TotalInput& input... | ALGO | 0.999661 | 5.404481 |
b164db69-3b89-4f87-9a92-1a59430970cb | detu/mcadjoint | Code/thirdParty/eigen/test/visitor.cpp | #include "main.h"
template<typename MatrixType> void matrixVisitor(const MatrixType& p)
{
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::Index Index;
Index rows = p.rows();
Index cols = p.cols();
// construct a random matrix where all coefficients are different
MatrixType m;
m... | TEST | 0.925515 | 6.138896 |
2d7d4c68-6b0c-419d-a4db-7932513f4949 | Migue8gl/ED-UGR | relacionArbolesHash/ejercicio02.cpp | #include "bintree.h"
#include <iostream>
#include <stack>
using namespace std;
template <typename T>
int altura(const bintree<T> &arb) {
typename bintree<T>::node aux = arb.root();
int altura = -1, altura_nodo = 0;;
stack<pair<typename bintree<T>::node, int>> pila;
if (arb.empty())
return altura;
pila.push(pa... | ALGO | 0.999367 | 5.275068 |
1947169b-b6fe-490c-9fd8-b328eb75ad19 | gustavothecoder/cp-solutions | URI/C++/uri-1848.cpp | // URI 1848: https://www.urionlinejudge.com.br/judge/en/problems/view/1848
#include <iostream>
using namespace std;
void printAndResetResult(int* result);
void sum(string input, int* result);
int main() {
string input;
int result = 0;
while (getline(cin, input)) {
if (input.compare("caw caw") == 0)
... | ALGO | 0.999117 | 3.736925 |
242971ec-90e0-4c42-8f26-d724cff0cba6 | jigyansunanda/Leetcode-Practice | 0297-serialize-and-deserialize-binary-tree/0297-serialize-and-deserialize-binary-tree.cpp | class Codec {
private:
string serialize(TreeNode* root, string& s) {
if (root == NULL) {
s += "$,";
} else {
s += to_string(root->val) + ",";
serialize(root->left, s);
serialize(root->right, s);
}
return s;
}
TreeNode* getTree(... | ALGO | 0.999392 | 6.1016 |
898b2289-8d3c-4ec7-9bf7-829435cdd20e | Xelerezex/languages-playground | C++/С++17-STL-J-Galowicz/chapter-09-concurrency/10-few-manuf-consum/10-few-manuf-consum-0.cpp | #include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <queue>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <chrono>
using namespace std;
using namespace chrono_literals;
struct pcout : public stringstream
{
static inline mutex cout_mutex;
~pcout()
... | TOOL | 0.940361 | 4.650007 |
833c2131-bf2b-42ed-ba01-8d70ae6b6daf | WafiFz/Semester-1 | Praktikum 2/latihan5.cpp | /*
Nama : Wafi Fahruzzaman
NPM : 140810200009
tangggal : 20 September 2020
deskripsi: Pebanding 3 Bilangan
*/
#include <iostream>
using namespace std;
int main(){
int a, b, c, menang, kalah;
cout << "Tim ke-1\t: ";
cin >> a;
cout << "Tim ke-2\t: ";
cin >> b;
if(a>b){
cout << "Hasil dari p... | ALGO | 0.99961 | 3.406301 |
23f859f6-1d75-4ea3-b3b4-c8b1ed5cae17 | lwyeluo/ScriptChecker | third_party/swiftshader/third_party/llvm-subzero/lib/Support/StringRef.cpp | #include "llvm/ADT/StringRef.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/edit_distance.h"
#include <bitset>
using namespace llvm;
// MSVC emits references to this into the translation units which reference it.
#ifndef _MSC_VER
const size_t StringRef::npos;
#endif
static char ascii... | TOOL | 0.964218 | 7.693246 |
bb251cfa-ff22-4eb4-a2c7-7f8d5d34304b | adityasrathore/Codes | LeetCode/1901. Find a Peak Element II.cpp | class Solution {
public:
vector<int> findPeakGrid(vector<vector<int>>& mat) {
int m=mat[0].size();
int n=mat.size();
int s=0;
int e=m-1;
while(s<=e){
int mid=s+(e-s)/2;
int row=0;
for(int i=0;i<n;i++){
if(mat[row][mid]<mat[i... | ALGO | 0.999983 | 5.845311 |
c84a6c9c-3d9b-41b6-98b1-f3ff25ba07cd | rithikasapparapu/LeetCode | 0088-merge-sorted-array/0088-merge-sorted-array.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
vector<int> result;
int i = 0, j = 0;
while(i<m && j<n){
if(nums1[i] < nums2[j]){
result.push_back(nums1[i]);
i++;
}
else if(nums1[i... | ALGO | 0.999987 | 5.322821 |
f54187c9-6f81-4cd5-81f7-957a94fd2598 | csiimnida/codetree-TILs | 240721/전화번호 바꾸기/change-phone-number.cpp | #include <iostream>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
int a,b;
cin.get();
cin.get();
cin.get();
cin.get();
cin >> a;
cin.get();
cin >> b;
cout << "010-" << b << "-" << a;
return 0;
} | ALGO | 0.920907 | 4.124613 |
aed352a3-2a02-4fd0-82f5-a19ec31a5fa2 | Sunil-0507/LeetCode-Playground | 344-reverse-string/reverse-string.cpp | class Solution {
public:
void reverseString(vector<char>& s) {
int start=0;
int end=s.size()-1;
while(start<end){
char temp=s[start];
s[start]=s[end];
s[end]=temp;
start++;
end--;
}
}
}; | ALGO | 0.999441 | 6.13834 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.