uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
e5f908f0-560b-41d3-b2fc-8c527ebdd00c | 18bhupenderyadav/Leetcode | max-chunks-to-make-sorted-ii/max-chunks-to-make-sorted-ii.cpp | class Solution {
public:
int maxChunksToSorted(vector<int>& arr)
{
vector<int>sorted = arr;
vector<int>mn = arr;
mn.push_back(INT_MAX);
sort(sorted.begin(),sorted.end());
int mx = -1;
int ans = 0;
for(int i=arr.size()-2;i>=0;i--... | ALGO | 0.999979 | 5.677979 |
fb5f065b-c9f3-4147-85d8-af11795717e9 | zenmh/dsa-with-sk-maam-using-cpp | chapter_7_bitwise_operators_data_modifiers/bitwise_xor.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int a = 6, b = 10;
cout << (a ^ b) << endl;
return 0;
} | ALGO | 0.999365 | 3.30251 |
6ae578ea-7ed0-483c-9db1-6e6788d11f98 | Nagar203/Leetcode | 623. Add One Row to Tree/Approach01.cpp | #include <bits/stdc++.h>
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), left(left), rig... | ALGO | 0.999985 | 6.184106 |
988b974d-7e9b-4937-b71e-e5f0cec8b08b | EpicSentry/P2ASW | src/game/client/portal/Portal_DynamicMeshRenderingUtils.cpp | #include "cbase.h"
#include "Portal_DynamicMeshRenderingUtils.h"
#include "iviewrender.h"
extern ConVar mat_wireframe;
int ClipPolyToPlane_LerpTexCoords( PortalMeshPoint_t *inVerts, int vertCount, PortalMeshPoint_t *outVerts, const Vector& normal, float dist, float fOnPlaneEpsilon )
{
vec_t *dists = (vec_t *)stackal... | ALGO | 0.994057 | 6.391025 |
ad785edb-413e-4afc-8a8c-d2cb43dff743 | iliyian/LuoguOJ | Problems/P3197/main.cpp | #include <bits/stdc++.h>
#define mod 100003
#define int long long
using namespace std;
int powmod(int m, int n) {
int ans = 1;
while (n) {
if (n & 1) ans = ans * m % mod;
m = m * m % mod;
n >>= 1;
}
return ans;
}
signed main() {
ios::sync_with_stdio(false); cin.tie(0);
// freopen("data.in", "r... | ALGO | 0.999977 | 5.366466 |
e600ce8e-6e56-4c16-965d-1d46a2056983 | RisingTechOSS-15-Backup/android_frameworks_av | media/module/codecs/amrnb/dec/src/post_pro.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include "post_pro.h"
#include "typedef.h"
#include "basic_op.h"
/*----------------------------------------------------------------------------
; MACR... | ALGO | 0.987683 | 5.760083 |
dd87f1c4-153f-4e01-a178-8dc21a8dcfbc | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J00056/chain/chain.cpp | #include <bits/stdc++.h>
using namespace std;
int t;
vector<int> a[100005];
int main(){
freopen("chain.in","r",stdin);
freopen("chain.out","w",stdout);
cin>>t;
while (t--){
int n,k,q;
cin>>n>>k>>q;
for (int i=1;i<=n;i++){
int l;
cin>>l;
while (... | ALGO | 0.999855 | 3.040337 |
0774d6fe-d557-4d3b-9d77-e44383f4fd2c | oznakn/metu-hw | ceng315/the1/test2.cpp | // this file is for you for testing purposes, it won't be included in evaluation.
#include <iostream>
#include <random>
#include <ctime>
#include "the1.h"
using namespace std;
void printArr(int*& arr, int len)
{
for(int i = 0; i < len; i++){
std::cout << arr[i] <<" ";
}std::cout<< std::endl;
}
void... | TEST | 0.972461 | 5.432914 |
e48906bf-ca32-488d-96d3-e998a0a47d92 | ahmedseyhahmed2/BBG-ODEVI-BIR-BOYUTLU-DIZILER | soru51.cpp | #include <stdio.h>
void transpose(int matris[][10], int m, int n) {
int i, j, temp;
for (i = 0; i < m; i++) {
for (j = i+1; j < n; j++) {
temp = matris[i][j];
matris[i][j] = matris[j][i];
matris[j][i] = temp;
}
}
}
int main() {
int matris[10][10], m,... | ALGO | 0.991648 | 4.20263 |
52fde7ca-693a-4f12-b01f-ee08dce70ebf | hidden20040807/leetcode | 494/code.cpp | #include<bits\stdc++.h>
using namespace std;
class Solution {
public:
int findTargetSumWays(vector<int>& nums, int target) {
int sum=0;
for(int n:nums){
sum+=n;
}
if((sum+target)%2||(sum+target)<0)
return 0;
int pos=(sum+target)/2;
vector<vector<in... | ALGO | 0.999989 | 5.635052 |
d2c30d1b-1038-4965-ab19-389f11430d6f | bilal-qadri140/Programming-Fundamentals | Chapter # 5/program_5_3.cpp | #include <iostream>
using namespace std;
int main()
{
int num1, num2;
cout << "Enter 1st number: ";
cin >> num1;
cout << "Enter 2nd number: ";
cin >> num2;
if (num1 * num1 == num2)
{
cout << "Num2 is square of num1!..";
}
} | TOOL | 0.918879 | 3.425798 |
1b559083-632d-4bdc-8dac-bef8eff78b20 | CreeperOS/android_packages_apps_CreeperOTAUpdater | jni/boost_1_57_0/libs/numeric/ublas/doc/samples/matrix.cpp | #include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
for (unsigned i = 0; i < m.size1 (); ++ i)
for (unsigned j = 0; j < m.size2 (); ++ j)
m (i, j) = 3 * i + j;
std::cout << m <<... | ALGO | 0.975657 | 3.149163 |
f3b3495c-6402-45bf-af6e-3cb73071a1a2 | em3ly/axon_training | Those who can not remember the past are condemned to repeat it - DP/Solutions/luismo/D/D - Approximating a Constant Range.cpp | /*
Author: Luis Manuel Díaz Barón (LUISMO)
Problem: D - Approximating a Constant Range
Online Judge: codeforces.com
Idea: Two Pointers + Set
*/
#include<bits/stdc++.h>
// Types
#define ll long long
#define ull unsigned long long
// IO
#define sf scanf
#define pf printf
#define mkp make_pair
#define fi first
#defin... | ALGO | 0.999891 | 4.493382 |
e152f09a-974e-410a-b076-4c2599babeb4 | jasdeep-batra/Leetcode-GFG-Problem-Solving | 2260-minimum-consecutive-cards-to-pick-up/2260-minimum-consecutive-cards-to-pick-up.cpp | class Solution {
public:
int minimumCardPickup(vector<int>& cards) {
map<int,int> mp;
int dist = INT_MAX;
for(int i=0;i<cards.size();i++)
{
if(mp.find(cards[i])!=mp.end())
{
dist = min(dist,i-mp[cards[i]]+1);
mp[cards[i]] = i;
... | ALGO | 0.999946 | 5.696659 |
66fc3978-2fca-469f-9f1b-1ff49602b1a6 | Edhain/Cpp | Sorting Algorithm/print_array.cpp | #include <iostream>
using namespace std;
void printArray(int arr[], int size, int i) {
if (i == size) {
return;
}
cout << arr[i] << " ";
printArray(arr, size, ++i);
} | ALGO | 0.997745 | 5.067472 |
ac3ab9ff-d683-4ad4-87de-d460f5b06183 | gautamsharma22/leetcode-manual | Topological Sort in DAC.cpp | #include <bits/stdc++.h>
void ts(int node,vector<int> &ans,vector<vector<int>> &adj,vector<bool> &visited){
visited[node]=true;
for(auto i:adj[node]){
if(!visited[i]){
ts(i,ans,adj,visited);
}
}
ans.insert(ans.begin(),node);
}
vector<int> topologicalSort(vector<vector<int>> &edges, int v, int e) {
vect... | ALGO | 0.999987 | 5.032193 |
cec1a2ce-65e3-44a3-8d46-50734db59107 | snehilk1312/cpp_basics | 3_Recursion/main.cpp | #include<iostream>
using namespace std;
int factorial(int n)
{
if (n==0||n==1)
return 1;
else if(n>1){
return n*factorial(n-1);
}
return 0;
}
int main()
{
int n,fac_n;
cout<<"enter number n:"<<endl;
cin>>n;
fac_n=factorial(n);
cout<<fac_n;
return 0;
}
| ALGO | 0.999802 | 4.101097 |
b0ffe442-6409-4e5c-993e-88583ad80eec | debojit-basak/epc-practice | c.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long m,n,t,d,ans,a;
cin>>t;
while(t--)
{
cin>>n;
ans=n*(n+1)/2;
a=1;
while(a<=n)
{
ans-=2*a;
a=a*2;
}
cout<<ans<<endl;
}
return 0;
}
| ALGO | 0.99988 | 4.285772 |
6787d655-d960-4392-a8b4-0de583693b88 | johnson-hung/micropayment-system | client.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h> //strlen
#include <sys/socket.h>
#include <unistd.h> //close
#include <arpa/inet.h> //inet_addr
#include <iostream>
#include <sstream>
#include <string>
#include <unistd.h>
#include <resolv.h>
#include <netdb.h>
#include <openssl/ssl.h>
#include <openssl/err.h>... | WEB | 0.875398 | 3.775708 |
a6697b6e-a309-4488-b36c-27ea80ffc15b | rhazari/Important-Algorithms | Link-List/PartitionList.cpp | #include "ListNode.h"
using namespace std;
ListNode* partitionList(ListNode* head, int element) {
ListNode *h1, *h2;
h1 = new ListNode(-1);
h2 = new ListNode(-1);
ListNode *ptr, *p1, *p2;
ptr = head;
p1 = h1;
p2 = h2;
while( ptr ){
if( ptr->data < element ){
p1->ne... | ALGO | 0.999903 | 4.623133 |
568b8945-5246-47c3-a749-80b4a1803334 | ThreeSR/LeetCode | LC389_Find the Difference_ASCII.cpp | class Solution {
public:
char findTheDifference(string s, string t) { // ASCII码的应用
int sumS = 0, sumT = 0;
for (char c : s) sumS += c;
for (char c : t) sumT += c;
return sumT - sumS;
}
};
// reference https://leetcode-cn.com/problems/find-the-difference/solution/zhao-bu-tong-by-... | ALGO | 0.999956 | 6.66205 |
0369e951-e90c-498b-925f-6f988690647a | pierpaolo28/Artificial-Intelligence-Projects | Computer Vision/Viola Jones/Viola Jones.cpp | #include <iostream>
#include <vector>
using namespace std;
void print_vect(vector<std::vector<int>> vec) {
for (int i = 0; i < vec.size(); i++)
{
for (int j = 0; j < vec[i].size(); j++)
{
cout << vec[i][j] << ' ';
}
cout << std::endl;
}
cout << std::endl;
}
vect... | ALGO | 0.999969 | 4.028544 |
7e85c961-2c99-47c2-8cee-2256e1dce6b4 | kevin1x/DriverlessCar | jetson/carControl/src/0.3/xla/lib/IPM.cpp | #include "IPM.h"
using namespace cv;
using namespace std;
// Public
IPM::IPM( const cv::Size& _origSize, const cv::Size& _dstSize, const std::vector<cv::Point2f>& _origPoints, const std::vector<cv::Point2f>& _dstPoints )
: m_origSize(_origSize), m_dstSize(_dstSize), m_origPoints(_origPoints), m_dstPoints(_dstPoints)... | ALGO | 0.933488 | 6.151404 |
ff876f2f-db8a-4be0-8404-7890095667fd | JianZhu-icy/Turing-Machine | src/Inter_BinarySer.cpp | //
// Created by icy on 24-6-27.
//
#include "../include/Inter_BinarySer.h"
Inter_BinarySer::Inter_BinarySer() {
steps = 0;
workSpace = 0;
state = INIT_LOW;
target = 0;
}
void Inter_BinarySer::updatePara() {
steps = 0;
workSpace = 0;
state = INIT_LOW;
target = 0;
}
int Inter_BinarySe... | ALGO | 0.997441 | 3.399966 |
26e3f727-5349-43ca-9fb8-06efd4103ea2 | lmh760008522/ProgrammingExercises | PAT/A/1111.cpp | #include<cstdio>
#include<algorithm>
#include<vector>
#include<stack>
using namespace std;
int dis[510],time[510],e[510][510],w[510][510],weight[510];
bool visit[510];
const int inf = 99999999;
int main(){
//ʼ
fill(dis,dis+510,inf);
fill(time,time+510,inf);
fill(weight,weight+510,false);
fill(e[0], e[0] + 510 *... | ALGO | 0.99966 | 3.33491 |
edf25a60-983c-4f28-a1b8-18b80b6034cb | yaaanni/laba4PartC | Task6/test_main3.cpp | #include <gtest/gtest.h>
#include <sstream>
#include <vector>
#include <string>
#include <limits.h>
// Функции для генерации магических квадратов
void generateOddMagicSquare(int n, int** magicSquare);
void generateDoublyEvenMagicSquare(int n, int** magicSquare);
void generateSinglyEvenMagicSquare(int n, int** magicSqu... | ALGO | 0.999288 | 6.937928 |
d1bd8607-56b8-4a9b-a128-9c7581eda66e | siddharth12s/Cpp | a20j/<1300/10.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin >> t;
string s;
cin >> s;
int ans = 0;
for (auto i = 0; i < s.size() - 1;i++){
if(s[i]==s[i+1]){
ans++;
}
}
cout << ans;
return 0;
}
| ALGO | 0.999866 | 4.432121 |
65894310-1bb9-4c6d-a77f-cd640293300d | webdeveloper13/July_leetcode_contest | week4/day24.cpp | /*
All Paths From Source to Target
Solution
Given a directed, acyclic graph of N nodes. Find all possible paths from node 0 to node N-1, and return them in any order.
The graph is given as follows: the nodes are 0, 1, ..., graph.length - 1. graph[i] is a list of all nodes j for which the edge (i, j) exists.
Examp... | ALGO | 0.999863 | 6.524311 |
cbe4010d-07a3-45ca-8ef4-03921ff674c1 | kunal-004/DSA_Practice | neetcode/biunarySearch/Median-two-Sorted-Arrays.cpp | #include<bits/stdc++.h>
using namespace std;
int mergerTwo(vector<int>& nums1, vector<int>& nums2, int n, int m){
if(n>m) return mergerTwo(nums2, nums1, m, n);
int low = 0, high = n;
while(low<=high){
int cut1 = low + (high-low)/2;
int cut2 = (n+m+1)/2 - cut1;
int l1 = cut1==0?INT_MIN:nums1[cut1-1];
... | ALGO | 0.999935 | 4.967049 |
1e9352d4-2a79-4854-b7b6-6851cf537f42 | gaeunU/Algorithm | 프로그래머스/unrated/181901. 배열 만들기 1/배열 만들기 1.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(int n, int k) {
vector<int> answer;
for(int i=1; i*k<=n; i++){
answer.push_back(i*k);
}
return answer;
} | ALGO | 0.999982 | 3.821005 |
73ff43fc-f63c-4a17-b943-f7a4f1047fd1 | CSI-SRM-NCR-Chapter/100-Days-of-Code | Prafful-Bisht/DAY-7/Day-7-A.cpp | class Solution {
public:
bool isUgly(int n) {
if(n==0){
return false;
}
while(n!=0){
if(n==1) return true;
else if(n%2==0){
n=n/2;
}
else if(n%3==0){
n=n/3;
}
else if(n%5==0){
... | ALGO | 0.999937 | 5.817892 |
9c3229af-814d-4f58-8128-67634010a67e | mfkiwl/Speculator | Convolution/IRBaboon/fp/ir.cpp | #include <fp_include_all.hpp>
namespace fp {
namespace ir {
AudioBuffer<float> invertFilter (AudioBuffer<float>& buffer, int sampleRate){
AudioSampleBuffer pulse = tools::generatePulse(buffer.getNumSamples());
AudioSampleBuffer result = convolution::deconvolve(&pulse, &buffer, sampleRate);
return result;
... | ALGO | 0.948996 | 4.553658 |
85c97c42-ef3d-4b44-bfd0-d5f111e2ed88 | protez/MiniRPG | jni/raycaster.cpp | #include <jni.h>
#include <android/bitmap.h>
#include <android/log.h>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include "log_macros.h"
#include "vec2.h"
#include "sprite.h"
// width * y + x
JNIEnv* currentEnv = NULL;
struct Texture
{
AndroidBitmapInfo info;
jobject bitmap;
};
... | TOOL | 0.893669 | 5.121257 |
19dcfaa9-3050-4ee5-9ed2-39880277dea7 | ChenXingLing/OI-Algorithm-Template | 【图论】/线段树优化建边/线段树优化建边+Dinic最大流 (Last chance).cpp | #include<algorithm>
#include<cstring>
#include<cstdio>
#include<queue>
#define LL long long
#define Re register int
using namespace std;
const int N=5003+3,M=25e4+3,inf=2e9;
int n,m,x,y,z,O,op,st,ed,X[N],Y[N],Z[N],Ans[N],cnt[N];
inline void in(Re &x){
int f=0;x=0;char c=getchar();
while(c<'0'||c>'9')f|=c=='-',c... | ALGO | 0.999947 | 3.607715 |
4e875ca6-eb1d-4255-a4bd-8b0169f28643 | LetsGrowMoreCommunity/DSA-Playyard | Math/C++/2_Count_Primes.cpp | // Count Prime
// In this question we have to count the number of prime numbers present in the range of 1 to n
// Prime Numbers are numbers which are divisible by one and itself
// Time Complexity : O(n*sqrt(n))
// Space Complexity : O(1)
// Code:
#include <bits/stdc++.h>
using namespace std;
// function to check if... | ALGO | 0.999915 | 5.802786 |
cd678e31-63e8-42fa-a603-19059560fd79 | meghna2808/Coding | pacific.cpp | class Solution {
public:
void dfs(vector<vector<int>>& heights, vector<vector<bool>>&visited, int row, int column)
{
visited[row][column]=true;
if(row<heights.size()-1 && visited[row+1][column]==false && heights[row+1][column]>=heights[row][column])
{
dfs(heights,visited,row+... | ALGO | 0.999985 | 6.798955 |
56fe3a39-a1dc-47b3-8c0e-253dc6625338 | williamtsutumi/codeforces-contests | div3/1907/a.cpp | #ifdef ONLINE_JUDGE
#define debug(x...)
#else
#include "../../debug.h"
#endif
#include <bits/stdc++.h>
using namespace std;
#define PMOD(n, m) ((((n) % (m)) + (m)) % (m))
#define FFIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ld long double
#define X real()
#define Y imag()
typedef long long ll... | ALGO | 0.999551 | 3.882868 |
1199fa4d-b22a-401c-bf46-b35b4a7a3ffd | Jesusrac31/Advent-of-code | 2024/Day_7/Day_7_2.cpp | //Librerías incluidas en #include<bitstdc++.h>
#include<algorithm>
#include<array>
#include<atomic>
#include<bitset>
#include<ccomplex>
#include<cerrno>
#include<cfenv>
#include<cfloat>
#include<chrono>
#include<cinttypes>
#include<ciso646>
#include<climits>
#include<clocale>
#include<cmath>
#include<complex>
#include<... | ALGO | 0.99749 | 4.218506 |
c5b164f3-38be-43e4-a039-c63980fff8ab | sidjha57/Coding | D_Make_Them_Equal.cpp | //Siddharth Jha
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_no... | ALGO | 0.999857 | 3.641797 |
762b07fa-8a1e-445d-8f34-e977e0f2a30b | fawwasaldy/codeforces-math | math1/p.cpp | #include<bits/stdc++.h>
using namespace std;
#define fo(i,n) for(i=0;i<n;i++)
#define ll long long
#define deb(x) if(SHOW) cout << #x << "=" << x << endl
#define deb2(x, y) if(SHOW) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define debArr(a,n) for(int z=0;z<n;z++){ cout<<a[z]<<" "; } cout<<endl;
#def... | ALGO | 0.999961 | 3.981277 |
1a416650-849e-41ab-8ca3-75dfc62e37ab | gradientspace/UnrealMeshProcessingTools | UE4.24/IGLMeshProcessingProject/Plugins/MeshProcessingPlugin/ThirdParty/libigl/include/igl/resolve_duplicated_faces.cpp | #include "resolve_duplicated_faces.h"
#include "slice.h"
#include "unique_simplices.h"
template<
typename DerivedF1,
typename DerivedF2,
typename DerivedJ >
IGL_INLINE void igl::resolve_duplicated_faces(
const Eigen::PlainObjectBase<DerivedF1>& F1,
Eigen::PlainObjectBase<DerivedF2>& F2,
Eigen::Plain... | ALGO | 0.992697 | 5.612282 |
5235eb49-12a0-4205-a901-16aff163be01 | GAINS-ASEN23/Ground-Software | boost/libs/intrusive/perf/tree_perf_test.cpp | //Includes for tests
#include <boost/intrusive/detail/config_begin.hpp>
#include <boost/config.hpp>
#include <iostream>
#include <vector>
#include <boost/intrusive/set.hpp>
#include <boost/intrusive/sg_set.hpp>
#include <boost/intrusive/avl_set.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <cstdlib... | TEST | 0.898226 | 6.264592 |
85a1fa04-254d-4445-9a46-68c9cdc75049 | Class-17/AtCoder | Beginner/383/B_Humidifier_2.cpp | #include <bits/stdc++.h>
int dist(int x1, int y1, int x2, int y2) {
return std::abs(x1 - x2) + std::abs(y1 - y2);
}
int main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
int n, m, d;
std::cin >> n >> m >> d;
std::vector<std::string> grid(n);
for (auto &x : grid) std::cin >> x;
int re... | ALGO | 0.999833 | 5.75496 |
15bb66c9-6e8b-44e4-bf21-c8d04922bad3 | yohadai/codetree-TILs | 240102/특정 구간의 합/sum-of-specific-intervals.cpp | #include <iostream>
int arr[100]{0};
void sumNumbers(int a1, int a2){
int sum{};
for (int i{a1}; i <= a2; ++i){
sum += arr[i];
}
std::cout << sum << std::endl;
}
int main() {
// 여기에 코드를 작성해주세요.
int n, m;
std::cin >> n >> m;
for (int i{1}; i <= n; ++i){
std::cin >> arr[... | ALGO | 0.999968 | 4.418828 |
393e6b6e-49f8-49a6-bd7b-f618fa8a8a17 | sarvex/leetcode-c-sharp | solution/0500-0599/0567.Permutation in String/Solution.cpp | class Solution {
public:
bool checkInclusion(string s1, string s2) {
int n = s1.size(), m = s2.size();
if (n > m) {
return false;
}
vector<int> cnt(26);
for (int i = 0; i < n; ++i) {
--cnt[s1[i] - 'a'];
++cnt[s2[i] - 'a'];
}
... | ALGO | 0.999974 | 6.440907 |
836c5cac-5885-4a26-80b6-54dcb7daa394 | blair-developer/converter-flutter-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.9988 | 6.76073 |
b8a98cf3-8a65-4b4b-bec4-815af706f7e0 | da5ater/cpp--projects-on-frank-course | p4/main.cpp | #include <cstring>
#include <iostream>
#include <cctype>
#include <string>
using namespace std;
int main()
{
string alphabet {"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"};
string key {"XZNLWEBGJHQDYVTKFUOMPCIASRxznlwebgjhqdyvtkfuompciasr"};
string CodedMessage {};
cout << "Please Enter you ... | ALGO | 0.998865 | 4.139527 |
f373a701-f212-4c73-b361-e2f2122a5b0d | Zenfendson/my_pp4fpgas_labs | Discrete_Fourier_Transform/dft_32_precomputed/dft_test.cpp | /*
This is DFT computation using matrix vector multiplication form.
INPUT:
In_R, In_I[]: Real and Imag parts of Complex signal in time domain.
OUTPUT:
In_R, In_I[]: Real and Imag parts of Complex signal in frequency domain.
*/
#include<stdio.h>
#include <stdlib.h>
#include<iostream>
#include <math.h>
#include "dft.... | ALGO | 0.998796 | 4.773875 |
4b9d9ea8-7b43-4616-a713-9158664ae087 | Mahdi-Rom/android_frameworks_av | media/libstagefright/codecs/mp3dec/src/pvmp3_mdct_6.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: mdct_18.cpp
Date: 09/21/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-------------------------------... | ALGO | 0.999193 | 6.146664 |
5d1ccbfd-8135-4b19-94c5-78a51bd1fae3 | Yash-Singh1/competitive-programming | codeforces/814C/attempt1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
ll n, q;
string s;
cin >> n >> s >> q;
while (q--) {
ll repaints;
char fav;
cin >> repaints >> fav;
vector<pair<ll,ll>> inarow;
for (ll i{0}; i < n; ... | ALGO | 0.999434 | 3.661985 |
34eabfb1-8bff-4142-8d1e-c04334aab598 | Lsfer/Ejemplo- | tarea funciones 3-10-de-abril.cpp | #include <iostream>
using namespace std;
void multiplosdenumero(int num) {
cout << "el resultado de " << num << " es : " ;
for (int x = 1; x <=10; x++) {
cout << num * x << " ";
}
cout << endl;
}
void calcularelfactorial(int num) {
int fac = 1;
for (int x = 1; x <=num ; x++) {
fac *= x ;
}
cout << "... | TOOL | 0.959046 | 3.224367 |
c8dea3f4-f17f-4896-9fab-0d58ebfccfc2 | Jasper-World/USACO | milk_pail.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int main() {
ifstream fin("pails.in");
ofstream fout("pails.out");
int x, y, k, m;
fin >> x >> y >> k >> m;
vector<vector<bool>> can(x + 1, vector<bool>(y + 1, false));
can[0][... | ALGO | 0.999882 | 3.930707 |
4d8f64eb-d703-40ac-ab58-0f511e9070f9 | levonoganesyan/Algorithms | Algorithms/src/Graph/Graph.cpp | #include "Graph/Graph.h"
#include "Utils.h"
#include "Defines.h"
#include <Graph/CycleChecker.h>
#include <Graph/ChromaticNumber.h>
namespace algo
{
bool
Graph::WeightLess::operator()
(const Edge& first, const Edge& second) const
{
if (first.weight != second.weight)
return ... | ALGO | 0.995485 | 6.493846 |
121336ad-9b4d-4a61-bf36-c7e29c78966c | TandemTales/bayou | src/MoveExecutor.cpp | #include "MoveExecutor.h"
#include "GameBoard.h"
#include "InfluenceSystem.h"
// #include "King.h" // Removed - using data-driven approach with PieceFactory
#include "GameState.h"
#include "Square.h"
#include <numeric>
namespace BayouBonanza {
bool MoveExecutor::validateMove(const GameState& gameState, const Move& mo... | ALGO | 0.993431 | 7.663346 |
585e5da7-5f6f-4c7f-8f80-24ba1d5506d0 | jyqiu1216/Rino | sdk/boost_1_62_0/libs/phoenix/example/find_if.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include <boost/phoenix/core.hpp>
#include <boost/phoenix/operator.hpp>
int
main()
{
using boost::phoenix::arg_names::arg1;
int init[] = { 2, 10, 4, 5, 1, 6, 8, 3, 9, 7 };
std::vector<int> c(init, init + 10);
typedef std::vector<int>::iterator... | ALGO | 0.977261 | 5.04283 |
101beda2-34f4-4735-8676-10f389cdc42e | pepepper/llvm-temple | libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// <algorithm>
// template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
// class Proj = identity>
// requires sortable<I, Comp, Proj>
// constexpr I
// ranges::sort_heap(I first, S last, Comp comp = {}, Proj proj = {}); ... | TEST | 0.997878 | 7.690496 |
3c53dcfa-c78f-4e67-ba07-33514cad3971 | nguyenhoang4875/CompetitiveProgramming | codeforces/div2_983/C_br.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
//*** debug(x) ***/
#define DEBUG 0
#if DEBUG
#define del cout << '\n'
#define debug(x) cout << "[" << #x << "]" << " : " << (x) << endl
template <class Ch, class Tr, class Container>
basic_ostream<Ch, Tr>& operator<<(basic_ostream<Ch, Tr>& os, Cont... | ALGO | 0.999906 | 4.739052 |
9d4dd142-fa22-40b0-8a1b-84362787189c | shoaibrayeen/Course-Work | Data Structure/Linked List/Singly/union_intersection.cpp | #include<iostream>
using namespace std;
struct Node {
int data;
Node* next;
};
void push (Node** head_ref, int new_data) {
struct Node* new_node = (Node*) malloc(sizeof(Node));
new_node->data = new_data;
new_node->next = (*head_ref);
(*head_ref) = new_node;
}
bool isPresent (Node *head, int d... | ALGO | 0.980518 | 4.443588 |
9503306b-40a7-4c9b-bfbd-4e8888d23f97 | NQBH/advanced_STEM_beyond | OLP_ICPC/C++/DPAK_apple_division.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<ll> a;
ll n;
signed main() {
cin >> n;
a.resize(n);
for (ll i = 1; i <= n; ++i) cin >> a[i - 1];
ll mask = 1 << n;
vector<ll> groupA, groupB;
ll minWeight = INT_MAX;
ll gA = 0, gB = 0;
for (ll i = 0; i < mask; ++... | ALGO | 0.99999 | 3.935929 |
16317d78-90d6-46fa-ac40-73364c19aed5 | Kaminskyi22/Homework5 | Homework5.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <cstdlib>
#include <ctime>
using namespace std;
/*int main() {
int rows, cols;
unsigned long long num;
cout << "Enter the number of rows: ";
cin >> rows;
cout << "Enter the number of columns: ";
cin >> cols;
cout << "Enter t... | ALGO | 0.999138 | 5.743546 |
7b330c86-f983-4ae5-99bf-f6e3d21a730d | GuacheSuede/MSSubmission1234567890 | submission/macd/boost_1_69_0/libs/graph/example/topo-sort2.cpp | int
main()
{
using namespace boost;
const char *tasks[] = {
"pick up kids from school",
"buy groceries (and snacks)",
"get cash at ATM",
"drop off kids at soccer practice",
"cook dinner",
"pick up kids from soccer",
"eat dinner"
};
const int n_tasks = sizeof(tasks) / sizeof(char *);
... | ALGO | 0.998397 | 5.224872 |
89886de8-bd7b-41b4-b6d1-b3b06f47b670 | opsingh861/DSA | Binary Tree/Binary Search Tree/2_insertion.cpp | // this one is written by sir
#include<iostream>
using namespace std;
struct node
{
int info;
node* left = NULL;
node* right = NULL;
};
node *root = NULL;
node *loc = NULL, *locp = NULL;
void preorder(node *root)
{
if(root == NULL) return;
cout<<root->info <<"\t";
preorder(root->left);
preorder(root->rig... | ALGO | 0.999958 | 4.844534 |
d28cde52-5ffb-4a56-9b31-fc85193e2f3c | ishandutta2007/codeforces | xellos/normal/567/F.cpp | // iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <tr1/unordered_map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#define dibs reserve
#define OVER... | ALGO | 0.999864 | 3.30694 |
2974ff0c-eba0-462f-a2f3-6be5b3ec3ba9 | pierreetienne/cplusplus-hacker-rank | CF1385B.cpp | #include <iostream>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int s;
cin >> s;
int* sol = new int[s];
int index = 0;
bool* nums = new bool[s];
for(int i=0;i<s;++i)
nums[i] = false;
for(int i=0;i<2*s;++i){
int val;
cin >> val;
if(!nums[val-1]){
sol[index]=val;
ind... | ALGO | 0.999879 | 3.161309 |
f24099b6-8e59-4238-b2ca-8f2349fc8678 | ishandutta2007/codeforces | 1092515503/normal/1693/E.cpp | /*
Criteria:
1.read the problem carefully; WRITE DOWN SPECIAL CONSTRAINTS when the problem is long;
2.consider special situations/constraints to get observations;
3.think of everything throughout before coding;
4.return to the initial list of notifications after coding.
CONSTRAINTS:
OBSERVATIONS:
OTHER NOTIFICATIONS... | ALGO | 0.999771 | 3.493282 |
1b62859e-3e46-4ff8-a5ab-633388546770 | sakettt07/DSA | Sorting/Bubblesort.cpp | // in this tutorial we are goind to learn bubble sort.
#include<bits/stdc++.h>
using namespace std;
void bubblesort(int arr[],int n){
for(int i=0;i<n-1;i++){
for (int j = 0; j <n-i; j++)
{
if(arr[j]>arr[j+1]){
swap(arr[j],arr[j+1]);
}
}
}
cout<<"the so... | ALGO | 0.9997 | 4.763155 |
895f993e-4d1a-4c6d-9f79-2f9adf671d33 | vaibhavmangla07/C-PLUS-PLUS | 06 Array/2. Array 2-D/08_2D_Array.cpp | // Diagonal Sum Matrix Method 1
#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
int DiagonalSum(int arr[100][100], int n){
int sum = 0;
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++){
if(i == j){
sum += arr[i][j];
... | ALGO | 0.99958 | 5.628059 |
b1d80d6b-9ccd-4284-b7cd-bc89eba9b574 | Markof87/AI-SimpleSoccer | PlayerBase.cpp | #include "2D/C2DMatrix.h"
#include "2D/geometry.h"
#include "2D/Transformations.h"
#include "Debug/DebugConsole.h"
#include "Game/Region.h"
#include "Messaging/MessageDispatcher.h"
#include "misc/Cgdi.h"
#include "ParamLoader.h"
#include "Goal.h"
#include "PlayerBase.h"
#include "SoccerBall.h"
#include "SoccerMessages.... | ALGO | 0.859066 | 5.196608 |
9ae3299d-ad0e-4232-b7a0-a05d765b5fc3 | Chandramani04/CP | Practice/B_Ugu.cpp | #include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
#include "bits/stdc++.h";
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update>
ordered_se... | ALGO | 0.999932 | 4.758665 |
b9b2cbe3-0ff1-4944-b305-baf2fc4ab38b | lurWNM/OQelwt2KY | bee_movie_script.cpp | According to all known laws of aviation, there is no way a bee should be able to fly.
Its wings are too small to get its fat little body off the ground.
The bee, of course, flies anyway because bees don't care what humans think is impossible.
Yellow, black. Yellow, black. Yellow, black. Yellow, black.
Ooh, black and ye... | ALGO | 0.995281 | 7.18416 |
2d64cdb0-f958-4dc1-bce1-a81c4d1f0641 | zdszero/ustc-cs-graduate | 机试历年真题/2018/4.cpp | #include <fstream>
#include <iostream>
using namespace std;
int lic(const string &s1, const string &s2, int i, int j) {
if (i == 0 || j == 0) return 0;
if (s1[i - 1] == s2[j - 1]) return lic(s1, s2, i - 1, j - 1) + 1;
return max(lic(s1, s2, i - 1, j), lic(s1, s2, i, j - 1));
}
int main(int argc, char *argv[]) {... | ALGO | 0.999724 | 4.425274 |
c22bb50e-1a92-46c9-b0af-b356502c23d8 | janusboandersen/DSA | src/algo_quick_select.cpp | /**
* @file src/algo_quick_select.cpp
* @author Janus Bo Andersen
* @brief Implementation of quick-select algorithm
* @version 1.0
* @date 2023-06-17
*
* @copyright Copyright (c) 2023
*
*/
#include <iostream>
#include <algorithm>
#include <algo/quick_select.hpp>
namespace algo {
namespace qs {
/**
* @bri... | ALGO | 0.999249 | 6.108495 |
878c7c20-6d2f-4000-9aed-1b38f23d664e | Caetano2005/Logic | Gasolina.cpp | #include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
using namespace std;
int main(){
double litros;
double precoGasolina = 2.50, precoAlcool = 1.90, precoTotal, disconto;
char combustivel;
cin >> litros >> combustivel;
switch (combustivel) {
case 'g': if (litros <= 20... | ALGO | 0.990334 | 4.140797 |
104c7aa8-8f7c-445e-8f96-a7b12e03ec5b | MadhavBhatia0/100-Days-of-Code | week12/77_del_node_LL.cpp | //237. Delete Node in a Linked List
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
void deleteNode(ListNode* node) {
while(node->next->next!=NULL)
{
no... | ALGO | 0.999933 | 5.610662 |
3b3bb639-b608-4607-a178-98f73188963f | Taejin1221/Re-PS | Baekjoon/Baekjoon11720.cpp | // Baekjoon11720.cpp
#include <iostream>
#include <string>
using namespace std;
int main(void) {
int n;
cin >> n;
string str;
cin >> str;
int ans = 0;
for (int i = 0; i < n; i++)
ans += str[i] - '0';
cout << ans << '\n';
return 0;
} | ALGO | 0.99978 | 4.274959 |
99e0afee-8864-483e-8380-66befefc2de8 | ishandutta2007/codeforces | normie28/normal/645/D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define ii pair<int,int>
#define vii vector<pair<int,int>>
#define vi vector<int>
int dp[100010] , n , m , visited[100010];
vii adj[100010];
void dfs(int x , int t){
visited[x] = 1;
int res = 0 ;
ii v;
for(int ... | ALGO | 0.999986 | 4.075405 |
7d1eb3cf-9a06-4782-961d-2525f6b19e6f | BTCPrivate/BTCP-Rebase | src/policy/policy.cpp | // NOTE: This file is intended to be customised by the end user, and includes only local node policy logic
#include <policy/policy.h>
#include <consensus/validation.h>
#include <validation.h>
#include <coins.h>
#include <tinyformat.h>
#include <util.h>
#include <utilstrencodings.h>
CAmount GetDustThreshold(const CTx... | TOOL | 0.897828 | 7.446469 |
ddd6d049-cde8-47c6-86af-f169d64772ce | sarvex/leetcode-lol-code | solution/0700-0799/0777.Swap Adjacent in LR String/Solution.cpp | class Solution {
public:
bool canTransform(string start, string end) {
int n = start.size();
int i = 0, j = 0;
while (true) {
while (i < n && start[i] == 'X') ++i;
while (j < n && end[j] == 'X') ++j;
if (i == n && j == n) return true;
if (i == ... | ALGO | 0.999898 | 5.45123 |
fe5ed56f-630b-4145-9d21-eaf2cf81cf57 | Amitkumarpatwa/CPP_DSA | 7Test/3factorial.cpp | #include<iostream>
using namespace std;
int fact(int a)
{
if (a==0||a==1)
{
return 1;
}
else{
int res=a*fact(a-1);
return res;
}
}
int main ()
{
int n;
cout<<"Enter a number :";
cin>>n;
int res=fact(n);
cout<<"Factotial:"<<res;
return 0;
} | ALGO | 0.999283 | 3.860621 |
173a6794-35ac-4e1f-88c9-f0203ae2cdda | bradendubois/competitive-programming | kattis/quickbrownfox/quickbrownfox.cpp | #include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
string alpha_str = "abcdefghijklmnopqrstuvwxyz", line;
int N;
cin >> N;
getline(cin, line);
while (N--) {
getline(cin, line);
map<char, int> charMap;
for (int i = 0; i < line.size()... | ALGO | 0.999902 | 4.568208 |
cc778a5f-39db-430a-8356-9c673098387e | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_1952_2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long x, y;
cin >> x >> y;
if (x * log(y) == y * log(x)) {
cout << "=";
} else if (x * log(y) < y * log(x)) {
cout << ">";
} else {
cout << ">";
}
}
| ALGO | 0.999894 | 3.985892 |
a3f7d9f1-00d3-43c0-b61a-45f65c07a4c1 | codecommander03/LeetCode | 0150. Evaluate Reverse Polish Notation.cpp | class Solution {
public:
int evalRPN(vector<string>& tokens) {
stack<int> st;
for(string &s: tokens){
if(s!="+" && s!="-" && s!= "/" && s!= "*") st.push(stoi(s));
else{
int a = st.top();
st.pop();
int b = st.top();
... | ALGO | 0.999908 | 6.091917 |
7e2acebc-60cf-464b-aad1-448e5141cdfe | trinhnn040999/Java_SDS | ThuatToan/NhapBaiHBuoi2.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 45;
int n,M, x[N];
int binary[N];
int dem=0;
int S=0;
void tinh_ket_qua(){
if(S<=M) dem++;
}
void TRY(int i){
if(i>n){
tinh_ket_qua();
}else{
for(int v=0;v<=2;v++){
binary[i]=v;
S+=v*x[i];
if(S<=M) TRY(i+1);
S-=v*x[i];
}
}
}
main(){
c... | ALGO | 0.999977 | 3.802695 |
c9c7f3ed-bafc-44e4-a32e-fb585dc31981 | Manas-277/Graphs | Graphs/graph_implementation_01.cpp | #include <bits/stdc++.h>
using namespace std;
// BY ADJACENCY MATRIX
int main() {
int n;
cout<<"enter the number of nodes: ";
cin>>n;
int e;
cout<<"enter the number of edges: ";
cin>>e;
vector<vector<int>> adj(n, vector<int>(n,0));
for(int i=0; i<e; i++){
int u,v;... | ALGO | 0.999873 | 4.333014 |
aea05b78-671a-4751-a9bc-595f7bdfd34c | ishandutta2007/codeforces | sankear/normal/316/E2.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <complex>
#include <cassert>
using namespace std;
#define pb ... | ALGO | 0.999946 | 4.279482 |
ba54dcbe-6269-42f4-8a3e-325f95d88cf6 | SuvratZZZ/solved | solved/cg25c.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;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
# define ll long long
# define pb push_back
# define fl(i,n) for(ll... | ALGO | 0.999921 | 4.388302 |
1b8502ec-33ba-4626-82a8-8c436fda3517 | HashirAKhan/135-Software-Analysis-and-Design-Labs | Lab6/vigenere.cpp | //Hashir Khan
//135
//Project 6C
//2-28-2019
#include <iostream>
//shifts the character
char shiftChar(char c, int rightShift){
if(!isalpha(c)){
return c;
}
char result = c + rightShift;
if(!isalpha(result)){
result-=26;
}
if(c<91&&result>90){
result-=26;
}
return result;
}
//runs the enc... | ALGO | 0.997048 | 5.02482 |
0c7d65d4-2d3f-44a5-ac56-9883af7df52e | 1571859588/Visual_RM | base_tasks/work1/luogu/5/P5015.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
char ch[15];
int ans=0;
fgets(ch,15,stdin);
int len=strlen(ch);
for (int i=0;i<len;i++)
if (isalnum(ch[i]))
ans++;
cout << ans << endl;
return 0;
}
| ALGO | 0.993538 | 3.483421 |
bd22cf9f-789a-4083-a658-3b77bd6a2663 | hjiang13/LLMs-in-IR | POJ-104/73/2023.cpp | #include <iostream>
using namespace std;
int main()
{
int A[5], B[5], a[5][5], i, j, k, m, n = 0;
for (i = 0; i <= 4; i ++)
for (j = 0; j <= 4; j ++)
cin >> a[i][j];
for (i = 0; i <= 4; i ++)
{
A[i] = a[i][0];
for (j = 0; j <= 4; j ++)
if (a[i][j] >= A[i])
{
A[i] = a[i][j];
m = j;
}
B[m] = a[0][m];
for (k = 0; ... | ALGO | 0.999896 | 3.266803 |
216af792-dfc8-495f-ab88-461521023481 | bj-coder/DSA-practice | DAY02/01.cpp | // This is to understand post increment and pre increment
#include <iostream>
using namespace std;
int main(){
int i = 1, a = 2;
int j = a+(i++);
int k = a+ (i++);
cout << "j="<<j <<"k="<< k ;
}
| ALGO | 0.991617 | 3.223478 |
719d5198-91bc-431b-9e46-222258595909 | sinian666/codes_102_3 | cpp_副本19/chapter_tree/binary_tree_bfs.cpp | /**
* File: binary_tree_bfs.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 层序遍历 */
vector<int> levelOrder(TreeNode *root) {
// 初始化队列,加入根节点
queue<TreeNode *> queue;
queue.push(root);
// 初始化一个列表,用于保存遍历序列
vector<int> vec;
while (!queue.empty())... | ALGO | 0.99918 | 5.825569 |
4e517da6-e547-461e-baf0-04e95ddeb1c8 | ChandlerNgo/CP | CFPractice/2132C.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while(t--){
int n;
cin >> n;
vector<pair<ll,ll>> deals; // watermelons : price
for(int x... | ALGO | 0.999361 | 3.721115 |
e68ffb95-e3aa-4e13-8b51-a07347d901a8 | PrathamShah10/CP-Templates | trie.cpp | struct Node {
Node *links[26];
bool flag = false;
//checks if the reference trie is present or not
bool containKey(char ch) {
return (links[ch - 'a'] != NULL);
}
//creating reference trie
void put(char ch, Node *node) {
links[ch - 'a'] = node;
}
//to get the next node... | ALGO | 0.999809 | 5.598622 |
94e6b5eb-e317-44e2-a6bc-11ec4af53e4a | sottorivalab/FORECAST_image_tiling | code/image_tiles/3rdparty/OpenCV-4.1.2/modules/features2d/src/bagofwords.cpp | #include "precomp.hpp"
namespace cv
{
BOWTrainer::BOWTrainer() : size(0)
{}
BOWTrainer::~BOWTrainer()
{}
void BOWTrainer::add( const Mat& _descriptors )
{
CV_Assert( !_descriptors.empty() );
if( !descriptors.empty() )
{
CV_Assert( descriptors[0].cols == _descriptors.cols );
CV_Assert( de... | ALGO | 0.968449 | 6.568462 |
3d1a6d70-2466-44bf-9cd4-13ccf7a652f0 | ARenomX/CSE201 | TD5/solutions/LinkedList.cpp | #include <iostream>
#include "LinkedList.hpp"
#include <cstdlib>
#include <ctime>
using namespace std;
ListNode::ListNode(int d, ListNode* nxt)
{
data = d;
next = nxt;
}
ListNode::~ListNode()
{
if (next != NULL) delete next;
}
LinkedList::LinkedList()
{
first = NULL;
last = NULL;
}
LinkedList::~Linked... | ALGO | 0.999518 | 4.186585 |
fc31f0bd-8cf1-4dfb-ac96-dffbe3574792 | dlwlehd/BOJ_Cpp | Silver_3/15652.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
int arr[10];
bool isused[10];
void func(int x, int k) {
if (k == m) {
for (int i = 0; i < m; i++)
cout << arr[i] << ' ';
cout << "\n";
return;
}
for (int i = x; i <= n; i++) {
arr[k] = i;
func(i, k + 1);
}
}
int main(void) {
ios::sync_with_st... | ALGO | 0.999631 | 4.094565 |
3cb77cb6-092a-4122-9259-98a0e4f2a66c | wendellcamargo/Projetos_C-- | pacote_dow/Projetos_C++/Switch_case_soma_produtos.cpp | # include <stdio.h>
# include <conio.h>
# include <locale.h>
int main(){
setlocale(LC_ALL, "Portuguese");
int cod, a, b, x;
printf("Digite o nmero da opo desejada:\n1-Quadrado da diferena\n2-Quadrado da soma");
printf("\n3-Soma do quadrado\n4-Diferena do quadrado\n5-Produto da soma pela diferena\nOpo: ");
scanf("%d",... | ALGO | 0.997203 | 4.146211 |
4037e674-50de-431d-8aac-a513dacad60b | saim-akhtar03/DSA | palindrome.cpp | #include <iostream>
using namespace std;
void reverse(char arr[],int n){
int s=0;
int e=n-1;
while (s<e){
swap(arr[s++],arr[e--]);
}
}
int getLength(char arr[]){
int count=0;
for (int i = 0; arr[i] !='\0'; i++)
{
count ++;
}
return count;
}
char converter(char ch)... | ALGO | 0.99969 | 4.678936 |
af7166dc-1a4b-429a-90cd-07fc8c1f1ba9 | Congee/leetcode | src/992.subarrays-with-k-different-integers.cpp | #ifdef __LOCAL__
#include <leetcode.h>
#endif
class Solution {
public:
int subarraysWithKDistinct(vector<int>& nums, size_t k) {
return at_most(nums, k) - at_most(nums, k - 1);
}
int at_most(vector<int>& nums, size_t k) {
if (k < 0) return 0;
std::unordered_map<int, int> map;
int n = nums.size... | ALGO | 0.999747 | 6.771121 |
f1b42a77-6bf7-4c1c-867f-a4cd488416ae | GabrielCortizo/Competitive-Programming-3 | Introduction/Ad Hoc Problems/Anagram/UVa630_AnagramsII .cpp | #include <bits/stdc++.h>
#define rep(i,b,c) for(int i = b;i<c;i++)
using namespace std;
typedef pair<string,string> ss;
int main(){
vector<ss> voca;
vector<string> sear;
string a,b;
int n,d = 0,t,cont;
scanf("%d",&t);
cin.ignore();
while(t--){
if(d!=0)
puts("");
d++;
voca.clear();sear.clear();
cin.ig... | ALGO | 0.999714 | 3.522693 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.