uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
70dedfee-ae20-40f7-b281-2d1fd04e6ca3 | maucoen/UnrealNavigation | Source/UnrealNavigation/poly.cpp | /**
* @file poly.cpp
*
* @author Gene Merewether
*/
#include <assert.h>
#include "poly.hpp"
namespace polytraj
{
Poly::Poly(uint32_t n_coeff, POLYTRAJ_FLOAT *coeffs)
{
assert(coeffs);
n_coeff_ = n_coeff;
// TODO - <EMAIL> - watch for performance hits with this dynamic allocation
der_coeffs_ = new POLYTRAJ_FL... | ALGO | 0.973192 | 5.034178 |
380cd923-d348-43b5-9297-1a30621aefae | shubhamgyd/mission_TCS | Daily_Coding_problems/146_Range_Minimum_Query.cpp | /*
This problem was asked by Twitter.
You are given an array of length 24, where each element represents the number of new subscribers
during the corresponding hour. Implement a data structure that efficiently supports the following:
update(hour: int, value: int): Increment the element at index hour by value.
query(... | ALGO | 0.983947 | 5.420941 |
1366ac61-4a39-4ec4-a415-d15bab2a04ea | ishandutta2007/codeforces | lucina/normal/1167/A.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn=3e5+10;
int n,t,pt;
char s[maxn];
int main(){
scanf("%d",&t);
while(t--){
scanf("%d%s",&n,s+1);
pt=n+1;
for(int i=1;i<=n;i++){
if(s[i]=='8'){
pt=i;
break;
}
}
... | ALGO | 0.998703 | 3.988958 |
cb42be14-ccb7-44bb-a63e-47941ebeecbf | UtkarshPathrabe/Competitive-Coding | HackerRank Solutions/C++/STL/Deque-STL.cpp | #include <iostream>
#include <deque>
using namespace std;
void printKMax(int arr[], int n, int k){
deque<int> Qi(k);
int i;
for (i = 0; i < k; i++) {
while ((!Qi.empty()) && (arr[i] >= arr[Qi.back()]))
Qi.pop_back();
Qi.push_back(i);
}
for ( ; i < n; i++) {
cout ... | ALGO | 0.999968 | 3.865435 |
3f8b107f-bdd9-4d40-9f93-2198aaedff62 | monidipa1289/Monidipa-Das | 4.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,n;
cout<<"Enter the first two number of fabonacci series"<<endl;
cin>>a>>b;
cout<<"Enter the number of terms you want to display"<<endl;
cin>>n;
int fs[n];
fs[0]=a;
fs[1]=b;
for(int i=2;i<n;i++)
fs[i]=fs[i-1]+fs[i-2];
... | ALGO | 0.999725 | 3.385367 |
fa305ed2-1554-4126-8e88-49944ac60f56 | javagovindsharma/leetscode | solution/0500-0599/0560.Subarray Sum Equals K/Solution.cpp | class Solution {
public:
int subarraySum(vector<int>& nums, int k) {
unordered_map<int, int> cnt{{0, 1}};
int ans = 0, s = 0;
for (int x : nums) {
s += x;
ans += cnt[s - k];
++cnt[s];
}
return ans;
}
}; | ALGO | 0.999938 | 6.23962 |
d3675eb9-3fc1-4bc6-85cc-4a0852e880e7 | rvgpu/rvgpu-llvm | libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move.segmented.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
#include <algorithm>
#include <array>
#include <cassert>
#include <concepts>
#include <deque>
#include <ranges>
#include <vector>
#include "test_iterators.h"
#include "type_algorithms.h"
template <class InContainer, class OutContainer>
constexpr void test_containers() {
u... | TEST | 0.895608 | 7.607702 |
de6de1b3-2773-48d8-b895-c9ab6903bfb9 | Chicaogo/WinCode | 刷题/洛谷刷题/动态规划/P1387 最大正方形.cpp | #include<bits/stdc++.h>
using namespace std;
int mapp[110][110],dp[110][110];
int n,m,ans = 0;
int main(int argc, char const *argv[])
{
cin >> n >> m;
for(int i = 1;i <= n;++i)
{
for(int j = 1;j <= m;++j)
{
cin >> mapp[i][j];
}
}
for(int i = 1;i <= n;++i)
... | ALGO | 0.999958 | 4.236048 |
d50bf32f-daf4-44f7-8500-e66972577e93 | AcaiHi/Sunny | 1742B.cpp | // 1742B.cpp
#include<iostream>
#include<set>
using namespace std;
int t, n;
int main(){
cin >> t;
while (t--){
cin >> n;
int q[n]; for (int &it : q) cin >> it;
set<int> ans;
for (int it : q) {
ans.insert(it);
}
cout << (ans.size() == n ? "Yes\n" : "No\n");
}
} | ALGO | 0.999824 | 4.219951 |
c5f610e2-bab0-4817-93b4-30af9afe6900 | Cognitive-Robotics-Lab/TurtleRPI | TurtleTracker/src/PersonTrackerHog.cpp | #include <ros/ros.h>
#include <stdio.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/core/version.hpp>
#include <open... | TOOL | 0.957147 | 5.615567 |
063ed2df-b1a0-49bc-b9d6-2f632b83256e | armanengin/CS202-Fundamental-Structures-of-Computer-Science | CS202/Hw2/21801777_01_hw2/BinaryNode.cpp | #include <iostream>
#include "BinaryNode.h"
/*
* Title: Binary Search Trees
* Author: Arman Engin Sucu
* ID: 21801777
* Section: 1
* Assignment: 2
* Description: source file of the BinaryNode class
*/
//CONSTRUCTORS
BinaryNode::BinaryNode() { //default constructor
item = 0;
leftChildPtr = NULL;
rightChildPtr = NUL... | ALGO | 0.996258 | 3.460698 |
23735cf4-4cba-48e9-9eea-320e06bd1f95 | aditya-agr/LeetCode-POTD | 38. Count and Say.cpp | class Solution {
public:
string countAndSay(int n) {
if(n == 1)
return "1";
string str = countAndSay(n-1);
int cnt=0;
char ele=str[0];
string res = "";
for(char c : str){
if(c == ele)
cnt++;
else{
re... | ALGO | 0.999993 | 7.106078 |
f9fe53f8-89d4-4962-b03d-b967735e37b0 | 192210530/myASSIGNMENTS | sum of n numbers.cpp | #include <stdio.h>
int main()
{
int n, sum = 0, c, value;
printf("How many numbers you want to add?\n");
scanf("%d", &n);
printf("Enter %d integers\n", n);
for (c = 1; c <= n; c++)
{
scanf("%d", &value);
sum = sum + value;
}
printf("Sum of the integers = %d\n", sum);
return 0;
}
| ALGO | 0.978002 | 3.294709 |
677ea3a2-b17f-42d8-9a5d-13a5897c5e25 | godsonsphilip/Leetcode | 1458-sort-integers-by-the-number-of-1-bits/sort-integers-by-the-number-of-1-bits.cpp | class Solution {
public:
vector<int> sortByBits(vector<int>& arr) {
int n = arr.size();
vector<int> result;
map<int, vector<int>> myMap;
for(auto& i: arr){
int t = __builtin_popcount(i);
myMap[t].push_back(i);
}
for(auto& [_, val]: myMap){
... | ALGO | 0.999996 | 5.748815 |
4c154479-13c0-400d-affb-e56fc6c28ec6 | gauravkumarjha442/Leetcode | leetcode/455. Assign Cookies/s1.cpp | // OJ: https://leetcode.com/problems/assign-cookies
// Author: github.com/lzl124631x
// Time: O(max(GlogG, SlogS))
// Space: O(1)
class Solution {
public:
int findContentChildren(vector<int>& g, vector<int>& s) {
sort(g.begin(), g.end(), greater<int>());
sort(s.begin(), s.end(), greater<int>());
auto ig =... | ALGO | 0.999859 | 6.13581 |
cae60d8c-68ac-406c-a106-736b192a8123 | eErr0Re/aoc | 2022/02/2_0.cpp | #include <iostream>
#include <fstream>
#include <chrono>
int main()
{
const auto start {std::chrono::steady_clock::now()};
std::ifstream in {"input.txt"};
char opponent, you;
unsigned score {};
const unsigned points[][3] {
{3, 6, 0},
{0, 3, 6},
{6, 0, 3}
};
const... | ALGO | 0.99939 | 6.232169 |
b8240c52-59d2-4c22-91d5-544f35566b1e | wowoto9772/Hungry-Algorithm | BOJ/11663/solution.cpp | #include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
int p[100003];
int s[300003];
int l[100003], r[100003];
vector <int> x;
int find(int v){
int l = 0, r = x.size() - 1, m;
while (l <= r){
m = (l + r) / 2;
if (x[m] < v)l = m + 1;
else if (x[m] > v)r = m - 1;
else
return m;
}... | ALGO | 0.999973 | 4.041569 |
6447a3cd-a0b6-41e2-9030-2595b7f2d6d4 | Daffodils-and-Chocolates/Cpp | Miscellaneous/basic/FarenheitCelsiusConverter.cpp | #include <iostream>
using namespace std;
int main(){
float n,v;
char d;
cout << "Enter number and then f/c" <<endl;
cin >> n >> d;
if (d =='F'||d =='f'){
v = (n-32)*(5.0/9);
cout << n << "F" << " : " << v << "C";
}
else if (d =='c'||d =='C'){
v = ((9.0/5)*n) + 32;
... | TOOL | 0.98282 | 4.473422 |
ee42f63e-9602-4147-a4b9-2c96c99bf44f | hydro1d/Competitive_Programming-CP_course_laptop | Codeforces_CP2YT/lamp_cf.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int test;
cin >> test;
while (test--) {
int n;
string l;
cin >> n >> l;
int motlp = 0;
for (int j = 0; j < n; j++) {
if (l[j] == '1') {
++motlp;
}
... | ALGO | 0.999987 | 6.659445 |
a4c6818d-4181-4ae0-972d-9b80ef094c03 | bashrc-real/Codearchive | cpp/codeforces/499b.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999979 | 3.65127 |
ebeeccaa-52ca-4409-abfe-eeba0e887b13 | rajyan/AtCoder | ABC/ABC125/Dver2.cpp | //#include <iostream>
//#include <sstream>
//#include <cstdio>
//#include <cmath>
//#include <vector>
//#include <string>
//#include <algorithm>
//#include <map>
//#include <set>
//#include <queue>
//
//#ifdef _DEBUG
//#define DMP(x) cerr << #x << ": " << x << "\n"
//#else
//#define DMP(x) ((void)0)
//#endif
//
//const... | ALGO | 0.99998 | 4.464765 |
ced7b758-f220-47c5-9827-225009f51b65 | MoisesFV/programming-exercises | c++/exercicios/05_matrizes/04_cada_linha/04_cada_linha.cpp | /*
Problema "cada_linha"
Ler um inteiro N e uma matriz quadrada de ordem N (mximo = 10). Mostrar qual o maior elemento
de cada linha. Suponha no haver empates.
*/
#include <iostream>
using namespace std;
int main()
{
int ordem;
cout << "Qual a ordem da matriz? ";
cin >> ordem;
int** mat = new int* [or... | ALGO | 0.99984 | 4.237223 |
1c883b0f-ffc2-49a5-bc71-4e45a441479c | RajdevKapoor/Leetcode-Practice | 56-merge-intervals/56-merge-intervals.cpp | //Comment and Upvote
class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& interval) {
vector<vector<int>> result;
if(interval.size()==0)return result;
sort(interval.begin(),interval.end());
result.push_back(interval[0]);
int j=0;
for(int i=1;i<in... | ALGO | 0.999998 | 5.828916 |
2f80f9f0-68e2-4aeb-a305-06959e6ff3cb | Nafish-Nobel/primeNumber-cpp-solve | Hello.cpp | #include <iostream>
using namespace std;
int main() {
int myAge = 35;
int x = 5;
int y = 3;
int sum = x+ y;
// cout <<"I am " << myAge <<" year old. \n";
// cout <<"Total " <<sum;
// cout << " sija valobashi";
cout << " Total Amount is " << sum << " Taka";
}
| TOOL | 0.862628 | 3.224637 |
bb705d7b-69e0-41a5-82ba-c8324f744566 | NipunRathore/GFGPracticeSolutions | Basic/Game with nos/game-with-nos.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
int* game_with_number(int arr[], int n);
int main()
{
int t;cin>> t;
while(t--)
{
int n;
cin >> n;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
int *arr2;
... | ALGO | 0.999892 | 4.486486 |
3079fc2c-0880-42b8-849c-52768aa9b6bc | AbdullahChouhan/FastUniProjects | Archive/SEMESTER 1/Mid-1/1.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
long long int fac(unsigned int n) {
if (n > 0)
return (n * fac(n - 1));
else
return 1;
}
int main()
{
int flip = 0, j;
float result, x;
cout << "Enter value to calculate f(x) of: ";
cin >> x;
resul... | ALGO | 0.99998 | 3.985162 |
d82bd6cf-8675-4016-a814-51209c3012bd | tamofplease/atcoder_abc | 26/C.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N;
cin >> N;
vector<vector<int> > G(N+3);
for(int i=2;i<N+1;i++){
int a;
cin >> a;
G[a].push_back(i);
}
int a[21];
for(int i=N;i>=1;i--){
if(G[i].empty()){
a[i] = 1;
... | ALGO | 0.99982 | 3.252774 |
eb3f027a-f8ba-4510-be17-f9600237bacb | SUSHANTSINGH01/CP-AND-DSA | DSA/dynamic_programming/best_time_to_buy_and_sell_stock_I.cpp | int Solution::maxProfit(const vector<int> &A)
{
int n=A.size();
if(n==0)
return 0;
vector<int>minn(n+1,0);
minn[0]=A[0];
int res=INT_MIN;
for(int i=1;i<=n;i++)
{
minn[i]=min(minn[i-1],A[i-1]);
if(abs(minn[i]-A[i-1])>res)
res=abs(minn[i-1]-A[i-1]);
}
retu... | ALGO | 0.999835 | 5.746595 |
0f3e191d-f4bf-4eb5-82e5-fff60410460c | amana632/Competetive-Programming | gfg/check if a no is power of another.cpp | #include <iostream>
#include <math.h>
#define ll long long int
using namespace std;
int main() {
ll t;
cin>>t;
while(t--){
ll x,y;
cin>>x>>y;
double a=log(y)/log(x);
if(a==int(a)) cout<<1<<endl;
else cout<<0<<endl;
}
//code
return 0;
} | ALGO | 0.998455 | 4.163383 |
e6a5e32e-5e50-49a9-bf43-54fbfb588bb6 | Kishan619/Leetcode-Streak | Largest Substring Between Two Equal Characters.cpp | class Solution {
public:
int maxLengthBetweenEqualCharacters(string s) {
int ans = -1;
for (int left = 0; left < s.size(); left++) {
for (int right = left + 1; right < s.size(); right++) {
if (s[left] == s[right]) {
ans = max(ans, right - left - 1);
... | ALGO | 0.999757 | 5.681641 |
c98c32d6-d102-4729-9c86-f5038ae49c75 | Minipoloalex/comp_prog | codeforces/contests/2112_div2/C/C.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
vector<int> arr(n);
for (auto &ai: arr) cin >> ai;
int max_value = arr.back();
int64_t ans = 0;
for (int i = 0; i < n; i++) {
int a = arr[i];
for (int j = i + 1; j < n; j++) {
int b = a... | ALGO | 0.999919 | 5.081022 |
25e7fe7d-8be4-4326-8350-b476b1562e40 | sherkevin/Resource-Collection | notes/codes/C++/CCF202203-2.cpp | #include <iostream>
#include <algorithm>
using namespace std;
const int N = 100010;
int n, m, k;
int d[2 * N];
int main() {
cin >> n >> m >> k;
for(int i = 0; i < n; i ++) {
int t, c;
cin >> t >> c;
int start = t - (c - 1) - k; //最早的核酸检测时间
int end = t - k; //最晚的核酸检测时间
//[start, end] ++
if(end < 1) contin... | ALGO | 0.999919 | 3.577412 |
c7e4732a-f071-4807-ac21-af02e01e0f30 | AdityaPrakash-26/Leetcode-Solutions | Aditya/0100-0999/415.add-strings.cpp | /*
Accepted
317/317 cases passed (0 ms)
Your runtime beats 100 % of cpp submissions
Your memory usage beats 34.88 % of cpp submissions (7.2 MB)
*/
/*
* @lc app=leetcode id=415 lang=cpp
*
* [415] Add Strings
*/
// @lc code=start
class Solution {
public:
string addStrings(string num1, string num2) {
if(... | ALGO | 0.99992 | 6.973953 |
0021e60c-2b2c-4235-b9b6-76d15f549774 | ApoapsisAlpha/Competitive-Programming | Mock CCC/nccc6j3.cpp | #include <bits/stdc++.h>
using namespace std;
int t;
int main() {
cin.sync_with_stdio(0);
cin.tie(0);
cin >> t;
while (t--) {
int a, b, c;
cin >> a >> b >> c;
bool f = false;
for (int i = 0; i <= 50; i++) {
for (int j = 0; j <= 50; j++) {
if ... | ALGO | 0.999729 | 4.938838 |
81a25fc3-b8e0-4cc5-a0bf-26a3e5beeab6 | skytree82/Algorithms | Sort/MedianOfThreeQuickSort.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
template <class T>
void Swap(T& a, T& b) {
T tmp = a;
a = b;
b = tmp;
}
template <class T>
int Partition(T arr[], int p, int r, bool (*cmp)(T a, T b)) {
T tmp;
T pivot;
int mid = (p + r) / 2;
if (arr[p] <= arr[mid] && arr[mid] <= arr... | ALGO | 0.999801 | 5.031626 |
243a211f-1215-4507-a8f6-b8bbf1d35439 | alu0101321257/Basics- | ordenamiento/seleccion.cpp | #include <iostream>
int main(){
int num[] ={4,3,1,5,2};
int aux;
int count =0;
int min =0;
//pasos para el algoritmo de ordenación selecion:
//1. se busca el menor elemento del array
//2. se intercambia con el primer elemento del array
//3. se busca el menor elemento del resto del a... | ALGO | 0.999983 | 3.654363 |
1d903d03-7e14-48d0-bc5a-92cd1d15bbcc | whynesspower/Nakamura-Ikusa-Software | 841_Div2/a.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#incl... | ALGO | 0.999706 | 5.37413 |
6526228c-bf24-47e6-84d7-cdbd0dae1ec4 | ashlamp08/Codeforces | 463/C - Gargari and Bishops.cpp | #include<bits/stdc++.h>
using namespace std;
long long arr[2003][2003];
long long sumarr[2003][2003];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
long long n;
cin>>n;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
cin>>arr[i][j];
long long sum1[2*n];
long long sum2[2*n];
memset(sum1,0,2*n... | ALGO | 0.999828 | 3.145732 |
4c7b9560-545b-43c6-ba3d-c6e2814fcb36 | ojoaosoares/Sorting-Algorithm-Analysis | src/main.cpp | #include <stdio.h>
#include <algorithm>
#include <cstdint>
#include "bubble_sort.hpp"
#include "bucket_sort.hpp"
#include "counting_sort.hpp"
#include "insertion_sort.hpp"
#include "merge_sort.hpp"
#include "quick_sort.hpp"
#include "radix_sort.hpp"
#include "selection_sort.hpp"
#include "shell_sort.hpp"
#include "arra... | ALGO | 0.99953 | 4.968508 |
8880d9c8-9db3-452b-99f1-cfdd5bdd8580 | hiimghosty/clasescompu | 2P/abelmatrizpun.cpp | #include <iostream>
#include <cstdlib>
// Matriz ordenada por cuadrantes pero con punteros
using namespace std;
int validarN()
{
float x;
do
{
cout << "Introducir N entero, par y mayor que 3: ";
cin >> x;
} while (x != int(x) or (int(x) % 2) != 0 or x < 3);
return x;
}
int nroAlea... | ALGO | 0.999702 | 3.450504 |
f9870855-f59e-4ee9-acd6-2efa102f8507 | friedeggs01/Applied-Algorithms | Day12/3_sum_length_paths_from_root.cpp | // tìm tâm điểm trên cây
#include<bits/stdc++.h>
using namespace std;
#define N 100001
struct Edge {
int node;
int w;
Edge(int _node, int _w) : node(_node), w(_w) {}
};
int n;
vector<Edge> A[N];
int root;
int d[N]; // d[u] is the sum of weights of path from descendant of u to u
int num[N]; // num[u] is ... | ALGO | 0.999952 | 4.223523 |
e0972bd0-2860-437b-96a9-59507e5112b0 | Furina-Focalors/Algorithm | 1012.cpp | #include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;
struct point{
double x;
double y;
};
struct edge{//最下以外的另一点pt,夹角angle
point pt;
double angle;
double len;
};
bool compare(edge a,edge b){
if(a.angle==b.angle){
return a.len<b.len;
}
re... | ALGO | 0.999995 | 4.401385 |
fa1469d3-250b-417c-b386-6e30949158e2 | amrhead/FireNET | SDKs/CryCode/3.7.0/GameDll/WeaponStrafeOffset.cpp | #include "StdAfx.h"
#include "WeaponStrafeOffset.h"
#include "Weapon.h"
#include "Utility/Hermite.h"
#include "WeaponFPAiming.h"
#include "WeaponOffset.h"
namespace
{
float SignedPow(float linearVal, float curvePower)
{
return pow_tpl(fabs_tpl(linearVal), curvePower) * fsgnnz(linearVal);
}
}
CStrafeOffset::CSt... | ALGO | 0.929351 | 6.576112 |
d1501b3b-bdad-4858-9114-3914fb8e722b | OoWoOI/C-Practice-1 | 06.C++面向对象编程/23-29/02.从C到C++/16.STL-unorderd_set-579-相似的数集.cpp | /*************************************************************************
> File Name: 16.STL-unorderd_set-579-相似的数集.cpp
> Author:
> Mail:
> Created Time: Sat 07 Oct 2023 01:59:13 PM CST
************************************************************************/
#include<iostream>
#include<unordered_set>
using ... | ALGO | 0.999526 | 4.240482 |
50c57b57-363b-404e-b63a-826af5279be2 | MahinAshraful/CodeWatch_Data | sample-data/p00006/s946158644.cpp | #include <iostream>
#include <string>
using namespace std;
string reverse(string s)
{
char *rev_c = new char[s.size()];
for (int i = s.size() - 1; i >= 0; i--)
{
rev_c[s.size() - 1 - i] = s[i];
}
string rev_s(rev_c, s.size());
delete rev_c;
return rev_s;
}
int main()
{
string s;
cin >> s;
cout << revers... | ALGO | 0.999714 | 5.420458 |
7365b296-4b5d-4b58-a7c3-a4d53be3219a | gracexiao1029/ComputerGraphics | computer-graphics-meshes/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::MatrixBase<DerivedF1>& F1,
Eigen::PlainObjectBase<DerivedF2>& F2,
Eigen::PlainObjec... | ALGO | 0.971399 | 5.631041 |
0d8083e8-4722-4458-8f7b-722e73d80489 | SylarAnh/docker-colrio | 3rd_party/gtsam-4.2a8/gtsam/base/Vector.cpp | /**
* @file Vector.cpp
* @brief typedef and functions to augment Eigen's Vectors
* @author Kai Ni
* @author Frank Dellaert
* @author Varun Agrawal
*/
#include <gtsam/base/Vector.h>
#include <boost/optional.hpp>
#include <stdexcept>
#include <cstdarg>
#include <limits>
#include <iostream>
#include <fstrea... | TOOL | 0.95137 | 6.791008 |
7ad9c9ac-0102-4674-b8a8-41a7b48e3ba0 | Hwkas/DSA | leetcode/linked_list_find_mid_node.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = nullptr;
}
~Node()
{
if (this->next != nullptr)
{
delete next;
this->next = nullptr;
}
}... | ALGO | 0.999913 | 5.94897 |
6175fab2-97a7-469b-bc21-53ce8ebaa6a6 | garry133/Leetcode | watering-plants/watering-plants.cpp | class Solution {
public:
int wateringPlants(vector<int>& p, int c) {
int ans=0,a=c;
for(int i=0;i<p.size();i++){
ans++;
if(a<p[i]){
ans+=i;
a=c;
ans+=i;
}
a-=p[i];
}
return ans;
}
}; | ALGO | 0.999996 | 5.439152 |
7e893507-9052-420c-a9a3-6c2ebe32d20b | MiraclesinWang/ACM_exercise | 排位赛/组队赛1/F.model.cpp | #include<iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <set>
using namespace std;
struct Tuple{
long long a,b,c;
int ind;
}tup[100010];
bool cmp(Tuple x,Tuple y){
unsigned long long l=x.a*y.c+x.b*y.c;
unsigned long long r=y.a*x.c+y.b*x.c;
if(l==r) return x.ind... | ALGO | 0.999869 | 3.552433 |
6afafa35-68cb-47cf-8921-4a74ca92660e | staxhinho/CPlusPlus | Tic-Tac-Toe/TicTacToe.cpp | #include <iostream>
#include <ctime>
void drawBoard(char *spaces);
void playerMove(char *spaces, char player);
void computerMove(char *spaces, char computer);
bool checkWinner(char *spaces, char player, char computer);
bool checkTie(char *spaces);
int main() {
char spaces[9] = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ... | ALGO | 0.998827 | 5.538332 |
964ab9b8-7169-4468-9e99-b0bcbf71a1d5 | sahilpate-221s/Leetcode_solutions | 1197-parsing-a-boolean-expression/parsing-a-boolean-expression.cpp | class Solution {
public:
char solveOperator(vector<char>& values, char op)
{
if(op == '!')
{
return values[0]=='t' ? 'f' :'t';
}
// handle '&'
if(op == '&')
{
// for(char &ch: value)
// {
// if(ch=='f')
... | ALGO | 0.999689 | 5.975696 |
bf5a248e-ddd0-458c-b5ac-97bc8faf6d35 | ishandutta2007/codeforces | stupid_justin/normal/1413/D.cpp | #include<bits/stdc++.h>
#define NO {puts("NO");return 0;}
#define int long long
#define rd(x) x=read()
using namespace std;
inline int read(){int x=0,f=1;char ch=getchar();while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*f;}
const int N=2e5+5;
int n,cnt;
i... | ALGO | 0.999984 | 3.365349 |
65b94c44-473c-4ef3-8ebf-10c182a4bbab | abdulmoeedsiddiqi/C- | Conditional_structures.cpp/6.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter number: "; cin>>n;
if(n > 0){
cout<<n<<" is positive number. ";
}
else if(n < 0 ){
cout<<n<<" is negative number. ";
}
else{
cout<<n<<" is equal to zero. ";
}
return 0;
} | ALGO | 0.990387 | 3.383567 |
c04db4a9-74e1-462c-8f33-02aa83e403c3 | gasparddannet/advent_of_code | 2024/day7/part1.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <list>
using namespace std;
void print_vectl(vector<long double>& v) {
for (long double i : v) {
cout << i << " ";
}
cout<<endl;
}
void print_vect(vector<vector<long double>>& v) {
for (vec... | ALGO | 0.998976 | 3.75365 |
eb711320-9aa7-4a40-b049-4d5bc9220b7d | kimchicaithao/kimchiB | Bai_2_Sap_xep_chon.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie();
int n;
cin>>n;
int a[n],i,j, min_idx, temp, buoc = 1;
for(i = 0 ; i < n;i++)
cin>>a[i];
for (i = 0; i < n-1; i++)
{
min_idx = i;
for (j = i+1; j < n; j++)
if (a[j] < a[min_idx])
... | ALGO | 0.999977 | 3.589014 |
ca8acb6a-8723-4b7a-b12c-f2ff0f084619 | amineAllache/llvm-bolt19 | libc/src/stdbit/stdc_first_leading_zero_uc.cpp | #include "src/stdbit/stdc_first_leading_zero_uc.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/math_extras.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(unsigned, stdc_first_leading_zero_uc,
(unsigned char value)) {
return static_cas... | ALGO | 0.962126 | 6.770833 |
f9a14269-d23d-4278-a31b-5339cc589b5f | MarkKim1/Leetcode | 169-majority-element/169-majority-element.cpp | class Solution {
public:
//Boyer-Moore only works with finding majority inside the array when majority count is more than n/2
//where n is size of vector
int majorityElement(vector<int>& nums) {
int candidate = -1;
int votes = 0;
for(int i = 0; i < nums.size(); i++){
if(v... | ALGO | 0.999937 | 5.717563 |
b4afcb7d-6006-4be2-9357-876918671f18 | GaussGreen/old-code | arm/dev/ARMGenPricer/GP_NumLib/tausworthe.cpp | #include "gpnumlib/tausworthe.h"
CC_BEGIN_NAMESPACE( ARM )
////////////////////////////////////////////////////
////////////////////////////////////////////////////
////////// ARM_RandUniform_Tausworthe ///////////
////////////////////////////////////////////////////
////////////////////////////////////////////////... | ALGO | 0.997892 | 4.313397 |
12707cd7-ef75-441c-b6b8-65a2da18c7e0 | Oaik/problems-solution | codeforces/contest/1055/b/45569965.cpp | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <cmath>
#include <iomanip>
//#include <complex>
using namespace std;
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
#define clr(arr, k) (memset(arr, k, sizeof(arr)))
#define lpv(i,a,n) for(int i=a;i<(int)n;i++)
#define l... | ALGO | 0.999747 | 3.25383 |
bf6b8e50-b969-436a-9cea-98ad41f25dca | icelemon233/ECH-Leetcode | 数组/map&set/466.统计重复个数.cpp | /*
* @lc app=leetcode.cn id=466 lang=cpp
*
* [466] 统计重复个数
*/
// @lc code=start
#include <string>
#include <unordered_map>
using namespace std;
class Solution
{
public:
int getMaxRepetitions(string s1, int n1, string s2, int n2)
{
unordered_map<int, pair<int, int>> hashmap;
// 最终遍历过多少个“重复n2... | ALGO | 0.999935 | 6.312895 |
6babe3cf-74e6-4b9f-8b23-29d380134b24 | ishandutta2007/codeforces | quang/normal/930/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 10010;
int n;
char s[N];
vector<int> a[100];
int cnt[30];
int main() {
scanf("%s", s + 1);
n = strlen(s + 1);
for (int i = n + 1; i <= n * 2; i++) {
s[i] = s[i - n];
a[s[i] - 'a'].push_back(i - n);
}
double res = 0.;
for (int i = 0; i < 26; i++) ... | ALGO | 0.999704 | 3.440677 |
d973b7a5-5ebb-4436-8dd7-cb6e6601e862 | DangarKrishna/Codes | practice 3.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
double a,b,c;
double avg;
float total;
cout<<" Input any three number of your choice:";
cout<<endl;
cin>>a>>b>>c;
total=(a+b+c);
avg=(total/3);
cout<<"Average of given numbers is:"<<avg<<endl;
return 0;
} | TOOL | 0.964898 | 3.427242 |
9056ed49-4250-47c1-a9bd-f2986ee6057c | NeverHappys/final-project-saikt | final-project-saikt/perling.cpp | #include "perling.h"
Perling::Perling(int WIDTH, int HEIGHT){
this->HEIGHT = HEIGHT;
this->WIDTH = WIDTH;
map = new float*[WIDTH];
for (int i = 0; i < WIDTH; i++) {
map[i] = new float[HEIGHT];
}
}
float Perling::lerp(float a, float b, float x){
return a + x * (b - a);
}
float Perling::smooth(float x, float y... | TOOL | 0.91816 | 3.291405 |
48f5aa0a-0361-4505-8870-31b8a053e803 | RajThak-998/Cpp | 07_Recursion.cpp/05_sum.cpp | #include<bits/stdc++.h>
using namespace std;
int sum(int n){
if(n==0){
return 0;
}
int ans = n + sum(n-1);
return ans;
}
int main(){
cout<<sum(7);
return 0;
} | ALGO | 0.999911 | 3.783511 |
b9263d0a-8086-4ad8-b14d-d2e86909893b | suyoumo/DeepClaude_Benchmark | src/2025-02-24-deepclaude-rust/cpp/exercises/practice/knapsack/knapsack_test.cpp | #include "knapsack.h"
#include <vector>
#ifdef EXERCISM_TEST_SUITE
#include <catch2/catch.hpp>
#else
#include "test/catch.hpp"
#endif
TEST_CASE("no items", "[maximumValue][3993a824-c20e-493d-b3c9-ee8a7753ee59]")
{
int max_weight = 100;
const std::vector<knapsack::Item> items{};
REQUIRE(knapsack::maximum_va... | TEST | 0.988437 | 6.966135 |
c5d54f2c-3bd9-46df-8776-f037d4d6c874 | openfheorg/education | examples/ip_masking/figures/openfhe_main/src/binfhe/examples/pke/boolean-ap-pke.cpp | /*
Example for the FHEW scheme using the AP bootstrapping
*/
#include "binfhecontext.h"
using namespace lbcrypto;
int main() {
// Sample Program: Step 1: Set CryptoContext
auto cc = BinFHEContext();
// STD128 is the security level of 128 bits of security based on LWE Estimator
// and HE standard... | ALGO | 0.995276 | 5.343544 |
c5513c5c-eee9-4de3-9e9f-d4143f67f5dd | aleksejspopovs/6857-private-categorization | src/main.cpp | #include <cassert>
#include <iostream>
#include "psi.h"
#include "random.h"
#include "test_utils.h"
using namespace std;
int main()
{
auto random_factory = UniformRandomGeneratorFactory::default_factory();
auto random = random_factory->create();
size_t receiver_N = 10;//5535;
size_t sender_N = 100; ... | TEST | 0.950773 | 5.292026 |
8644383b-886c-4d29-badd-025f3a55de56 | 33arsenic75/leetcode | 0695-max-area-of-island/0695-max-area-of-island.cpp | class Solution {
public:
int dx[4]={0,-1,0,1};
int dy[4]={1,0,-1,0};
vector<vector<int>>grd;
vector<vector<bool>>vis;
bool inrange(int i,int j){
return i>=0 && i<n && j>=0 && j<m;
}
int n,m;
int bfs(int i,int j){
vis[i][j]=true;
int sum=1;
for(int k=0;k<4;... | ALGO | 0.999938 | 5.849717 |
23f3c4d0-6ffe-4e79-8634-3dbdec03873a | MiguelPerezI/Abstract_Motion_G | src2/SimplexAbstract.cpp | #include <iostream>
#include <cstdlib>
#include <math.h>
#include <string>
#include <list>
#include <iterator>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "SimplexAbstract.hpp"
#include <vector>
#include <time.h>
#include <random>
using namespace std;
template<typename T>
T random(std::vector<... | ALGO | 0.947018 | 3.408107 |
71488d2a-7728-41e0-ab01-73744a52ff46 | wderekjones/SAT | CNF.cpp | #include "CNF.h"
CNF::CNF()
{
}
CNF::CNF(vector<clause> cVec)
{
c = cVec;
}
void CNF::addClause(clause p)
{
c.push_back(p);
}
vector<clause> CNF::getClauses()
{
return c;
}
bool CNF::eval()
{
int res = c[0].evalC();
for (int i = 0; i < c.size(); i++)
{
res *= c[i].evalC();
}
return res;
}
| ALGO | 0.968502 | 3.728035 |
d589dc90-f22c-4284-90b9-fc3214156ffe | Junaid7200/University-Labs | Data Structures/Stacks/.history/DynamicStack_Class_20240403012846.cpp | #include <iostream>
#include <string>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node *previous;
Node(int data)
{
this->data = data;
next = NULL;
previous = NULL;
}
};
class DoublyList
{
public:
Node *Head;
DoublyList()
{
Head ... | ALGO | 0.994899 | 5.329582 |
1d12561f-599f-416b-8f0c-b3be26399f84 | vbonnici/grafe-sim | analysis/data/p02234/s060030245.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
const int INF = 1000000000;
int main()
{
int n, v1, v2;
scanf("%d", &n);
int m[n + 1][n + 1], p[n + 1];
for (int i = 0; i <= n; i++)
for (int j = 0; j <= n; j++)
m[i][j] = INF;
for (int i = 0; i <= n; i++)
m[i][i] = 0;
scanf("%d%... | ALGO | 0.999565 | 3.553879 |
873c74ab-4f5d-4b30-8355-5e32c064dc04 | Rubusch/cpp | 050__cpp__stl/algorithm-permutation_lexicographical_compare/lexicographicalcompare.cpp | // lexicographicalcompare.cpp
/*
permutation algorithm
lexicographical_compare - returns true if one range is lexicographically les
than another
resources: Kuhlins and Schader (2003)
//*/
#include <algorithm>
#include <iostream>
#include <iterator>
/*
output-helper
//*/
void display(int *arr_a, int size_a, ... | ALGO | 0.997012 | 5.694309 |
f9e58eed-9ee3-4907-bca0-0577caf4d3c9 | bondProgrammer/CPP | CPPExamples/2_Pointers/SlidesExamples/29_PtrToArray.cpp | #include<iostream>
using namespace std;
int main(){
char arr[3][10] ={"Bebo","Piggy","Deeps"};
char (*parr)[10] =&arr[0]; // parr is ptr to char array of size 5
cout<<*parr<<endl; // will print Bebo
parr = parr +2; // Will increment by two array
cout<<*parr<<endl; // Will print Deeps
return 0;}
| ALGO | 0.995603 | 3.375744 |
49a2bdda-79db-41c4-a408-702762e17e2c | ravigod22/CompetitiveProgrammingUNI | Codeforces/1904/c.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int tt;
cin >> tt;
while (tt--) {
int n, k; cin >> n >> k;
vector<i64> a(n);
for (auto& e : a) cin >> e;
sort(a.begin(), a.end());
... | ALGO | 0.999922 | 4.885994 |
cc364c7b-b76d-4755-b274-669b1a7e3b87 | vaibhavd21/Complete-Cpp | FuncOverRIDING.cpp | #include<iostream>
using namespace std;
//lets see how we can achieve run time polymorphism using virtual functions
class base
{
public:
virtual void print() // This will bind at run time (run time poly) thats why it is LATE BINDING (binds function to object at the run time)
{
cout<<"This... | TOOL | 0.938717 | 6.275589 |
9a3aa986-1275-4fe6-a6f4-4eb7d4ff5a46 | TienHuong/leetcode | 300/215.cpp | //https://leetcode.com/problems/kth-largest-element-in-an-array/
//Given an integer array nums and an integer k, return the kth largest element in the array.
//
//Note that it is the kth largest element in the sorted order, not the kth distinct element.
//
//Can you solve it without sorting?
//
//
//
//Example 1:
//
//... | ALGO | 0.999909 | 5.763064 |
9e1a22cb-316c-437b-bd5f-7df7bc3a5c35 | AruNi-01/MyAlgorithm | LeetCode/LuoXuanJuZhen/no_3.cpp | /*
* @Descripttion: 剑指 Offer 29. 顺时针打印矩阵(与54题相同)
* @Author: AruNi
* @Date: 2022-03-26 00:09:08
*/
/*
题目:
输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字。
示例 1:
输入:matrix = [[1,2,3],[4,5,6],[7,8,9]]
输出:[1,2,3,6,9,8,7,4,5]
示例 2:
输入:matrix = [[1,2,3,4],[5,6,7,8],[9,10,11,12]]
输出:[1,2,3,4,8,12,11,10,9,5,6,7]
*/
class Solution {
pub... | ALGO | 0.999983 | 6.507588 |
ee747d71-1402-47f7-a9be-ab6e89559c61 | Remonhasan/codeforces | Online Judge Solves (Others)/Uva/UVA156.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <ctype.h>
using namespace std;
bool areAnagrams(const string & s1, const string & s2);
void getEachWord(vector<string> & wordArr, string & line);
void selectAnanagram(vector<string> & ananagramVector, vector<strin... | ALGO | 0.999887 | 5.186135 |
23bf3a87-6ff2-449b-8794-ed169f3d2211 | zzadu/code | 2022.01/10일.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(int brown, int yellow) {
vector<int> answer;
for (int i = 1; i <= yellow; i++) {
int j = 0;
if (yellow % i == 0)
j = yellow / i;
if ((i + 2) * 2 + (j + 2) * 2 - 4 == brown) {
answ... | ALGO | 0.999079 | 5.353972 |
52086a52-e466-4743-8a7f-5c50a4f20035 | FDobri/cpp_dictionary | CppCollectionPractice/CustomLinkedList.cpp | #include <iostream>
#include "CustomLinkedList.h"
#include "CustomLinkedListNode.h"
CustomLinkedList::CustomLinkedList()
{
_size = 0;
head = nullptr;
tail = nullptr;
}
CustomLinkedList::~CustomLinkedList()
{
CustomLinkedListNode* temp = head;
while (_LoopEndConditionMet(temp->next))
{
CustomLinkedListNode* cu... | TOOL | 0.983377 | 4.389165 |
8ae6d6b7-cf22-466c-a908-f6fc02138fbe | jcd1994/MatlabTools | Compiled/blaze-3.2/blazemark/src/boost/TMat3TMat3Mult.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.999448 | 4.949995 |
5d304919-ed83-4e09-9171-b54a6c0ce2ca | dat2k42004/DSA_Java-OOP_Python_CodePTIT | dsa/practive/DSA04023.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n, k;
cin>>n>>k;
int a[n];
for(int i=0; i<n; ++i) cin>>a[i];
long long sum=0;
sort(a, a+n);
for(int i=0; i<n-1; ++i)
{
int x=lower_bound(a+i+1, a+n, a[i]+k)-a;
sum+=x-i-1;
}
cout<<sum<<endl;
}
int m... | ALGO | 0.999831 | 4.182682 |
35cb6696-908c-4c5f-b4a1-b7190817d33f | samoutlier/my-codes-cpp | 13_Tree/33_Right_Node_Of_Tree.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
class Node
{
public:
int data;
Node *left;
Node *right;
Node * next;
Node(int data)
{
this->data = data;
this->right = NULL;
this->left = NULL;
this->next = NULL;
}
};
Node *BuildTr... | ALGO | 0.999928 | 4.31805 |
a35a14b8-f7c0-4945-b61c-223d85f0b926 | EslamAsHhraf/Codeforces-practice | Contests/Codeforces Round #794 (Div. 2)/1686A - Everything Everywhere All But One.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve()
{
double sum = 0,n,a;
cin >> n;
set<double>myset;
for (int i = 0; i < n; i++) {
cin >> a;
myset.insert(a);
sum += a;
}
if (myset.count(sum / n))
cout<<"YES" << endl;
else
cout << "NO" << endl;
}
int main() {
ios_base::sync... | ALGO | 0.999192 | 4.015925 |
a6646bc6-3c0c-4b8d-aeea-b81927435b7b | bhavesh003/College-Assignments | CPP Assignments/cpp ass1/Ass1setA1.cpp | #include<iostream>
using namespace std;
int main()
{
int n,i,c,a=1;
cout<<"Enter the number of rows:";
cin>>n;
for(i=1;i<=n;i++)
{
for(c=1;c<=i;c++)
{
cout<<a;
a++;
}
cout<<endl;
}
return 0;
}
| ALGO | 0.999844 | 3.53037 |
34d31aad-4e43-484b-90fa-f42427f23c27 | MaximMosin/Labs_PSTU | 4.11.21_2.2.z2.cpp | #include <iostream>
using namespace std;
int main()
{
setlocale (LC_ALL, "Russian");
int h1,m1,s1; //начало промежутка
int h2,m2,s2; //конец промежутка
int h,m,s; //продолжительность промежутка
bool flag = false; //проверка на правильность введенного времени
cout << "Введите время начала и конца промежутка в та... | ALGO | 0.882444 | 3.588554 |
dcb3c844-7e15-4db1-a2b4-ced901e090c2 | mianhk/learn_cpp | cpp_Primer_e5/ch10/c10-36.cpp | #include <iostream>
#include <string>
#include <list>
#include <iterator>
#include <fstream>
#include <algorithm>
using namespace std;
int main(){
list<int> ilst={1,0,2,3,0,6};
// auto iter=ivec.cr();
// while(iter!=ivec.cbegin()){
// cout<<*--iter<<endl;
// }
auto s=find(ilst.crbegin(),ilst.crend(),0);
s++;
int p... | ALGO | 0.989129 | 3.057285 |
56f73c18-e673-4214-af8e-dee6d25d8298 | ashmitchamoli/programming-problems | codeforces/contests/1766/C.cpp | #include <bits/stdc++.h>
using namespace std;
void dfs(int u, bool isVisited[], vector<int> graph[])
{
if(isVisited[u]) return;
isVisited[u] = true;
for(int v : graph[u])
{
dfs(v, isVisited, graph);
}
return;
}
int main()
{
int t; cin >> t;
while(t--)
{
int m; cin ... | ALGO | 0.999982 | 4.448318 |
5203fbcc-0bf7-46b3-838c-8632b4e47abc | jing1900/mianjing_v1 | 面经编程题/t.cpp | #include<iostream>
using namespace std;
int main()
{
int n;//数列长度
cin>>n;
int a[n];
for(int i = 0; i< n;i++)
{
cin>>a[i];
}
//sort
int j = n;
int flag = 0;
while(j)
{
for(int i = 0; i<j-1;i++)
{
flag = 0;
if(a[i]>a[i+1])
... | ALGO | 0.999969 | 3.656256 |
07689518-1685-44f5-a64c-30f385ba0af2 | refracta/koreatech-assignment | MulticoreProgramming/Assignment2/Lab2-1/main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <omp.h>
#include "DS_timer.h"
#include "DS_definitions.h"
// Set the size of matrix and vector
// matrix A = m by n
// vector b = n by 1
// #define m (10000)
// #define n (10000)
int m;
int n;
int numThreads;
#define GenFloat (rand() % 100 + ((float)(rand() % 100) / 100... | ALGO | 0.995698 | 4.157403 |
2ff2cb33-2a25-42fa-b982-08892f6198ab | izenecloud/sf1r-lite | source/core/document-manager/highlighter/Highlighter.cpp | /**
* @file Highlighter.cpp
* @brief header file of Highlighter
* @author MyungHyun (Kent)
* @date 2008-09-04
*
* History:
* -Deepesh
* Interfaces to produce highlighting tags based
* on string matching on text since word offsets
* are no longer availed from document manager
*/
#include "Highlighter.h"
... | TOOL | 0.883913 | 4.469162 |
6ce3fa39-f4f2-4df0-bcfd-dd0960c67f54 | GentilleUwera/Calculator_App | my_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.998886 | 6.776823 |
59680d67-b590-44ea-9f11-5eec653b8431 | deej-io/cpp_playground | async.cpp | /*
* Playing around with std::async and std::future by parallelizing a trivial,
* but long runing task.
*/
#include <future>
#include <chrono>
#include <iostream>
#include <thread>
#include <vector>
#include <numeric>
constexpr std::initializer_list<int> nums = {1, 2, 3, 4, 5, 6};
auto slow_increment(int i)
{
... | TOOL | 0.97457 | 7.407081 |
0a92a490-a32d-480f-9b51-cc695c45237f | diogocecilio/neopz-master | Analysis/pzsmfrontalanal.cpp | /**
* @file
* @brief Contains implementations of the TPZSubMeshFrontalAnalysis methods.
*/
#include "pzsmfrontalanal.h"
#include "pzsubcmesh.h"
#include "pzfmatrix.h"
#include "TPZMatrixSolver.h"
using namespace std;
// Construction/Destruction
TPZSubMeshFrontalAnalysis::TPZSubMeshFrontalAnalysis(TPZSubCompMesh ... | TOOL | 0.988615 | 4.100109 |
4517f4bf-aeb1-41b0-92a5-cd4992c28465 | raincross7/code-similarity | codes/train_code/problem140/problem140_58.cpp | #include<iostream>
#include<vector>
#include<map>
#include<set>
#include<cassert>
#include<cassert>
#include<unordered_map>
#include<unordered_set>
#include<functional>
#include<queue>
#include<stack>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<sstream>
#include<iomanip>
#include<cstdio>
#include<cst... | ALGO | 0.999996 | 3.8874 |
6d5d4db4-bae5-4a47-9ce5-1480baaf1a06 | juneview-songdo/netflix_intro_page | 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 |
58934a04-c7d6-4181-8c9e-76361393cac4 | ishandutta2007/codeforces | kdvinit/normal/1705/E.cpp | /*
K.D. Vinit /,,/
*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
const int N = 2e5+100;
int f[N+1];
//Segment_Tree5
//Range Query And Range Update (replace all in a[l....r] with new_val)
//Can only perform addition (with or without modulo)
//Use .update(l, r, new_val) and .query(l, r)
class Segm... | ALGO | 0.999965 | 4.194677 |
16fb034e-4933-4255-b1cc-2e85d93cf2ff | joker-eph/llvm-project-with-mlir | libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T, Predicate<auto, T, Iter::value_type> Compare>
// constexpr Iter // constexpr after c++17
// upper_bound(Iter first, Iter last, const T& value, Compare comp);
#include <algorithm>
#include <functional>
#include <vector>
#include <cassert>
#include <cstdd... | TEST | 0.993123 | 7.007707 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.