uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
38aa8237-2650-4c7e-be53-447755b2ce75 | bolatov/contests | codechef.com/GCDQ.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <cstdio>
using namespace std;
int gcd(int a, int b) {
while (b)
b ^= a ^= b ^= a %= b;
return a;
}
int main(int argc, char const *argv[]) {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);... | ALGO | 0.999959 | 3.843592 |
7ecd9d1f-a283-425b-8a61-442bc9b5013b | eber10/ejercicios_recursividad | recursion1.cpp | #include<iostream>
using namespace std;
int potencia(int n, int m)
{
if(m==0)
{
return 1;
}
else
{
return n*potencia(n, m-1);
}
}
int main()
{
int n, m;
cout<<"ingrese la base:"; cin>>n;
cout<<"ingrese el exponente:"; cin>>m;
cout<<"potencia:"<<potencia(n,m)<<endl... | ALGO | 0.999925 | 4.385332 |
627143c8-5a20-4b7d-9108-0ffc8209be03 | saurav3199/DPproblems | 3_fibonacci.cpp | #include <bits/stdc++.h>
using namespace std;
// in-short-use macros
#define all(c) (c).begin(),(c).end()
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define PI 3.14159265
#define sizes 1000010
//main function ... | ALGO | 0.999993 | 4.416641 |
e773d8db-469b-4a64-8bb0-c6e69a3b14f7 | chiralcentre/Kattis | loworderzeros.cpp | #include <bits/stdc++.h>
int memo[1000001], n;
// credits to https://math.stackexchange.com/questions/130352/last-non-zero-digit-of-a-factorial for solution
int D(int n) {
if (memo[n] != -1) return memo[n];
// check if tens digit of N is even or odd;
int t = (n % 100) / 10, u = n % 10;
memo[n] = (t % ... | ALGO | 0.999638 | 4.328789 |
5fe3013e-7541-4b12-824b-3ba2ffb0cc80 | Dienicx/CodigosDeAlgoritmia | listaProblemas_2021_2_Nivel1/Numeros al cubo.cpp | #include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main () {
int r,x;
cin >>x;
r= pow(x,3)/2;
cout << r;
return 0;
} | ALGO | 0.998906 | 3.200675 |
21ebf65b-d28e-4ee6-8daa-922484283d61 | mazenbatrawi/LeetCode | valid-anagram/valid-anagram.cpp | class Solution {
public:
bool isAnagram(string s, string t) {
sort(s.begin(), s.end());
sort(t.begin(), t.end());
return s == t;
}
}; | ALGO | 0.999966 | 6.297177 |
49333737-83f7-4ec2-ac17-df2f18e06835 | ishandutta2007/codeforces | emorgan5289/normal/1352/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define inf_ll 1000000000000000000ll
#define inf_ull 1000000000000000000ull
#define ll long long
#define ull unsigned long long
#define all(x) (x).begin(), (x).end()
#define pb push_back
#ifdef ONLINE_JUDGE
#define debug(...)
#else
#include "../../d... | ALGO | 0.99956 | 3.601591 |
c42c4aa7-e7e5-49a5-9c11-8c1ee6f314f3 | pratham022/LeetCode-Practice | 19-remove-nth-node-from-end-of-list/19-remove-nth-node-from-end-of-list.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:
int count(ListNode* h... | ALGO | 0.999956 | 6.184591 |
5ba378ed-f55c-4e70-9791-7184f92d3c43 | sahil0907/SortingDSAcpp | insertionSort.cpp | #include <iostream>
using namespace std;
void insSort(int array[], int size)
{
int temp;
for (int i = 1; i < size; i++)
{
temp = array[i];
int j = i - 1;
// With while loop
while (array[j] >= 0)
{
if (array[j] > temp)
{
array[... | ALGO | 0.999982 | 4.626357 |
b1e92e6a-b6a2-4967-8691-dd8b437a95f3 | itkingnb/cf-atc-and-so-on | template/max_flow(dinic).cpp | #include<bits/stdc++.h>
using namespace std;
#define N 210
#define ll long long
struct e
{
int to;
ll c;
int ne;
}adj[10010];//边要两倍m因为还有反向边
int h[N],d[N],cur[N];//第一条出边;d是第几层;cur是出边
int idx=1;
int n,m,s,t;//s开始,t结束
void add(int a,int b,int c){
adj[++idx]={b,c,h[a]};
h[a]=idx;
}
bool bfs(){
mems... | ALGO | 0.999843 | 4.771063 |
78427496-a51d-4098-b5c4-bb93aa500b6c | coolait/safe-driver | 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.998764 | 6.762122 |
df9e4e52-861f-4c43-bbbd-42e6b5c6ad05 | poojaasinghhh/DSA-PRACTICE | Easy/Palindrome String/palindrome-string.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int isPalindrome(string S)
{
// Your code goes here
int n=S.size();
int i=0;
while(i<n/2){
if(S[i]!=S[n-i-1]){
return 0;
... | ALGO | 0.999467 | 5.875711 |
4ba9d6d2-528a-477b-a9f8-07686c9f7b88 | heavenMOJANG/ICPC | programmes_C_Cpp/luogu/【数学2-3】概率与统计/P1365 WJMZBMR打osu!.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define int long long
#define double long double
using namespace std;
constexpr int inf=0x7fffffff;
void solve(){
int n;cin>>n;
string s;cin>>s;
double res=0.0,c=0.0;
for(int i=0;i<n;++i)
... | ALGO | 0.999833 | 4.03602 |
7b4ebeed-73e3-4b87-a45c-1f996d06fc27 | ishandutta2007/codeforces | ylwang/normal/1178/H.cpp | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define FI(n) FastIO::read(n)
#define FO(n) FastIO::write(n)
#define ull unsigned long long
#define mst(a,b) memset(a,b,sizeof(a))
#define foR(i,k,j) for(int i=(k);i>=(j);i--)
#define... | ALGO | 0.999992 | 4.118034 |
f5c0e18f-21fc-4db8-86e0-b72a533c1262 | SD691/DSA | 73-set-matrix-zeroes/set-matrix-zeroes.cpp | class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
vector<int> row,col;
for(int i=0; i<matrix.size(); i++){
for(int j=0; j<matrix[0].size(); j++){
if(matrix[i][j]==0){
row.push_back(i);
col.push_back(j);
... | ALGO | 0.999181 | 6.461683 |
e1156870-57b9-48f1-9ce8-507605453adb | yudinikita/cpp-learning | final_solution_C++/009_следующая-дата-и-високосный-год.cpp | #include <iostream>
using namespace std;
bool FooLeapYear(int yearF) // год високосный или нет
{
if(((yearF % 4 == 0) && (yearF % 100 != 0)) || (yearF % 400 == 0) )
{
return true;
}
return false;
}
bool FooCheckCorect(int dayF, int monthF) // проверка на ошибки
{
if (dayF > 31 || dayF < 0 ||
monthF > 12 || m... | ALGO | 0.999225 | 3.728963 |
70492ff5-caf2-4be8-a272-f2b110547d3c | kot0ffskiy/growthpath | Algorithms/3-rd contest/B_solution.cpp | #include <iostream>
class AVL {
private:
struct Node {
Node* left = nullptr;
Node* right = nullptr;
int key = -1;
int height = 0;
};
Node* root_ = nullptr;
static int Height(Node* node);
static int DeltaH(Node* node);
static void CountH(Node* node);
static Node* RightRotate(Node* node);
... | ALGO | 0.999997 | 4.731372 |
9166d9c2-e359-46ed-9c0c-6e7933194a27 | Soreg404/dns | src/start.cpp | #include "dns.h"
#include "incl.h"
#pragma region memory tracking
size_t total_allocated = 0;
struct Mem {
~Mem() {
LOG("total allocated: %zu", total_allocated);
};
};
//#define MEM_LOG
_NODISCARD _Ret_notnull_ _Post_writable_byte_size_(_Size) _VCRT_ALLOCATOR
void *__CRTDECL operator new(size_t _Size) {
total_al... | WEB | 0.85572 | 5.52364 |
ff7acc37-2b26-4ab8-a9e9-d5f5240fd924 | SmridhiSoni/CRUD-Operations | myproject/src/components/ST2PA/ST2PA/SumOFoddAndEven.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
int sum_even=0;
int sum_odd=0;
for(int i=0;i<n;i++){
if(arr[i]%2==0){
sum_even+=arr[i];
}else{
sum_odd+=arr[i];
}
}
cout<<sum_even<... | ALGO | 0.999894 | 4.075723 |
eca40131-3a5d-47e4-912e-684ea045766f | FirestormViewer/3p-boost | boost/libs/histogram/examples/getting_started_listing_04.cpp | // clang-format off
//[ getting_started_listing_04
#include <algorithm> // std::max_element
#include <boost/format.hpp> // only needed for printing
#include <boost/histogram.hpp> // make_histogram, integer, indexed
#include <iostream> // std::cout, std::endl
#include <sstream> // s... | ALGO | 0.982206 | 6.433354 |
eac1832d-2a38-4730-ad3a-1121dae39b6f | FloorVerhoeven/libiglVR | python/py_igl/copyleft/cgal/py_remesh_self_intersections.cpp | m.def("remesh_self_intersections", []
(
const Eigen::MatrixXd& V,
const Eigen::MatrixXi& F,
const igl::copyleft::cgal::RemeshSelfIntersectionsParam& params,
Eigen::MatrixXd& VV,
Eigen::MatrixXi& FF,
Eigen::MatrixXi& IF,
Eigen::MatrixXi& J,
Eigen::MatrixXi& IM
)
{
assert_is_VectorX("J", J);
assert_is_VectorX(... | ALGO | 0.936492 | 6.076975 |
4969c2ba-c096-4c82-8dbe-d0c26a9308b3 | polaris/sol | src/Utilities.cpp | #include "Utilities.h"
namespace sol {
Eigen::Vector3f randomInUnitSphere() {
Eigen::Vector3f p;
do {
p = 2.0 * Eigen::Vector3f(drand48(), drand48(), drand48()) - Eigen::Vector3f(1, 1, 1);
} while (p.dot(p) > 1.0);
return p;
}
Eigen::Vector3f randomInUnitDisk() {
Eigen::Vector3f p;
do... | TOOL | 0.976707 | 6.090185 |
420ebb8d-5424-4323-bb0c-fa36dd5dcfb0 | limaraujo/Study-of-C-plus-plus | Data Structures and Algorithm Analysis/EPs/EP01/EP1.cpp | #include <iostream>
using namespace std;
void merge(string arr_nomes[], int arr_notas[], int arr_idades[], int inicio, int fim, int n);
void mergesort(string arr_nomes[], int arr_notas[], int arr_idades[], int inicio, int fim, int n);
int main(){
int cargos; cin >> cargos;
for(int c = 0; c < cargos; c++){
... | ALGO | 0.99901 | 3.705429 |
3eb7685c-b1a6-481d-93a7-e7996834187b | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/10/1030/personal_submission/cf621c_kokomi.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
typedef long long ll;
struct node{
ll l, r;
}a[N];
ll count_multiples(ll l, ll r, ll p){
if(l % p == 0){
return r / p - l / p + 1;
}else{
return r / p - l / p;
}
}
int main(){
ios::sync_with_stdio(false);
cin.ti... | ALGO | 0.999052 | 3.894625 |
7a59b6f1-6aec-46bf-916f-6ea1497c35a9 | Avninder99/LeetCode_GFG_Solutions | 0347-top-k-frequent-elements/0347-top-k-frequent-elements.cpp | class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k) {
unordered_map<int, int>numToFreq;
unordered_map<int, vector<int>>freqToNum;
for(auto itr: nums){
numToFreq[itr]++;
}
for(auto itr: numToFreq){
freqToNum[itr.second].... | ALGO | 0.999993 | 6.224155 |
2807649b-243c-431b-b4a2-71afee477b7b | truongnh16072000/C- | ctdl/bai71.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
ll a[10000005],b[10000005],cnt;
vector<bool> check;
void search(int k)
{
cnt=0;
for (int i=0;i<n;i++)
{
if (b[i]==k)
{
check[i]=true;
break;
}
else
if (check[i]==f... | ALGO | 0.999803 | 3.799531 |
142c6a7b-cc33-41ab-9689-509578c40b5a | KhaiJP/AtCoder | ABC/<400/332/C++/B.cpp | #include<iostream>
using namespace std;
int K, G, M, g, m;
int main(){
cin >> K >> G >> M;
while(K--){
if(g == G){
g = 0;
}else if(m == 0){
m = M;
}else{
if(G - g >= m){
g += m;
m = 0;
}else{
m -= G-g;
g = G;
}
}
}
cout << g << ' ' ... | ALGO | 0.999937 | 3.253732 |
325c524a-a58d-4ccc-81b8-51e259076de7 | WadekarPrashant/DSA | CodeHelp-DSA-Busted-Series-main/Lecture065 Tree Interview Questions Day3/maxSumNonAdjacentNodes.cpp | // { Driver Code Starts
//Initial Template for C++
#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;... | ALGO | 0.999911 | 6.876445 |
ebb989ed-0e65-416b-aaed-6b0525a70829 | atanasovRazvan/University | Anul_3/Semestrul 1/PPD programare paralela si distribuita/PPD_Lab3/MPI/MPI/MPI.cpp | #include <iostream>
#include <mpi.h>
using namespace std;
#define MAX 20
int main(int argc, char* argv[])
{
int error, id, p, chunk, len;
int a[MAX], b[MAX], c[MAX];
MPI_Status status;
//init MPI
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &p);
MPI_Comm_rank(MPI_COMM_WORLD, &i... | ALGO | 0.999838 | 3.319444 |
cbe5ae6b-86fc-474c-a71d-928c7efa3b71 | zeroplusone/AlgorithmPractice | Leetcode/1244. Design A Leaderboard.cpp | class Leaderboard {
public:
Leaderboard() {
}
void addScore(int playerId, int score) {
if(m.count(playerId)!=0) {
auto it=lower_bound(scores.begin(), scores.end(), m[playerId]);
*(it)=m[playerId]+score;
} else {
scores.push_back(score);
}
... | ALGO | 0.998637 | 5.76861 |
c2cb7c07-a205-4bbe-b7dd-0226e80078ab | OddEssA/BambuStudio-SoftFever | src/libigl/igl/loop.cpp | #include "loop.h"
#include <igl/adjacency_list.h>
#include <igl/triangle_triangle_adjacency.h>
#include <igl/unique.h>
#include <vector>
template <
typename DerivedF,
typename SType,
typename DerivedNF>
IGL_INLINE void igl::loop(
const int n_verts,
const Eigen::PlainObjectBase<DerivedF> & F,
Eigen::Spars... | ALGO | 0.998122 | 5.897307 |
6b8585cd-757f-4158-a1a6-cdfa06f7c78c | Gajendra-Saini/Dsa-Playlist-15-day-Series- | day 10/constructor.cpp | // We need constructors because there is some value in function before we declare it so we need to put some value in it
#include <iostream>
using namespace std;
class rectangle
{
private:
int length;
int breadth;
public:
int setlength(int l)
{
if (l >= 0)
{
length = l;
... | TOOL | 0.883004 | 4.207978 |
b63ead93-aff7-4521-9b4d-9c12dcaf0177 | alvinpiter/competitive-programming | KickStart/2020/C/perfect.cpp | #include<bits/stdc++.h>
using namespace std;
#define LL long long int
#define MAXN 100000
#define MAXA 100
#define OFFSET 10000000
int T, N, prefixSum, cnt[2 * OFFSET + 3];
LL answer;
int main() {
scanf("%d", &T);
for (int cases = 1; cases <= T; cases++) {
scanf("%d", &N);
for (int i = -MAXA*... | ALGO | 0.998983 | 3.8798 |
c7a29205-77a9-4708-9794-b3abedb8c2e3 | VanirAOSP/external_skia | src/utils/SkCubicInterval.cpp | #include "SkCubicInterval.h"
static SkScalar eval_cubic(SkScalar c1, SkScalar c2, SkScalar c3,
SkScalar t) {
return SkScalarMul(SkScalarMul(SkScalarMul(c3, t) + c2, t) + c1, t);
}
static SkScalar find_cubic_t(SkScalar c1, SkScalar c2, SkScalar c3,
SkScalar t... | ALGO | 0.99745 | 5.753456 |
40762399-e5e8-48cc-a81e-b5c75c2dfa7d | priyankagaikwad0025/Programs-c_cpp_java | program174.cpp | #include<iostream>
using namespace std;
int CountL(char str[])
{
int iCnt = 0;
while(*str != '\0')
{
if(*str == 'l')
{
iCnt++;
}
str++;
}
return iCnt;
}
int main()
{
char Arr[20];
int iRet = 0;
cout<<"Enter string"<<endl;
cin.getline(Ar... | ALGO | 0.998542 | 3.314865 |
e3ce9029-5012-4443-bbb1-99f9daceec91 | qq1045551070/LoadDriver | LoadDriver/mm.cpp | #include "mm.h"
#include "kernel.h"
#include "pml4.h"
#include <ntimage.h>
extern "C"
{
/*
from windows explorer
*/
_Use_decl_annotations_
bool Mm::_memcpy(IN PVOID address, IN PVOID target_address, IN ULONG length)
{
bool result = false;
PHYSICAL_ADDRESS physicial_address;
physicial_address = MmGetPhys... | TOOL | 0.932527 | 3.180177 |
cb2677ee-d024-4f2f-ad4b-5176e0e568e9 | ntuhpc/sc17-lammps | machines/lammps-10Mar16/src/MANYBODY/fix_qeq_comb.cpp | /* ----------------------------------------------------------------------
Contributing authors: Ray Shan (Sandia, <EMAIL>)
------------------------------------------------------------------------- */
#include <mpi.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "pair_comb.h"
#include "pair_com... | ALGO | 0.986894 | 5.507668 |
0ffd4d51-1efe-4bd9-9520-1f0ab7f6ff23 | chinoxyz/Spoj | SQDANCE.cpp | #include <cstdio>
#include <algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include <complex>
#include <iostream>
#include <valarray>
#include<cstring>
#include<queue>
#include<bitset>
#include<map>
#include<set>
#include<sstream>
#include<ctime>
#include <stack>
#include <iomanip>
#include <cassert>
... | ALGO | 0.999607 | 3.608718 |
5dee0f49-920d-4bda-8674-b3d354819472 | sqmedeiros/sblp2023-time-vs-energy | 1084-Apartments/c++/rand30/3997375.cpp | #include <bits/stdc++.h>
using namespace std;
int solve(int people[], int apart[], int n, int m, int k){
int i=0, j=0, res = 0;
while(i<n && j<m){
if(abs(people[i] - apart[j])<=k){
i++; j++;res++;
}
else if(people[i] > apart[j])
j++;
else
i+... | ALGO | 0.999981 | 4.212841 |
a0df55dc-69b4-4e50-929a-3c5b71612dc4 | Napster653/uc3m-arquitectura_de_computadores-p2 | bad/seq.cpp | #include <iostream>
#include <random>
#include <stdlib.h>
#include <math.h>
using namespace std;
/**
* Clases:
* Asteroide
* Planeta
* Rayo
*/
class Asteroide
{
double pos_x, pos_y, vel_x, vel_y, acc_x, acc_y, ast_m;
public:
// Constructor vacío
Asteroide()
{
pos_x = 0; // Coordenada x
pos_y = 0; //... | ALGO | 0.99922 | 3.809116 |
7cf647b7-3fdf-4430-98b3-6ee62f936c65 | Chris1221/mchg | lib/boost_1_61_0/libs/math/example/find_location_example.cpp | // find_location.cpp
// Example of finding location (mean)
// for normal (Gaussian) & Cauchy distribution.
// Note that this file contains Quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
//#ifdef _MSC_VER
//# pragma warning(disable: 4180) // qualifier has no effe... | ALGO | 0.999713 | 6.345707 |
bd08960e-c4d4-4411-922b-f661012ff95e | GunjanShakya/DSA | Two sums.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target)
{
vector<int>ans;
unordered_map<int,int>mpp;
for(int i=0;i<nums.size();i++)
{
if(mpp.find(target- nums[i])!= mpp.end())
{
ans.push_back(mpp[target-nums[i]]);
... | ALGO | 0.999928 | 6.191022 |
4cedfdb5-5a61-4072-ae7e-501446ebc061 | Yarrakhyathisree/C-Programmes | pattern/sem-1 unit-1/areandvolumeofcone.cpp | #include<stdio.h>
int main()
{
/* C Programme for area and perimeter of a cone*/
int r,h,area,volume,pie=3.14,l;
printf("area of a cone:");
scanf("%d%d",&area,&volume);
area=pie*r*(r+l);
printf("area of a cone=%d",area);
printf("volume of a cone:");
volume=1/3*pie*r*r*h;
printf("volume of con... | ALGO | 0.994762 | 3.106853 |
00fdbf1b-2b56-4afe-bfd6-728ff1db296d | goldcoin/goldcoin-0.7.5 | BuildDeps/deps/boost/libs/spirit/example/qi/compiler_tutorial/calc3.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// A calculator example demonstrating the grammar and semantic actions
// using phoenix to do the actual expression evaluation. The parser is
// essentially an "interpreter" that evaluates expressions on the fly.
//
// [ JDG June 29,... | ALGO | 0.957414 | 7.516595 |
47727ae4-11e4-4df2-b5df-96006677cfd5 | Erdaulet0341/2Course_1Semester | Algorithm/Midterm(10.29.2022)/A.cpp | #include <bits/stdc++.h>
using namespace std;
struct node{
int val;
node *left;
node *right;
node(int x){
val = x;
left = NULL;
right = NULL;
}
};
node *insert(node *root, int n){
if(root == NULL){
root = new node(n);
return root;
... | ALGO | 0.999957 | 4.488079 |
0f0d8425-9120-495d-99d4-3df221462ff5 | AnmoolKumar/CPP | Practical-8/task-7/code_V1.cpp | #include <iostream>
using namespace std;
void swap(int,int);
int main()
{
int a=10,b=20;
cout<<"\nBefore Swapping, A = "<<a<<"\tB = "<<b<<"\n";
swap(a,b);
}
void swap(int a,int b)
{
int c;
c=a;
a=b;
b=c;
cout<<"After Swapping, A = "<<a<<"\tB = "<<b<<... | ALGO | 0.99898 | 3.655404 |
a01e7da4-ef6a-4bc4-b92f-60e5353c4806 | AnishAggarwal71/cpp_basics | Vectors/CopyAndOstreamIterator.cpp | #include <algorithm>
#include <vector>
#include <iterator>
#include <iostream>
using namespace std;
int main()
{
int intArray[] = {5, 6, 8, 3, 40, 36, 98, 29, 75};
vector<int> vecList(9);
ostream_iterator<int> screen(cout, " ");
cout << "intArray: ";
copy(intArray, intArray + 9, screen);... | ALGO | 0.998881 | 3.687367 |
88c5edbc-f950-4600-b7e1-1b2e08552b3f | ImShubhK/CPP-Leetcode | C++/905. Sort Array By Parity.cpp | class Solution {
public:
vector<int> sortArrayByParity(vector<int>& nums) {
vector<int>res;
for(auto i:nums)
if(!(i&1))
res.push_back(i);
for(auto i:nums)
if(i&1)
res.push_back(i);
return res;
}
}; | ALGO | 0.999995 | 5.525154 |
252268a0-0f3b-41f3-b4e9-ab2aaffa25ba | Lotuses-robot/Codes | Codeforces/Contest/1851/B/B.cpp | template<typename T>
void read(T &r) { r = 0; static char ch, last; ch = getchar(), last = 'z'; while (ch < '0' || ch > '9') last = ch, ch = getchar(); while (ch >= '0' && ch <= '9') r = (r << 1) + (r << 3) + (ch ^ 48), ch = getchar(); r = (last == '-') ? -r : r; }
template<typename T, typename...Ts>
void read(T &arg, ... | ALGO | 0.999955 | 4.119326 |
c071a621-7348-42e1-a171-ae0e7d6fcd3e | lucas-prtt/Practica | C++-Practica/2023/Apareo y CC con E dinamicas/Apareo.cpp | #include <iostream>
#include <conio.h>
struct nodolista
{
int dato;
nodolista *sig;
};
void apareo(nodolista *input1, nodolista *input2, nodolista *&output);
void insertar(nodolista *&lista, int numero);
void mostrar(nodolista *lista);
void agregar(nodolista *& lista, nodolista *&puntero, int a);
using names... | ALGO | 0.999118 | 3.735559 |
200b29bd-13f2-4208-82cb-e421c8a465a9 | biswa-git/Neural_Net_Graph | thirdParty/eigen-3.3.9/doc/examples/TutorialLinAlgInverseDeterminant.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
A << 1, 2, 1,
2, 1, 0,
-1, 1, 2;
cout << "Here is the matrix A:\n" << A << endl;
cout << "The determinant of A is " << A.determinant() << endl;
cout << "The inverse of A is:\n... | ALGO | 0.999561 | 4.186114 |
231f1a31-7a0b-4bb1-b9ae-322703a2e170 | ia2407-114/112-1-junior-college-C-plus-plus-program | 1111134026/π/ConsoleApplication1/ConsoleApplication1/ConsoleApplication1.cpp | // ConsoleApplication1.cpp : 此檔案包含 'main' 函式。程式會於該處開始執行及結束執行。
//
#include <iostream>
#include<stdint.h>
int main()
{
int value , i;
double result = 4.0;
printf("please input the number of terms:");//輸入的次數
scanf_s("%d", &value);
for (i=2; i <= value;i++)
{
printf("%lf\n", result);
if (!(i % 2))
result -= 4... | ALGO | 0.999799 | 3.543256 |
5fc04159-b53e-41c8-9dd8-1fa5d7ecbaef | vikriza/Code-Kelas-12 | Algoritme Pencarian Acak.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
double fungPoli(double a, double b, double c, double d, double x) {
return a * x * x * x + b * x * x + c * x + d;
}
double penAcak(double a, double b, double c, double d, double awal, double akhir, int iterasi) {
srand(time(0));
... | ALGO | 0.99995 | 4.833295 |
f1804164-d4f2-401a-b551-455b7459e72d | sbswarna/CodeForces | B. Sorted Adjacent Differences.cpp | #include<bits/stdc++.h>
using namespace std;
long long tst,n,a[100003];
int main()
{
cin>>tst;
while(tst--)
{
cin>>n;
for(long long i=0;i<n;i++)
{
cin>>a[i];
}
sort(a,a+n);
for(long long i=0;i<n;i++)
{
cout<<a[i]<<" ";
}... | ALGO | 0.999435 | 3.415644 |
0c55645d-c792-477e-9317-84b9e9053b32 | fupengfei058/algorithm | Leetcode/5. Longest Palindromic Substring.cpp | /*Longest Palindromic Substring:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.*/
class Solution {
public:
string longestPalindrome(string s) {
int max_len = 0;
string res = "";
int ls = s.size();
int i, j, k;
... | ALGO | 0.999918 | 5.68795 |
73fdb17e-a581-4fd2-8052-15f01237c210 | UnnamedOrange/OI | Problems/谈一类树的计数/source/std/tree2.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <list>
typedef int INT;
using std::cin;
using std::cout;
using... | ALGO | 0.999954 | 4.452352 |
1a6cfd48-8f07-4a42-a370-001b5e96593d | wang264/leetcode_cpp | src/easy_questions/q104_maximum-depth-of-binary-tree.cpp |
#include<./treenode.h>
#include <algorithm> // std::max
class Solution {
public:
int maxDepth(TreeNode* root) {
if (!root) {
return 0;
} else {
return 1+std::max(maxDepth(root->left), maxDepth(root->right));
}
}
}; | ALGO | 0.999687 | 6.241452 |
89ac9083-3953-4cd6-a186-be5b98caec30 | jazzman7883/morethantechnical | opencv_ar/opencv_ar/opencv_ar.cpp | // opencv_ar.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
/*
* alg:
* - get features to track
* - extract feature's SURF
* - get homography to known image
* - track features
* * get new features...
*/
//int _tmain(int argc, _TCHAR* argv[])
//{
// return 0;
//}
/*
* A Demo to O... | ALGO | 0.997232 | 4.442517 |
0d7e8360-1491-4cd6-a590-3c3fc46156f8 | chm994483868/HMDailyLearningRecord | OfferReview/OfferReview/01_38/14_CuttingRope/CuttingRope_1.cpp | #include "CuttingRope_1.hpp"
int CuttingRope_1::maxProductAfterCutting_solution1(int length) {
if (length < 2) {
return 0;
}
if (length == 2) {
return 1;
}
if (length == 3) {
return 2;
}
int* products = new int[length + 1];
products[0] = 0;
products[1] =... | ALGO | 0.994263 | 4.170882 |
8054fb19-b517-425f-a2d6-1f2c051818e1 | nitin06890/DSA-sourcecode | DP/Boolean Parenthesization.cpp | // OJ: https://practice.geeksforgeeks.org/problems/boolean-parenthesization5610/1
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int mod = 1003;
unordered_map<string, int> dp;
int solve(string &s, int i, int j, bool isTrue)
{
if (i > j)
return 0;
if ... | ALGO | 0.999993 | 5.706681 |
ad0877cb-dab2-4486-84a4-706819333a73 | Torresfer2004/Examen2Parcial | arreglodecinconumero.cpp | //Programa:arreglodecinconumero
//autor:Fernanda Torres
//fecha:2023-11-24
#include <iostream>
using namespace std;
int main() {
int numeros[5];1
int suma = 0;
int i = 0;
do {
cout << "Ingresa el valor para el elemento " << i + 1 << ": ";
cin >> numeros[i]; ... | ALGO | 0.994574 | 3.815732 |
f905d3ec-8e6c-4a68-8aa9-e6dc54a625e7 | ZCube/boost-cmake | libs/numeric/odeint/performance/SIMD/roessler_simd.cpp | #include <iostream>
#include <vector>
#include <random>
#include <boost/timer.hpp>
#include <boost/array.hpp>
#include <boost/numeric/odeint.hpp>
#include <boost/simd/sdk/simd/pack.hpp>
#include <boost/simd/sdk/simd/io.hpp>
#include <boost/simd/memory/allocator.hpp>
#include <boost/simd/include/functions/splat.hpp>
#... | ALGO | 0.999921 | 5.771973 |
a202291e-b740-41b3-bd77-e46403eb9f17 | vildemf/FYS3150 | project5/Diffusion_MC_continuous/lib.cpp | /*
** The library program module
** lib.cpp
**
TID time_step(int num)
** calculates start and stop time and returns the difference.
** Input data:
** int number = 1 for start - zero return values
** = 2 for... | ALGO | 0.999942 | 3.133128 |
d7cc0c86-c2d6-4434-a480-188ab9b124cb | machip3r/CowHideCircles | cpp/openGA/examples/so-init-solutions/example_so-init-solutions.cpp | #include <string>
#include <vector>
#include "openGA.hpp"
#include <fstream>
#include <sstream>
#include <iomanip>
/*************************************************
This is an example of using openGA with the given
user initial solutions.
*************************************************/
struct MySolution
{
std::... | ALGO | 0.99994 | 7.084984 |
859c37ce-29cb-465f-bc1c-fc22f1a06f09 | tanzeyl/Self-Study | Data Structures/Greedy Algorithms/kruskals.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<pair<int, pair<int, int>>> kruskals(vector<pair<int, pair<int, int>>>, int v);
int find(int, int []);
void unionByWeight(int, int, int []);
int main()
{
vector<pair<int, pair<int, int>>> graph, res;
int v, e, s, d, w, sum = 0;
... | ALGO | 0.999984 | 4.700779 |
2fdea6cd-1398-4c23-92df-f49d81a5daa8 | yerasiito/Ingenieria-Informatica-UGR | 2ºCurso/SegundoCuatri/ALG/Practicas/Practica4/matrices-de-conveniencia/funciones.cpp | /*
* File: main.cpp
* Author: yerasito
*
* Created on 5 de mayo de 2022, 15:48
*/
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <iterator>
#include <vector>
#include <algorithm>
using namespace std;
void fuerzaBruta(vector<vector<int>> M, vector<int> ... | ALGO | 0.999873 | 4.568344 |
2e749e43-1d9c-456c-b114-77876feb0ee4 | lyr-2000/code | code/1625.执行操作后字典序最小的字符串.cpp | #include <bits/stdc++.h>
using namespace std;
/* clang-format off */
#define print(a) cout << a <<" "
#define printn(a) cout << a << endl
void printa(vector<int> &a) { for(int w:a) print(w); printn("");}
void printa2(vector<vector<int>> &a) { for (auto f:a) printa(f); }
struct TreeNode { int val; TreeNode *left; TreeNo... | ALGO | 0.999966 | 6.458639 |
3aefd011-5b15-4a4e-8fed-ffa156391dee | ishandutta2007/codeforces | joyfun/normal/438/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define sz(x) (int)x.size()
const int N = 100005;
int n, m;
#define lson(x) (x<<1)
#define rson(x) ((x<<1)|1)
struct ND ... | ALGO | 0.999899 | 3.992308 |
2343cab3-3502-488f-8ee5-5b7f70d8f646 | Alinnus1/Data-Structures-Problems | Inv/main.cpp | #include <iostream>
#include <fstream>
using namespace std;
long merge(long arr[], long left, long mid, long right)
{
long count = 0;
long i, j, k;
//construim arr stang si arr drept
long temp1 = mid - left + 1;
long temp2 = right - mid;
long* L = new long[temp1];
long* R = new long[temp2]... | ALGO | 0.999883 | 3.862659 |
daa29d54-c466-41d2-9af0-3967f5b58397 | josephmansilla/AyEDCursada2023 | Guias/Practica1/Punto18/punto18.cpp | #include <iostream>
#include <cstring>
using namespace std;
string Tendencia(int,int);
int main (){
int primer = 0;
int segundo = 0;
cout << "Ingrese 1er valor: ";
cin >> primer;
cout << "Ingrese 2do valor: ";
cin >> segundo;
cout << Tendencia(primer,segundo);
}
string Tendencia(int A, i... | ALGO | 0.999695 | 4.007091 |
e471018c-71ec-43c4-96fe-aa4b13ca6637 | akashiitj/dsaprogram | graph/codechef/Chef and Digit Jumps.cpp |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
ll mod= 1000000007;
//cout<<fixed<<setprecision(6)<<ans<<"\n";
#define frmlty int test_case;cin>>test_case;while(test_case--)
#define vi vector<int>
#define vs vector<string>
#define vll ve... | ALGO | 0.999977 | 3.383734 |
185b1489-fe03-4e37-ab8f-ca83c62db27f | luojike/comparch | 2021/Autumn/S211000799-孙澄宇/program/Matrix_Strassen.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <vector>
#include <string.h>
#include <immintrin.h>
#include <emmintrin.h>
#define isprint 0
int m,n,k;
double a[2048][2048],b[2048][2048],c[2048][2048];
void gemm(double* matA,double* matB,double* matC,const int M,const int N,const i... | ALGO | 0.999488 | 3.374277 |
3f7fe414-4531-4234-8e5c-d1658a5e4193 | amandeep-saroa/DataStructure-C- | LinkedList1/LinkedList.cpp | #include<iostream>
using namespace std;
// will use Node class to make object of own made data type
#include "Node.cpp"
void print(Node * head) // since address therefore pointer
{
// always create a temprory pointer to keep the address of head and use that only to travel throug linked list
// agr tum head k... | ALGO | 0.995603 | 4.252061 |
25d6b80a-d700-4cb9-be0d-7bffa11fb9de | its-Hitesh/Codeforeces-questions | C_Anton_and_Making_Potions.cpp | #include <bits/stdc++.h>
#include <bits/extc++.h>//
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
using ll = long long ;
#define pb push_back
#define ld long double
#define sz size()
#define foo(i,a,b) f... | ALGO | 0.999942 | 4.025077 |
ddd32f25-b3dd-4c4b-9b1f-ea8478c771b8 | swas-kar/Algorithm_Asg3 | question 2/disjoint_snap_epinions_tree.cpp | #include <iostream>
using namespace std;
#include <fstream>
#include <string>
#include <sstream>
#include <ctime>
#include <cstdint>
//taken from dataset website
const uint64_t num_vertex = 75888; //vertex numbering goes from 0 to 75888
const uint64_t num_edges = 508837; //umber of lines in dataset, will be inly used ... | ALGO | 0.997948 | 3.651105 |
b28571c8-57ef-4039-823f-57c24d874576 | shivamkr022/my-codes | codeforces/codeforces/96A.cpp | #include<iostream>
#include<vector>
#include<string>
#include<climits>
#include<cmath>
#include<algorithm>
#include<unordered_map>
#include<unordered_set>
#ifndef ONLINE_JUDGE
#define debug(x) cout<<"errr---- "<< #x <<" " <<x<<endl
#else
#define debug(x)
#endif
#define endl "\n"
#define int long long int
#define mod ... | ALGO | 0.999789 | 3.749908 |
7e4f4c04-a596-40e5-9cec-0d5965b2025f | aslezar/CompetitiveProgramming | LeetCode/BiWeekly96/_2541.cpp | // 2541. Minimum Operations to Make Array Equal II
#include <iostream>
#include <vector>
using namespace std;
#define el << '\n'
long long minOperations(vector<int> &nums1, vector<int> &nums2, int k)
{
long long count1 = 0;
long long count2 = 0;
if (k < 1)
k *= (-1);
if (k == 0)
{
... | ALGO | 0.999934 | 4.919855 |
5f3e1f68-fe1d-4d4b-92c2-4328eeaa5162 | Sukarnapaul1893/Sukarna-s-Topic-Wise-Problems-Solutions | Segment Tree/SPOJ - KQUERYO.cpp | #include<bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
vector<ll>data[120020];
ll arr[30005];
int query(int at, int L, int R, int l, int r,ll k){
if(r<L || R<l)return 0;
if(l<=L && R<=r){
int cnt = upper_bound(data[at].begin(),data[at].end(),k)-data[at].begin();
... | ALGO | 0.999985 | 4.668031 |
dbfe6526-5ac1-42e6-8a02-cba9e1e037ab | oliveira-sh/mpfs_ga | src/original_classifier/classifier/c_nbayes.cpp | #include <string>
#include "c_nbayes.h"
#include "classifier.h"
extern "C" {
long double nbayes_c(bool mlnp, bool usf,
const char* trainingFile, const char* testFile,
const char* resultFile) {
std::string trainingFile_str(trainingFile);
std::strin... | ALGO | 0.928015 | 4.433913 |
c845bfef-e82e-4de5-911e-cd6514c37ae5 | sapphireHL/CodePractice | 数字在排序数组中出现的次数.cpp | class Solution {
public:
int myLowerBound(vector<int> data, int start, int end, int k){
while(start < end){
int mid = start + (end - start) / 2;
if(data[mid] >= k)
end = mid;
else
start = mid + 1;
}
return start;
}
... | ALGO | 0.999953 | 5.72153 |
951b5bae-7606-4aa2-8f52-6ad1f00c0a64 | ishandutta2007/codeforces | rowdark/normal/154/A.cpp | /*
ID: rowdark1
LANG: C++
PROG:
*/
#include<stdio.h>
#include<stdlib.h>
#include<cstring>
#include<iostream>
#include<ctype.h>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<cmath>
#include<bitset>
#include<iomanip>
#include<complex>
#define ... | ALGO | 0.999981 | 3.492633 |
e6c80a8c-b2b0-4de9-9b77-ce4f0f35a13c | risal-shefin/Competitive-Programming | SPOJ/HORRIBLE.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
ll tree[400009];
ll prop[400009];
void init(ll left, ll right, ll node)
{
if(left == right) {
tree[node] = 0;
prop[node] = 0;
return;
}
ll mid = (left + right) / 2;
init(left, mid, 2 * node);
init(mid + ... | ALGO | 0.999639 | 3.870117 |
3f195ed5-f285-472a-abf3-69bec3439239 | ROCm/rocm-examples | Libraries/rocFFT/real_complex/main.cpp | #include "CmdParser/cmdparser.hpp"
#include "example_utils.hpp"
#include "rocfft_utils.hpp"
#include <hip/hip_runtime_api.h>
#include <hip/hip_vector_types.h>
#include <rocfft/rocfft.h>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
int main(int argc, char* argv[])
{
std::cout << "... | ALGO | 0.87392 | 6.311307 |
8c372bdb-88e5-4260-96d4-9207691f6233 | knuu/competitive-programming | atcoder/abc/abc012_d.cpp | //
// ABC012-D.cpp
//
//
// Created by knuu on 2014/07/12.
//
//
#include <iostream>
#include <algorithm>
#define INF 300000
#define MAX_V 1000
using namespace std;
int d[MAX_V][MAX_V]; // d[u][v]は辺e=(u,v)のコスト(存在しない場合はINF,但しd[i][i]=0)
int V,E; // 頂点数,辺数
void solve();
void warshall_floyd();
int main()
{
cin>>V... | ALGO | 0.99989 | 4.243874 |
a7496377-3264-4297-b8c3-1473c520f444 | SOUMITRO-SAHA/Cpp-DSA-Codes | DSA/02_Stacks & Queues/StackClassForArray.cpp | #include <iostream>
using namespace std;
class stack{
int *data;
int nextIndex;
int capacity;
public:
stack(int totalSize){
data = new int[totalSize];
capacity = totalSize;
nextIndex = 0;
}
// To get the Size of the Stack [Means, How many eleme... | ALGO | 0.977802 | 3.871464 |
58bdb91c-3375-4cb1-b780-28127e1b883e | Nur-Jahan-Smrity/Random-Programmings | 2D vector.cpp | /*
2D vector.cpp
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
vector<vector<int>> vect
{
{1, 2},
{4, 5, 6},
{7, 8, 9, 10}
};
for (int i = 0; i < vect.size(); i++)
{
for (int j = 0; j < vect[i].size(); j++)
{
cout << vect[i][j] << " ";
}
cout << endl;
}
return 0;
}
| ALGO | 0.993556 | 3.611569 |
3d17502c-7f8d-4ecb-8f74-df5c403d4a2d | jmouza/pathfinder | src/pathfinder/src/pathfinder_context.cpp | #include "pathfinder/pathfinder_context.h"
#include <utility>
#include <stdexcept>
void PathfinderContext::SetAlgorithm(std::unique_ptr<PathfinderAlgorithm> &&algorithm) {
algorithm_ = std::move(algorithm);
}
PathfinderResult PathfinderContext::ExecuteAlgorithm(ExecutionParameters parameters) const {
if (!al... | ALGO | 0.994288 | 6.469738 |
eaee64ae-1e46-43b3-9b37-1f4aac33f6f7 | Sabiqun-16/DATA-STRUCTURE_CSE2101_B210101016 | Tree/Binary Tree/Binary tree creat and traverse(Inorder).cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* left;
Node* right;
Node(int value) {
data = value;
left = right = nullptr;
}
};
Node* createNode() {
int value;
cout << "Enter node value (-1 for NULL): ";
cin >> value;
if (value == -1) return ... | ALGO | 0.999602 | 6.806363 |
be1d15a3-4da3-41b9-9bb5-54f6470a1a55 | jbob555/slimfox | gfx/angle/checkout/src/compiler/translator/ASTMetadataHLSL.cpp | // Analysis of the AST needed for HLSL generation
#include "compiler/translator/ASTMetadataHLSL.h"
#include "compiler/translator/CallDAG.h"
#include "compiler/translator/IntermTraverse.h"
#include "compiler/translator/SymbolTable.h"
namespace sh
{
namespace
{
// Class used to traverse the AST of a function definit... | TOOL | 0.981079 | 5.895458 |
c0084218-91fa-46a7-a5b3-2b506277ca1e | gyafen/leetcode | LeetCode热题100/最长连续序列/C++/main.cpp | #include <iostream>
#include <vector>
#include <unordered_set>
#include <unordered_map>
using namespace std;
int main(){
return 0;
}
class Solution{
public:
int longestConsecutive(vector<int>& nums){
int answer = 0;
int count = 0;
int next = 0;
unordered_set<int> set;
... | ALGO | 0.999843 | 5.104333 |
76464bb1-b3e6-4166-b3a3-bd848e0e309d | iakshatgandhi/Getting-Started-With-Cpp | Array/binarysearch.cpp | #include<iostream>
using namespace std;
int binarysearch(int arr[], int size, int key){
int start=0;
int end=size-1;
int mid= start+(end-start)/2;
while(start<=end){
if(arr[mid]==key){
return mid;
}else if(key>arr[mid]){
start=mid+1;
}else{
... | ALGO | 0.999858 | 5.200321 |
96c33da1-8883-4d2c-bb2c-184757f42c43 | minsunhappy/c_cplusplus_study | class_example/17-7.cpp | #include <iostream>
#include <functional>
using namespace std;
void print(function<int()> func) {
cout << func() << endl;
}
int main() {
int x = 10;
int y = 7;
//auto lambda_function = [=]() { return x; };
auto lambda_function = [x, &y]() {y = 3; return x; };
print(lambda_function);
cout << x << endl << y << en... | TOOL | 0.959509 | 5.316571 |
44d5132d-2015-4673-a1ab-f27f2528341d | ishandutta2007/codeforces | fkguyx042/normal/236/A.cpp | #include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int a[1001];
char c[1001];
int i,j,m,n,p,k,ans;
int main()
{scanf("%s",&c);
for (i=0;i<strlen(c);i++)
a[c[i]-'a']++;
for (i=0;i<26;i++)
if (a[i]) ans++;
if (ans&1) printf("IGNORE HIM!\n");
else printf("CHAT WITH HER!\n");
} | ALGO | 0.999769 | 3.529271 |
6ded34bd-8fd0-43bc-853e-4df4153e522e | Abel1629/C-plus-plus---Bizonyitvany | 9/2/main.cpp | #include <iostream>
#include <fstream>
using namespace std;
ifstream f("atestat.in");
ofstream g("atestat.out");
int v[31],n,a[31];
int prim(int x)
{
int dbo=0,o;
for(o=2;o<=x/2;o++)
{
if(x%o==0)
dbo++;
}
if(x==1)
return 0;
if(x==2)
return 1;
if(dbo==0... | ALGO | 0.998529 | 3.24982 |
180e51fa-248e-4fdd-80e5-bc11cd503398 | Ashish-kumar7/ashish-cpp-thewireuschallenge2020 | Day-8.cpp | // author: Ashish Kumar
// day: 8
// #thewireuschallenge2020
// c++
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
string str;
unordered_map<string,int>mp;
for(int i=0;i<t;i++){
cin>>str;
mp[str]++;
}
int q;
cin>>q;
string str1;
for(int i=0;i<q;i++){
cin>>str1;
i... | ALGO | 0.999894 | 4.610367 |
c1f637e1-5e54-4165-b31e-86a7d69b592f | P-Raj27/MY-DSA-PRACTICE | Chocolate_distribution_problem_SS.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
long long findMinDiff(vector<long long> a, long long n, long long m)
{
sort(a.begin(),a.end());
int i=0;
int j=m-1;
long long diff =INT_MAX;
... | ALGO | 0.999912 | 5.788444 |
4852cf49-320f-4f65-8a2d-94ee46d3dbea | MohamedEssam788/Cpp-Practicing | 02-Lec2/lab3.cpp | #include <iostream>
int main(void)
{
int num[10]{0};
int sum=0;
for (int i = 0; i < 10; i++)
{
std::cout<<"Enter Number "<<i+1 <<" : ";
std::cin>>num[i];
sum += num[i];
}
std::cout<<"the sum = "<<sum;
} | ALGO | 0.870675 | 3.443555 |
cda01571-8415-4b9f-be62-fb824d2484c2 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7233_3.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 555;
int n, m, q;
int a[N][N], ans[N];
int cal(int i) {
int flag = 0, l = 0, r = 0, ret = 0;
for (int j = 1; j <= m; ++j) {
if (a[i][j]) {
if (!flag)
flag = 1, l = r = j;
else
r = j;
} else {
if (flag) ret = max(re... | ALGO | 0.999875 | 4.263318 |
1ecee243-71fc-4669-ae0a-d763a71682c4 | BekaKavlelashvili/Algorithms | Exercise6/Exercise6.cpp | #include <bits/stdc++.h>
using namespace std;
//იპოვეთ ორნიშნა რიცხვის უდიდესი ციფრი.
int main() {
int num;
cin >> num;
if((num / 10) > (num % 10)){
cout << num / 10;
}else{
cout << num % 10;
}
return 0;
}
| ALGO | 0.999605 | 4.684453 |
8d2f2e63-9268-404d-82f1-99dc2025cd00 | skywhat/leetcode | Cpp/203.cpp | // Remove all elements from a linked list of integers that have value val.
//
// Example:
//
// Input: 1->2->6->3->4->5->6, val = 6
// Output: 1->2->3->4->5
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
cl... | ALGO | 0.999926 | 5.981938 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.