uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
fb7335fe-9c75-429a-b55c-116f3695833e | chaitraboggaram/Object_Oriented_Design_and_Analysis | firstpointer.cpp | #include <iostream>
using namespace std;
int main ()
{
int firstvalue, secondvalue;
int *mypointer;
mypointer = &firstvalue;
*mypointer = 10;
mypointer = &secondvalue;
*mypointer = 20;
cout << "firstvalue is " << firstvalue << '\n';
cout << "secondvalue is " << secondvalu... | ALGO | 0.978337 | 3.002074 |
099d4983-7404-4ced-b83a-c8dea128ab31 | sumana2001/problems450 | aniket/k1k2heap.cpp | //k1th smallest, k2th smallest
//sum of nos between k1 and k2
//arr[]={4,2,3,6,1,5}
//k1=2,k2=5
//2+3+4+5=14
#include <bits/stdc++.h>
using namespace std;
int main()
{
int arr[] = {4, 2, 3, 6, 1, 5};
int n = sizeof(arr) / sizeof(arr[0]);
int k1 = 1, k2 = 3;
int sum=0;
priority_queue <int, vector<i... | ALGO | 0.999879 | 4.042204 |
3e6a44fc-9cb6-47ef-ae8c-f67393fb3394 | Hadeer-Elsaeed/C-Plus-Plus | sorting/numeric_string_sort.cpp | // Using general algorithms to sort a collection of strings results in
// alphanumeric sort. If it is a numeric string, it leads to unnatural sorting
// eg, an array of strings 1,10,100,2,20,200,3,30,300
// would be sorted in that same order by using conventional sorting,
// even though we know the correct sorting ord... | ALGO | 0.998933 | 5.212913 |
cec06c74-9503-4eb3-b7d2-745e4ec72494 | SrB30/Competitive-Programming | UVA/10611 - The Playboy Chimp.cpp | #include <iostream>
#include <cstdio>
#define sf(a) scanf("%d", &a)
#define pf(p) printf("%d", p)
#define rep(n) for(int i=0; i<n; i++)
using namespace std;
int n, noc[50000], height;
int beg1, beg2;
void bsearch()
{
int end1, end2, mid1, mid2;
beg1=beg2 = 0;
end1=end2 = n-1;
mid1 = mid2 = (beg1+en... | ALGO | 0.999979 | 3.462448 |
328587b5-f404-4559-ac5f-b6de8224ea95 | rosswelltiongco/Data-Structures | Linked_Lists/Linked_Lists/linked_list.cpp | #include "linked_list.h"
#include <vector>
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
LinkedList::LinkedList()
{
init();
}
LinkedList::LinkedList(vector<string> &strings)
{
init();
for (unsigned int i = 0; i < strings.size(); ++i)
{
add(strings.at(i));
}
}
LinkedList::Linke... | TOOL | 0.994662 | 4.934129 |
6832315b-0f12-49d5-8633-245c2118aa4a | mdmzfzl/CSES-Solutions | 04_Graph_Algorithms/1751-planet-cycles.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long
#define vi vector<int>
#define vl vector<long long>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define umap unordered_map
#define uset unordered_set
#define rall... | ALGO | 0.999978 | 4.589783 |
6af3523b-c940-435b-a49f-cb298a188585 | wawachen/Turing_learning | TL_phy_random/test.cpp | #include "test.h"
#include <vector>
int maxSteps = 100;
double maxSpeed = 12.8;
double maxvalue = 3000.0;
double y2 = 50;
double x2 = 50;
extern double robot_radius;
double f(double x,double x1,double y1,double k)
{
return k*(x-x1)+y1;
}
double g(double y,double x1,double y1,double k)
{
return x1+(y-y1)/k;
}
/... | ALGO | 0.992984 | 3.82964 |
b704da4f-1f38-46cf-91b7-657c461c5fb3 | ishandutta2007/codeforces | heart_blue/normal/417/B.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#incl... | ALGO | 0.999976 | 3.850554 |
06a3d708-3e1e-4ad0-8ce1-4840efa95706 | Suryansh555/CPP | RemoveLoopFromLinkedList.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
#include<bits/stdc++.h>
using namespace std ;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
ListN... | ALGO | 0.999983 | 4.473445 |
9df3d19d-daa5-4256-834e-8787319ff36f | bytedance/terark-zip | 3rdparty/boost-include/libs/spirit/classic/example/fundamental/full_calc.cpp | ////////////////////////////////////////////////////////////////////////////
//
// Full calculator example using STL functors
// This is discussed in the "Functional" chapter in the Spirit User's Guide.
//
// Ported to Spirit v1.5 from v1.2/1.3 example by Dan Nuffer
// [ JDG 9/18/2002 ]
//
/////////////////////////... | ALGO | 0.887622 | 7.536924 |
ab0642a1-db44-488e-bd5b-5a5df28ad620 | DuyTran1234/1000ExerciseC- | Chuong 5 - Mang mot chieu/Tim kiem va liet ke/bai179.cpp | #include <iostream>
#include <cmath>
using namespace std;
void nhapMang(int a[], int &n);
void xuatMang(int a[], int n);
void triTuyetDoi(int a[],int n);
int main()
{
int Array[100];
int nSize;
nhapMang(Array,nSize);
cout<<endl;
xuatMang(Array,nSize);
triTuyetDoi(Array,nSize);
}
void nhapMang(int a[], int &n)
{
... | ALGO | 0.999866 | 3.360749 |
eaba98c4-26c9-4878-bdbb-5fccacc6b13a | albi005/NemesOnline | 230506/1.cpp | // 100/100
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
struct Result {
int count;
int first;
int last;
};
int main() {
int n, k;
cin >> n >> k;
vector<int> v(n... | ALGO | 0.999973 | 4.621789 |
c2a8bd40-51dd-4608-a64a-d11df724bd74 | linlinge/MMOD-Patent-Version | AngleBasedOutlier.cpp | #include "AngleBasedOutlier.h"
void AngleBasedOutlier::PointSetEntropy(pcl::PointCloud<PointType>::Ptr cloud)
{
// Step 01: Define
cloud_=cloud;
int K=10>cloud_->points.size() ? cloud_->points.size()*0.6:10;
pcl::search::KdTree<PointType>::Ptr kdtree(new pcl::search::KdTree<PointType>());
kdtree->se... | ALGO | 0.971744 | 3.17285 |
d5ec962a-19f1-4b8a-9aa9-59f53d7228a0 | Johnydepyy/tw-j_st-ry | długa lekcja.cpp | #include <bits/stdc++.h>
using namespace std;
long long H,M,k=0;
char r;
int main ()
{
cin>>H>>r>>M;
if(H == 9 and M == 5)
cout<<"10:35";
M +=90;
if(M >= 60)
{
k = M/60;
H+=k;
if(H >= 24)
H -= 24;
if(H > 10 and M-(k*60)> 10 )
... | ALGO | 0.999541 | 4.005784 |
7cff490b-909b-4574-8b16-15512a61b7c1 | jingjingluyu/courses-learning-notes | 计算导论与c语言基础/week8/作业/编程题/house.cpp | #include<iostream>
using namespace std;
int main()
{
double n,k,house,money;
int m;
while(cin>>n>>k)
{
house=200;
for(int i=1; ;i++)
{
if(i>1)
house=house*(1+k*0.01);
money=n*i;
if(money>house && i<=20)
{
m=i;
cout << m << endl;
break;
}
else if(i>20)
{
... | ALGO | 0.999356 | 3.322152 |
07e66451-bcf5-4f91-9a00-72511b4f9da8 | akgmage/data-structures-and-algorithms | Priority Queues/kth_smallest_element.cpp | /*
You are given with an integer k and an array of integers that contain numbers in random order. Write a program to find k smallest numbers from given array. You need to save them in an array and return it.
Time complexity should be O(n * logk) and space complexity should not be more than O(k).
Note: Order of elements... | ALGO | 0.999978 | 5.711847 |
ac2ae0e2-1ca7-46d1-85c4-5c29f1aea428 | michael69zen/OmegaUp_Ejercicios | 17_omegaUp_11340.cpp | #include <iostream>
using namespace std;
string clasificarEdad(int edad) {
if (edad >= 0 && edad <= 3) {
return "BEBE";
} else if (edad >= 4 && edad <= 14) {
return "NINO";
} else if (edad >= 15 && edad <= 18) {
return "JOVEN";
} else if (edad >= 19 && edad <= 65) {
ret... | TOOL | 0.881884 | 5.763461 |
0a5a6137-6831-4dcd-bc7d-bf673fc9683e | CytoComp/ethereum-ObjectiveC | LocalPods/boost/1.55.0/libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp | #include <iostream>
#include <map>
#include <string>
#include <fstream>
#ifndef M_PI //not there on windows
#define M_PI 3.1415927 //...
#endif
#include <boost/numeric/odeint.hpp>
using namespace std;
using namespace boost::numeric::odeint;
//[ two_dimensional_phase_lattice_definition
typedef boost::numeric::ublas:... | ALGO | 0.998936 | 5.382156 |
d999a7f8-961a-4ae5-bdf8-05030d42dc4e | upesacm/100DaysOfCode-2024 | DSA/Mridul-Singh/Question70b.cpp | //LEETCODE PROBLEM 834
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> sumOfDistancesInTree(int n, vector<vector<int>>& edges) {
vector<vector<int>> tree(n);
vector<int> res(n, 0), count(n, 1);
for (auto& edge : edges) {
tree[edge[0]].push_back... | ALGO | 0.999964 | 5.624992 |
ca22076f-2b92-4b46-be10-a3fe8ac9bf99 | ishandutta2007/codeforces | lycmd/normal/1017/F.cpp | #include<bits/stdc++.h>
using namespace std;
typedef unsigned ui;
int const N=100000010;
ui n,a,b,c,d,ans;
bitset<N>vis;
ui f(ui x){
return a*x*x*x+b*x*x+c*x+d;
}
ui solve(int x){
ui res=0;
for(long long i=x;i<=n;i*=x)
res+=n/i*f(x);
return res;
}
signed main(){
cin>>n>>a>>b>>c>>d;
ans=(n>1)*solve(2)+(n>2)*solv... | ALGO | 0.999698 | 4.167002 |
038d518f-cb71-4f69-ba9d-29a69c25e218 | aniketsingh1717/leetcode | 0114-flatten-binary-tree-to-linked-list/0114-flatten-binary-tree-to-linked-list.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.99997 | 6.152278 |
fdea87e4-8b5a-4c66-b36d-43301e47c0af | omarlopezoficial/NoteApp-Frontend | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
0df7567f-2c16-4418-b414-761933abc60c | auxten/static-libicu | source/i18n/sortkey.cpp | //===============================================================================
//
// File sortkey.cpp
//
//
//
// Created by: Helena Shih
//
// Modification History:
//
// Date Name Description
//
// 6/20/97 helena Java class name change.
// 6/23/97 helena Added comments t... | TOOL | 0.97102 | 6.212571 |
1368c42c-99e1-43c9-966d-80d694d690f8 | vgvgvvv/3d-math | MathFuncs.cpp | //
// Created by 董宸 on 2021/6/19.
//
#include "MathFuncs.h"
#include "MathTime.h"
namespace Math {
float Clamp(float value, float min, float max)
{
if (value < min)
value = min;
else if (value > max)
value = max;
return value;
}
int Clamp(int value, int... | TOOL | 0.978756 | 7.093751 |
bae38c1d-f86c-47f7-a12f-964486f883be | alikhanmurat/ADS | Lab5/B.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
struct Heap {
ll *a;
ll capacity;
ll size;
long long parent (long long i) {
return (i - 1)/2;
}
long long left (long long i) {
return i*2 + 1;
}
long long right (long long i) {
return i*... | ALGO | 0.999996 | 3.999748 |
8efaa25f-d4ca-4ada-b592-e8997cd96e40 | TitansTech/GameServer | Source/Marry.cpp | #include "stdafx.h"
#include "Marry.h"
#include "GameServer.h"
#include "LogProc.h"
#include "GameMain.h"
#include "BloodCastle.h"
#include "ChaosCastle.h"
#include "DevilSquare.h"
#include "IllusionTemple.h"
#include "ImperialGuardian.h"
#include "DoppelGanger.h"
#include "SkyEvent.h"
#include "KalimaGate.h"
#include ... | TOOL | 0.893511 | 3.715272 |
971d1dd6-52f5-4019-a17a-1c35c142f66d | knst/Competitive-programming | codeforces/318-rcc-fund/b.cpp | /*****************************************************************************
* codeforces: knst
* topcoder: knstqq
* projecteuler: knstqq
* **************************************************************************/
#include <algorithm>
#include <iostream>
#include <limits>
#include <map>
#include <set>
#i... | ALGO | 0.999962 | 3.804912 |
ee9c3a56-17a6-411c-b195-4af522b35682 | CoderSwarup/CppBasicsToAdvanced | 10} Functions & Recurion/5_Recursion/1_Basic.cpp |
#include <iostream>
using namespace std;
void printHW(int c){
if (c < 1)
{
return;
}
cout << "HELLO ******* DEAR"<<endl;
printHW(c - 1);
}
int main(){
printHW(10);
return 0;
}
| ALGO | 0.999755 | 3.600835 |
8c5e33af-1e5b-4bd0-a92e-0dc3652f415e | Ujjval-dargar/Leetcode_Logs | 3172-divisible-and-non-divisible-sums-difference/3172-divisible-and-non-divisible-sums-difference.cpp | class Solution {
public:
int differenceOfSums(int n, int m) {
int nums1 = 0;
int nums2 = 0;
for (int i = 1; i <= n; ++i) {
if (i % m == 0)
nums1 += i;
else
nums2 += i;
}
return nums2 - nums1;
}
}; | ALGO | 0.999973 | 5.743725 |
a58e384d-bae0-4830-be48-338f599f6412 | Abhi6722/Qzense-Login-Registration-Flow | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
030b24e2-4e9b-4900-ac62-9cf89306afa2 | touyou/CompetitiveProgramming | topcoder/MagicalSource.cpp | #include <string>
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include ... | ALGO | 0.999767 | 4.436683 |
a839ac5b-854b-4dea-a79c-d847ec514888 | aayush2761/Leetcode_prob | 1800-maximum-ascending-subarray-sum/1800-maximum-ascending-subarray-sum.cpp | class Solution {
public:
int maxAscendingSum(vector<int>& nums) {
int res=0;
int i=0;
int temp=nums[0];
res=max(res,temp);
for(int i=1;i<nums.size();i++){
if(nums[i]>nums[i-1]){
temp+=nums[i];
}
else temp=nums[i];
... | ALGO | 0.99998 | 6.062164 |
e8e10f08-3aad-4c51-b452-8afa85841923 | Barmanpriyanka/Strivers-A2Z-DSA | Leetcode_challenges/sum_digits_convertion.cpp | class Solution {
public:
int getLucky(string s, int k) {
int n=s.length();
int sum=0;
for(int i=0;i<n;i++)
{
int value=s[i]-'a'+1;
while(value){
sum=sum+value%10;
value=value/10;
}
... | ALGO | 0.999952 | 5.956186 |
c4f7a57e-502a-4535-ad9b-0702ec997320 | voretsen-liinad/008_NP | src/l4/select_aio_server/main.cpp | #include <algorithm>
#include <cassert>
#include <cstring>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <optional>
#include <list>
#include <vector>
#if !defined(_WIN32)
extern "C"
{
# include <fcntl.h>
# include <signal.h>
# include <netinet/tcp.h>
# include <sys/ioctl.h>
}
#else
# ... | WEB | 0.965284 | 6.930676 |
95f6027b-9c0a-4ee7-bb64-a2fa25d88135 | DaniLedesma1/FAL-Fundamentos-de-los-Algoritmos- | Backtracking/47A/PlantillaJuezCasosIlimitados.cpp | // Nombre del alumno .....
// Usuario del Juez ......
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
std::string dev(int i) {
if (i == 0) return "azul";
else if (i == 1) return "rojo";
else return "verde";
}
void tratarSol(std::vector<int> s) {
... | ALGO | 0.998234 | 4.06924 |
db86803c-c130-4e4b-8301-55b366ed7da0 | mcnaughton-m/assumption-archives | soccer_roster_project.cpp | #include <iostream>
#include <vector>
using namespace std;
void fillVectors (vector<int> &jerseyNumber, vector<int> &ratingNumber, int constantNumber) {
int value;
for (int i = 0; i < constantNumber; i++) {
cout << "Enter player " << i + 1 << "'s jersey number:" << endl;
cin >> value;
jerseyNum... | TOOL | 0.958026 | 4.627926 |
f8749bd0-dbbf-4ce2-8db3-365f523aa81d | ntantai21810/MyCode | SinhDayNhiPhanDoDaiN/BaiTap2/BaiTap2.cpp | #include <iostream>
using namespace std;
//Snh chuoi n phan
void DatMacDinh(int a[], int n)
{
for (int i = 0; i < n; i++)
{
a[i] = 0;
}
}
void InCauHinh(int a[], int n)
{
for (int i = 0; i < n; i++)
{
cout << a[i];
}
cout << endl;
}
void DatBang0(int a[], int ViTri, int n)
{
for (int i = ViTri; i < n; ... | ALGO | 0.99994 | 3.661693 |
b0db6d40-7e80-4bc1-8126-8ac32b5eb3c6 | shahid-n/path-planning-project | src/Eigen-3.3/bench/quat_slerp.cpp | #include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
template<typename Q>
EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t)
{
return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized());
}
template<typename Q>
EIGEN_DONT_INL... | ALGO | 0.993077 | 6.251058 |
121b4855-659d-4e3d-afa4-8ae54980adce | ZZWENG/cpp_code | cme212/final/code/utils/tests.cpp | #include "tests.h"
#include <chrono>
#include <fstream>
#include <iomanip>
#include "cublas_v2.h"
#include "gpu_func.h"
#include "mpi.h"
#include "types.h"
using namespace std;
#define SCALE 1 // Factor to SCALE the GEMM problem size by
#define NUM_ITERS 10 // Number of GEMMs run for timing purposes
#ifdef U... | TEST | 0.955315 | 6.817621 |
1899b93b-f36c-4e8a-8d4d-4417c5e36deb | taoye20/code_thinking | coding_thinking/101对称二叉树.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<stack>
using namespace std;
class TreeNode {
public:
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
//
class BuildTree {
public:
TreeNode* build() {
TreeNode* root = new TreeNode(1);
TreeNode* lef... | ALGO | 0.999999 | 5.737852 |
a6df1704-db6c-4560-b57d-312bfdb2e4c5 | mehreen019/competitive_programming | Codeforces/743B.cpp | #include<bits/stdc++.h>
using namespace std;
int main(void){
long long n,m;
cin>>n>>m;
if(m%2) cout<<1<<endl;
else{
long long l=0,r=pow(2,n),x;
while(l<r){
long long mid=(l+r)/2;
if(mid==m){ x=log2(r-mid); break;}
if(m>mid) l=mid;
else r=m... | ALGO | 0.999966 | 3.827846 |
4f0be0c1-e61a-4c02-81df-b521d5330756 | ishandutta2007/codeforces | penguin1017/normal/1305/E.cpp | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define ll long long
#define lb(x) ((x)&(-x))
#define pii pair<int,int>
#define vi vector<int>
#define pb push_back
#define fi first
#define se second
#define de(x) cout<<x<<" x"<<endl
#define LCAFA rep(i,... | ALGO | 0.999854 | 3.19415 |
62cf0b1f-8de2-4e04-a349-a5b1a241a51b | Shekhu04/Code-Studio | sortAstack.cpp | #include <bits/stdc++.h>
void sortedInsert(stack<int> &stack , int num)
{
//base case
if(stack.empty() || (!stack.empty() && stack.top() < num) ){
stack.push(num);
return;
}
int n = stack.top();
stack.pop();
//recursive call
sortedInsert(stack,num);
stack.push(n);
}
void sortStack(stack<int> &stack)
{
... | ALGO | 0.999924 | 5.735731 |
6ce050e9-c70a-461c-b73c-641dfa86e96c | SaiVenkatDhulipudi/CP-Journey | BitManipulation/DecimalToBinary.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n;
cin>>n;
string s;
s=bitset<32>(n).to_string();
int k=log2(n);
s=s.substr(s.length()-k-1,s.length());
cout<<s<<endl;
}
| ALGO | 0.999937 | 3.790025 |
6f48cf97-c2b4-48f3-8f25-63ee56b4a216 | AmitKhan210/LightOj | light1007.cpp | # include <bits/stdc++.h>
using namespace std;
int seive(){
int i, val, total = 0, j;
val = sqrt(SIZE) + 1;
for(i = 2; i <= SIZE; i++) flag[i] = 1;
for(i = 2; i < val; i++){
if(flag[i]){
for(j = i; j * i <= SIZE; j++){
flag[j*i] = 0;
}
}
}
... | ALGO | 0.999075 | 3.890424 |
099c3e5d-ecdf-4113-8390-8372957f51c4 | hk19960522/Code | UVa/UVa 10474.cpp | #include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
int N,M;
int C = 0;
while ( cin >> N >> M && N && M )
{
vector< int > v;
vector< int >::iterator it;
for (int i=0;i<N;i++)
{
int temp;
... | ALGO | 0.999579 | 3.908602 |
a6f584fa-531d-4974-8253-6abbc40f1977 | lychees/ACM-Training | Archive/Topcoder/SRM/SRM 759/EllysThreePrimes.cpp | /* &*#()&*#)&E*F& */
#include <iostream>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <map>
using namespace std;
#define REP(I, N) for (int I=0;I<int(N);++I)
#define FOR(I, A, B) for (int I=int(A);I<int(B);... | ALGO | 0.999596 | 3.931329 |
176aae60-69c9-438f-9229-25e47a1d40e9 | pall-pandiyan/hacker_rank-cpp | 18_vectorSort.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n;
std::cin >> n;
std::vector<int> v1;
for(int i=0; i<n; i++) {
int temp;
std::cin >> temp;
v1.push_back(temp);
}
sort(v1.begin(),v1.end())... | ALGO | 0.999855 | 4.234797 |
792a2b06-e0a4-46dd-a4a1-a7cf12ff90ae | sir-rasel/Online_Judge_Problem_Solve | Codechef/codechef_COVIDLQ.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
int main(){
int test;
scanf("%d",&test);
while(test--){
int n;
scanf("%d",&n);
int curr = -6;
bool flag=true;
for(int i=0;i<n;i++){
int status;
... | ALGO | 0.9999 | 3.550737 |
5294936f-ed96-42f4-b623-646de1173b8f | sarvex/leetcode-swift | solution/1900-1999/1913.Maximum Product Difference Between Two Pairs/Solution.cpp | class Solution {
public:
int maxProductDifference(vector<int>& nums) {
sort(nums.begin(), nums.end());
int n = nums.size();
return nums[n - 1] * nums[n - 2] - nums[0] * nums[1];
}
}; | ALGO | 0.999986 | 5.738323 |
fb63ed95-68f1-4bfb-bfee-aec962e27b34 | tka-andrew/LeetCode | Cpp/LeetCode344.ReverseString_TwoPointers.cpp | #include <vector>
class Solution {
public:
void reverseString(std::vector<char>& s) {
int left = 0;
int right = s.size()-1;
while (left<right) {
std::swap(s[left], s[right]);
left++;
right--;
}
}
}; | ALGO | 0.998818 | 6.156617 |
cfebce95-4bc4-4984-84c2-851d32e9bb2e | sumanadhikari0625/Leetcode-Solutions | 2436-make-array-zero-by-subtracting-equal-amounts/2436-make-array-zero-by-subtracting-equal-amounts.cpp | class Solution {
public:
int minimumOperations(vector<int>& nums) {
if(nums.size()==1 && nums[0]==0)
return 0;
int count=0;
sort(nums.begin(),nums.end());
for(int i=0;i<nums.size();i++)
{
if(nums[i]!=0)
{
int c=nums[i];
... | ALGO | 0.999988 | 6.121013 |
84fc1f98-ebbc-4e70-ab03-31e497ad5bc3 | dn54321/Programming-Challenges | 1196A - Three Piles of Candies.cpp | // https://codeforces.com/problemset/problem/1196/A
// SOLUTION BY DN54321
#include <iostream>
#include <string.h>
#include <ctype.h>
#include <vector>
#include <functional>
#include <algorithm>
#include <map>
#define p1 first
#define p2 second
#define pii pair<int,int>
#define MXINT (1<<30)
#define MXLL (1LL<<60)
... | ALGO | 0.999774 | 4.237055 |
b577e755-24e1-426b-a422-6650047e6a3d | Hz188/experiments | algorithms/leetcode/6-back-track/permutation/51.n-皇后.cpp | // @before-stub-for-debug-begin
#include <vector>
#include <string>
#include "commoncppproblem51.h"
using namespace std;
// @before-stub-for-debug-end
/*
* @lc app=leetcode.cn id=51 lang=cpp
*
* [51] N 皇后
*/
// @lc code=start
#include <vector>
#include <string>
#include <functional>
using namespace std;
class So... | ALGO | 0.999449 | 6.209894 |
014988d5-dd3f-4801-9a56-b34bb2e17876 | BenCryptoKing/stephanpower | src/chainparams.cpp | #include <chainparams.h>
#include <chainparamsseeds.h>
#include <consensus/merkle.h>
#include <tinyformat.h>
#include <util/system.h>
#include <util/strencodings.h>
#include <versionbitsinfo.h>
#include <assert.h>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
stati... | CONFIG | 0.880595 | 6.399476 |
72c98a70-9c0f-4706-9bec-8479da9c7fd0 | yunusemreozturk/c-2- | YıldızlarlaŞekil Oluşturma.cpp | #include <iostream>
using namespace std;
int main()
{
int s,k,giris;
int yildiz,bosluk;
printf("Giris: ");
scanf("%d",&giris);
yildiz=2;
bosluk=giris-1;
for(k=0;k<giris;k++)
{
for(s=0;s<bosluk;s++)
{
printf(" ");
}
for(s=0;s<yildiz;s++)
{
if(s==0)
printf("/");
else if(s==yildiz-1... | ALGO | 0.999176 | 3.058007 |
ac967750-e4a3-4edb-9f40-0fb73518ddb5 | CaiHuicheng/Project | leetcode/leetcode/75颜色分类_双指针.cpp | class Solution {
public:
// void sortColors(vector<int>& nums) {
// int n = nums.size();
// int ptr = 0;
// for(int i = 0;i<n;i++){
// if(nums[i] == 0){
// swap(nums[i],nums[ptr]);
// ptr++;
// }
// }
// for(int j=0;j<n;... | ALGO | 0.999947 | 5.862364 |
948d99d5-cd5a-4826-bfb2-566e16062fc8 | HarrisonJM/Y2C-Development | Test/Test/fizzbuzz.cpp | #include <stdio.h>
//#define _CRT_SECURE_NO_WARNINGS
int fizzybuzzy()
{
for (int i = 0; i < 1000; ++i)
{
if (((i % 3) == 0) && ((i % 5) == 0))
{
printf("%d: buzz", i);
}
else if (((i % 3) == 0) || ((i % 5) == 0))
{
printf("%d : fizz", i);
}
else
{
printf("%d", i);
}
printf("\n");
}
... | ALGO | 0.986381 | 3.848129 |
f0df9fd3-e5b2-47c1-ab8c-c6398c2004a0 | kamyu104/LeetCode-Solutions | C++/best-time-to-buy-and-sell-stock-v.cpp | // Time: O(n * k)
// Space: O(k)
// dp
class Solution {
public:
long long maximumProfit(vector<int>& prices, int k) {
static const int64_t NEG_INF = numeric_limits<int64_t>::min();
vector<int64_t> bought(k, NEG_INF);
vector<int64_t> sold(k, NEG_INF);
vector<int64_t> result(k + 1, ... | ALGO | 0.999773 | 6.175947 |
a570d76a-74ad-4635-b99d-db91a7870b6b | harshjoeyit/CP | dp/dp_longest_common_subsequece.cpp |
#include<bits/stdc++.h>
using namespace std;
#define int long long int
const int mxN = 3005;
int dp[mxN][mxN];
/*
Application
1. Bridges building problem - https://www.geeksforgeeks.org/dynamic-programming-building-bridges/
*/
void print_LCS(string s, string t, int n, int m) {
int i=n, j=m;
string lcs = "... | ALGO | 0.999987 | 5.119972 |
70f11cc7-4b3e-46be-a15f-21d8d9ce0586 | Surajk19/Cpp-codes | C++BASICS/6)PatternStriver/pattern6.cpp | // 123456
// 12345
// 1234
// 123
// 12
// 1
#include <iostream>
using namespace std;
void pattern5(int n)
{
for(int i = 1 ; i<=n;i++)
{
for(int j=1; j<=n-i+1;j++)
{
cout<<j;
}
cout<<endl;
}
}
int main()
{
int n;
cout<<"Enter the number :";
cin>>n;
... | ALGO | 0.999517 | 4.171058 |
2521d8a8-3cf7-4315-ba0e-2e4908ee0a06 | Rakesh-0786/DSA_Basic | Vector/practise-Vectors-questions/ques3.cpp | // Count the number of elements strictly greater than value x.
#include<bits/stdc++.h>
using namespace std;
int main(){
vector<int>v(7);
for(int i=0;i<v.size();i++){
cin>>v[i];
}
cout<<"Enter the value of x:";
int x;
cin>>x;
int count=0;
for(int i=0;i<v.size();i++){
if(v... | ALGO | 0.999874 | 3.702558 |
8bfda4d0-4cdb-48f0-98f8-025b750cd012 | ReiAccept/Algorithm | misc/Exam/2017_12_23/lift.cpp | #include<cmath>
#include<cstdio>
#include<iostream>
#define M 1000000007
using namespace std;
int n,a,b,k;
long long f[2][5005],ans;
int l[5005],r[5005];
int main()
{
freopen("lift.in", "r", stdin);
freopen("lift.out", "w", stdout);
scanf("%d%d%d%d",&n,&a,&b,&k);
f[0][a]=1;
int e=0,g=1;
for... | ALGO | 0.999976 | 3.473362 |
4c128ae6-75bb-4ab2-9d4a-b74e1a4273e9 | SHAWON0c/XPSC-BATCH-03 | practice-day-1/D-buttons.cpp |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int a , b ;
cin>>a >>b ;
if(a>b)cout<<a+(a-1);
else if(a==b)cout<<a+b<<endl;
else cout<<b+(b-1)<<endl;
}
| ALGO | 0.999686 | 3.254012 |
95327918-9ea2-41c3-9c51-a141adf3075b | MirenaAngelova/TD_01 | DSAP_10/3_PASZS_01/Source.cpp | // Print all subarrays with 0 sum
// Input: {4, 2, -3, -1, 0, 4 )
// Subarrays with zero-sum are:
// (-3, -1, 0, 4}
// {0}
// Input: {3, 4, -7, 3, 1, 3, 1, -4, -2, -2}
// Subarrays with zero-sum are:
// {3, 4, -7}
// {4, -7, 3}
// {-7, 3, 1, 3}
// {3, 1, -4}
// {3, 1, 3, 1, -4, -2, -2}
// {3, 4, -7, 3, 1, 3, 1, -4, -... | ALGO | 0.995564 | 6.38219 |
dac2d8c6-d29a-41d0-805f-c5b1539b3078 | pingchungchang/CP | MHCR22022-A2.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ld long double
#define _all(T) T.begin(),T.end()
struct node{
ll l,r,bl;
node(){}
};
ll cc = 0;
co... | ALGO | 0.999693 | 3.961391 |
08d1f00b-db4e-416f-9908-c11b0f9b4b71 | ncchen99/Competitive-Programming | ZeroJudge/a362 1. 搬雕像.cpp | #include<bits/stdc++.h>
using namespace std;
struct item {
int index;
int h;
int w;
};
int main() {
int n;
while(cin>>n) {
vector<item> s(n);
for(int i=0; i<n; i++) {
cin>>s.at(i).h;
cin>>s.at(i).w;
s.at(i).index=i;
}
sort(s.begin(... | ALGO | 0.999756 | 3.752537 |
96ec8566-8ce6-405b-83a8-761957f2ffe2 | j-c-w/DSPAcceleratorSupport | results/Github/cpuimage_FFTResampler/accelerated_fftw.cpp |
#include "../../benchmarks/Github/code/cpuimage_FFTResampler/self_contained_code.c"
#include "../../benchmarks/Accelerators/FFTW/interface.hpp"
#include "complex"
#include<vector>
#include<nlohmann/json.hpp>
#include<fstream>
#include<iomanip>
#include<clib/synthesizer.h>
#include<time.h>
#include<iostream>
char *ou... | ALGO | 0.991936 | 6.060749 |
55270674-4396-471d-910b-67be5d3bb3bb | nixlynxbites/Learning_Galois_Fields | Exercises/03_Implementing_GF_p/main.cpp | #include "gf_p.hpp"
#include <stdio.h>
void PrintTableAddition(uint8_t P);
void PrintTableSubtraction(uint8_t P);
void PrintTableMultiplication(uint8_t P);
void PrintTableDivision(uint8_t P);
int main()
{
printf("Current P: %u\n\n\n", 5);
PrintTableAddition(5);
printf("\n");
printf("\n");
PrintTab... | ALGO | 0.973363 | 3.719926 |
26abf151-831e-4a7c-9f98-9404f120307d | arifkhan1990/Competitive-Programming | Basic Programming/Dimik oj/C++/প্রোগ্রামিং সমস্যা 14 - [৫২ সমস্যা বই] অক্ষরের ঘনঘটা.cpp | /* Name : Arif Khan
Judge: Dimik Oj
University: Primeasia University
problem: প্রোগ্রামিং সমস্যা 14 - [৫২ সমস্যা বই] অক্ষরের ঘনঘটা
Difficulty: Easy
Time Complexity: 0.1800 সেকেন্ড
... | ALGO | 0.99973 | 4.963402 |
9137d601-d91f-4067-a82c-5dd12aa6bd83 | Mefju669/Projektowanie-efektywnych-algorytm-w | z2/B&B/Algorytmy.cpp | #include <iostream>
#include <algorithm>
#include "Algorytmy.h"
#include "GraphMatrix.h"
#include <functional>
using namespace std;
using namespace std::chrono;
void Algorytmy::pelnePomiary(string nazwaIni) //metoda pobierająca dane z pliku .ini, robiąca pomiary i zapis do pliku .csv
{
vector<int> liczbyPowtorzen;... | ALGO | 0.984171 | 4.07574 |
292a29bd-eda4-4863-8bb5-80b9f3033362 | ishandutta2007/codeforces | 12tqian/normal/1458/C.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <iomanip>
#incl... | ALGO | 0.999945 | 5.361542 |
891da5fa-24b3-4ee3-829b-47f1f6002be2 | HardenedBSD/hardenedBSD-stable | contrib/llvm/tools/lldb/source/Utility/UriParser.cpp | #include "lldb/Utility/UriParser.h"
#include <string>
#include <stdint.h>
#include <tuple>
using namespace lldb_private;
//----------------------------------------------------------------------
// UriParser::Parse
//----------------------------------------------------------------------
bool UriParser::Parse(llvm::S... | TOOL | 0.923072 | 6.628889 |
4948c659-36bc-447a-8da6-568c594502d9 | ishandutta2007/codeforces | weakesttopology/normal/437/D.cpp | #include "bits/stdc++.h"
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define pb push_back
#define debug(x) cerr << #x << " == " << (x) << '\n'
#define mp(x, y) make_pair(x, y)
#define ALL(X) X.begin(), X.end()
#define READ(X) for (int i_ =... | ALGO | 0.999926 | 4.444909 |
6d164e17-f00e-4ee0-b653-efc9bb56b64e | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Mixtral/top0-100/find-edges-in-shortest-paths-Solution.findAnswer/177742_DoS_Overflow.cpp | gnutls_session_get_data (gnutls_session_t session,
void *session_data, size_t * session_data_size)
{
gnutls_datum_t psession;
int ret;
if (session->internals.resumable == RESUME_FALSE)
return GNUTLS_E_INVALID_SESSION;
psession.data = session_data;
ret = _gnutls_session_pack (s... | ALGO | 0.995487 | 5.28283 |
cea14039-1e5f-4626-b128-9fdc7996ee1e | ritikkumar1106/week1-CPP11-CipherSchools | Lecture1/cal.cpp | #include<bits/stdc++.h>
using namespace std;
int sum(int n1,int n2){
return n1+n2;
}
int main(){
// int,char,string,float,double
int n1,n2;
cin>>n1>>n2;
cout<<"the sum of n1 & n2 is : "<<sum(n1,n2);
return 0;
} | ALGO | 0.991317 | 3.519486 |
fbfe20a3-9b60-4722-9b49-28986699fc82 | Shao-ZW/CMU-15-445 | src/execution/topn_executor.cpp | #include "execution/executors/topn_executor.h"
#include <cstddef>
#include <vector>
#include "storage/table/tuple.h"
namespace bustub {
TopNExecutor::TopNExecutor(ExecutorContext *exec_ctx, const TopNPlanNode *plan,
std::unique_ptr<AbstractExecutor> &&child_executor)
: AbstractExecutor(... | ALGO | 0.96836 | 6.455853 |
c42b4d08-993e-4b31-9a14-24f25983d3f5 | Uttam8448/LEETCODE_PROBLEMS | 0547-number-of-provinces/0547-number-of-provinces.cpp | class Solution {
public:
void dfs(int node,vector<int> &visited,vector<vector<int>>& isConnected,int n){
if(!visited[node]){
visited[node]=1;
}
else{
return;
}
for(int i=0;i<n;i++){
if(node==i) continue;
if(isConnected[node][i]=... | ALGO | 0.999987 | 6.11281 |
012e9d2f-1918-4d81-8a38-80dba9da0d5b | sarvex/leetcode-nelua | solution/0800-0899/0893.Groups of Special-Equivalent Strings/Solution.cpp | class Solution {
public:
int numSpecialEquivGroups(vector<string>& words) {
unordered_set<string> s;
for (auto& word : words) {
string a = "", b = "";
for (int i = 0; i < word.size(); ++i) {
if (i & 1)
a += word[i];
else
... | ALGO | 0.999949 | 5.965124 |
39d5f8c2-6e04-4f52-9c0e-2f34046a0909 | milanow/LeetCodePractice | 500+/523_Continuous_Subarray_Sum.cpp | /* 523. Continuous Subarray Sum
* It is still a sub-sum problem since we are dealing with subarray(not sequence)
* A hashset to store previous module, and save previous mod into the hashset
* Since the problem requires at least length 2, thus we need to insert the mod value
* one iterator later
*/
class Solutio... | ALGO | 0.999974 | 5.432117 |
6ed5fcec-269a-4399-bbad-f06a17ad7400 | alpet83/Xray-NLC7 | Xray/xrLC/xrHierrarhy.cpp | #include "stdafx.h"
#include "build.h"
#include "OGF_Face.h"
void CBuild::BuildHierrarhy()
{
Fvector scene_size;
float delimiter;
scene_bb.getsize(scene_size);
delimiter = _MAX(scene_size.x,_MAX(scene_size.y,scene_size.z));
delimiter *= 2;
int iLevel = 1;
float SizeLimit = g_params.m_maxsize/8;
if (SizeL... | ALGO | 0.997194 | 3.884404 |
cf092f12-b70a-4b8a-835e-631a618994c8 | ishandutta2007/codeforces | dancho/normal/372/B.cpp | #include <cstdio>
#include <cstring>
int n, m, q;
int ps[64][64];
char x[64][64];
int it[64][64][64][64];
int main()
{
scanf("%d %d %d", &n, &m, &q);
for (int i = 0; i < n; i++)
{
scanf("%s", x[i]);
}
memset(ps, 0, sizeof(ps));
for (int i = 1; i <= n; ++i)
{
for (int j = 1; j <= m; ++j)
{
ps[i][j] ... | ALGO | 0.99978 | 4.382507 |
ac4782c7-86fa-4807-8a37-c1a645d36d5e | ishandutta2007/codeforces | shanquan2/normal/914/E.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=200100;
struct edge{
int nxt,to;
}e[N<<1];
int ft[N],a[N],s[N],n,cur,tim1,tim2,c1[(1<<20)+5],tt1[(1<<20)+5],c2[(1<<20)+5],tt2[(1<<20)+5];
long long b[N];
bool del[N];
char ch[N];
int getcen(int x,int fa){
s[x]=1;int ans=x;
for(int i=ft[x];i;i=e[i].nxt)if(e[i]... | ALGO | 0.99994 | 3.761189 |
4ec4357e-f73f-48b0-ba9a-86ab5a068f9d | ShreyasG16/IIIT-Delhi-College-Simulation | Question 1/main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include "AdminStructure.h"
#include "Department.h"
#include "Member.h"
#include "Utils.h" // Include Utils header for trim function
int main() {
AdminStructure admin;
// Example departments based on the assignment description.
Department irD("IRD"... | TOOL | 0.858734 | 6.470783 |
ddc687f4-db2e-41da-8b8a-cbebbaa91687 | hpcwasm/wasmtbb | src/tbb/reader_writer_lock.cpp | #include "tbb/reader_writer_lock.h"
#include "tbb/tbb_machine.h"
#include "tbb/tbb_exception.h"
#include "itt_notify.h"
#if defined(_MSC_VER) && defined(_Wp64)
// Workaround for overzealous compiler warnings in /Wp64 mode
#pragma warning (disable: 4244)
#endif
namespace tbb {
namespace interface5 {
const uin... | TOOL | 0.898007 | 7.600795 |
9e36811b-350d-4d82-8657-7e7554dab1b9 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/abc057/D/2338369.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#define ll long long
#define P 150094669656737489LL
static ll memo[51][51] = {{}};
ll comb(int n, int k) {
if(k==1) return n;
if(k==0) return 1;
if(n==k) return 1;
if(memo[n][k]!=0) return memo[n][k];
return memo[n][k] = comb(n-1, k-1)+comb(... | ALGO | 0.99969 | 3.548023 |
45eb9d79-0a08-4c23-b69a-6a741cf5b09d | GamerNishant/CppPrograms | beginnerCodes/stacks-stl.cpp | #include<bits/stdc++.h>
/*
functions available for stl stack basic one's
push
pop
top
size
empty
//stack has empty not isempty like list take care of that
*/
using namespace std;
void printstack(stack <int> s)
{
while(!s.empty())
{
cout<<s.top()<<" ";
s.pop();
... | ALGO | 0.934253 | 4.25048 |
b1ea451b-958c-4c0a-a690-db790ff23dc3 | itsKayumkhan/DSA-in-C- | LINKLIST/DOUBLY/deleta.cpp | #include <climits>
#include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node *per;
Node(int data)
{
this->data = data;
this->next = NULL;
this->per = NULL;
}
~Node()
{
int val = this->data;
if (this->next != NUL... | ALGO | 0.998973 | 3.286237 |
e690fafe-ad69-49d8-974f-bc506eac4be1 | MateuszKwiat/codeWars | cpp/7kyu/disemvowelTrolls.cpp | # include <string>
std::string disemvowel(const std::string& str) {
const std::string vowels = "aeiou";
std::string result = "";
for (auto x : str)
if (vowels.find(tolower(x)) == std::string::npos)
result += x;
return result;
} | ALGO | 0.963925 | 5.804673 |
cc3116b2-03ea-4e53-9f02-dd828ffc9fcf | avplayer/proxy | third_party/boost/libs/icl/example/party_/party.cpp | #include <iostream>
#include <boost/icl/interval_map.hpp>
#include "../toytime.hpp"
using namespace std;
using namespace boost::icl;
/**
Party.cpp demonstrates the possibilities of an interval map (interval_map or
split_interval_map). An interval_map maps intervals to a given content. In
this case the co... | ALGO | 0.995267 | 6.800165 |
d0eca194-2fc7-4c99-9376-314be55a998e | DEBOROY-1234/Starters_Solutions | starters83_q4.cpp | //Construct String
#include<bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int n;
cin>>n;
string u;
cin>>u;
int temp=1;
char var=u[0];
string ans="";
for(int i=1;i<n;i++){
if(var==u[i]){
temp++... | ALGO | 0.999997 | 3.996478 |
b2b5f1a2-b8f2-4a03-900b-31f4c310904a | PaulDeLOL/array-vs-linked-list | ArrayVSLinkedList.cpp | #include <iostream>
#include <iomanip>
#include <array>
#include <list>
#include <chrono>
#include <random>
using namespace std;
using namespace std::chrono;
// Searching and printing functions.
bool SearchArray(const time_point<steady_clock> &start, const array<int, 500> &arr);
bool SearchLinkedList(const time_point<... | ALGO | 0.996101 | 5.658306 |
6dbcd421-88cd-4d59-9102-5b9d635446e2 | Peipeilvcm/CPP_Exercise | practice/进制转换.cpp | #include<stdio.h>
int main()
{
long long a,b;
int m;
while(scanf("%d",&m) != EOF){
if(m == 0)
break;
scanf("%lld%lld",&a,&b);
a = a + b;
int ans[50],size = 0;
while(a!=0){
ans[size++]=a%m;
a/=m;
}
for(int i=size-1;i>=0;i--){
printf("%d",ans[i]);
}
printf("\n");
}
return 0;
}
//%ll... | ALGO | 0.999963 | 3.198402 |
8410670f-e7f6-4059-8854-8a99c545deca | xiboliOrange/notes | source codes/4/unaryOps.cpp | #include <iostream>
using std::cout; using std::endl;
int main()
{
int i = 1024;
int k = -i; // i is -1024
bool b = true;
bool b2 = -b; // b2 is true!
cout << b << " " << b2 << " " << endl;
return 0;
}
| ALGO | 0.896559 | 3.475884 |
fd9675d2-8d50-49d7-b911-bb4fa4ca6a4f | weikhor/Self-Driving-Car-Nanodegree | Term 2/CarND-MPC-Project/src/Eigen-3.3/doc/examples/Tutorial_BlockOperations_colrow.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(3,3);
m << 1,2,3,
4,5,6,
7,8,9;
cout << "Here is the matrix m:" << endl << m << endl;
cout << "2nd Row: " << m.row(1) << endl;
m.col(2) += 3 * m.col(0);
cout << "After adding 3 times the first colu... | ALGO | 0.979447 | 3.576145 |
bee8d5c5-8a4d-4ad4-ae77-8193c1715567 | MaximKaratun/C-labs | Laboratory work - 6/Working with arrays - 2/Array(6).cpp | /* Задача:
Вычислить сумму модуля элементов массива, которые расположены после 1-го отрицательного элемента*/
#include <iostream> //Подключение библиотеки функции ввода-вывода.
#include <math.h> //Подключение библиотеки для нашего модуля abs.
using namespace std;
int main() {
int i; //Переменная для цикла.
... | ALGO | 0.999748 | 3.718233 |
2c2ff6d1-fb59-4d9d-9801-db3805d45c38 | mhBahrami/MPC | src/Eigen-3.3/unsupported/doc/examples/EulerAngles.cpp | #include <unsupported/Eigen/EulerAngles>
#include <iostream>
using namespace Eigen;
int main()
{
// A common Euler system by many armies around the world,
// where the first one is the azimuth(the angle from the north -
// the same angle that is show in compass)
// and the second one is elevation(the angl... | ALGO | 0.989945 | 5.125681 |
f73f3fb2-cbbf-49fa-9081-69f6ed9266ae | dagribo/vintik_shpuntik | Vintik_Shpuntik/Source.cpp | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <iomanip>
#define det(a,b,c,d) (a*d-b*c)
const double EPS = 1E-9;
using namespace std;
int N,num=0,vin_r,shpun_r;
//vector < vector < pair<int, double> > > gra... | ALGO | 0.999655 | 3.498431 |
60025af3-a060-4b4e-b5d1-aa22a80a6c2e | perewodchik/Bakers | main.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include "Baker.h"
#include "Bun.h"
using namespace std;
const int MAX_ROUNDS = 25;
const int REQUIRED_WINS = 15;
const int MAX_PLANNED = 600;
const int MIN_PLANNED = 300;
const float EXP_PER_PLAN = 100.f;
#define SINGLE_TRAIN_LOG1
int singleT... | ALGO | 0.950489 | 4.363353 |
2473b17f-bbe1-4524-b6af-e73949487bb3 | Covalia/standalone-deployer | _settings/src/utils/crypt/qblowfish/qblowfish.cpp | #include "qblowfish.h"
#include "qblowfish_p.h"
#include <QtEndian>
#include <QDebug>
QBlowfish::QBlowfish(const QByteArray &key)
: m_key(key)
, m_initialized(false)
, m_paddingEnabled(false)
{
}
void QBlowfish::setPaddingEnabled(bool enabled)
{
m_paddingEnabled = enabled;
}
bool QBlowfish::isPadding... | ALGO | 0.987116 | 7.130663 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.