uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9d273981-85b1-48f4-9148-b9c720bb4842 | Shorya-Dixit/Leetcode_Solutions | 0328-odd-even-linked-list/0328-odd-even-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* oddEvenList... | ALGO | 0.999912 | 5.856819 |
ffe79fee-2fb4-4dfb-8120-a169b30f5086 | DivyankSisodia/DSA-Problem-set | 0034-find-first-and-last-position-of-element-in-sorted-array/0034-find-first-and-last-position-of-element-in-sorted-array.cpp | class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
int n = nums.size();
int s = 0;
int e = n-1;
int ans = -1;
while(s<=e){
int mid = s+(e-s)/2;
if(nums[mid] == target){
ans = mid;
... | ALGO | 0.999964 | 6.670321 |
6eecbec8-c84b-46f2-ac30-ce0ef25cc47d | catalinasirbu/LU-decomposition-CR | testbench.cpp | #include <iostream>
#include <cstdlib>
#include <cmath>
#include "decompose.h"
// Function to print matrices for debugging
void print_matrix(const char* name, float mat[MAX_SIZE][MAX_SIZE], int size) {
std::cout << name << ":\n";
for (int i = 0; i < size; ++i) {
for (int j = 0; j < size; ++j) {
... | ALGO | 0.999574 | 5.457139 |
994dcf6f-2a8b-4209-9981-5f96c103404a | moon1198/Leetcode | hot100/solution763.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> partitionLabels(string s) {
int dict[26] = {0};
for (int i = 0; i < s.size(); ++ i) {
dict[s[i] - 'a'] = max(dict[s[i] - 'a'], i);
}
vector<int> ans;
int beg = 0;
int r_end = dict[s[0] - 'a'];
for (int i = 0; i < s.size(); +... | ALGO | 0.99985 | 5.571308 |
ed87fe3a-c949-4bd2-87fa-deaf433c5580 | ishandutta2007/codeforces | okwedook/normal/1351/A.cpp | #pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("sse4.2")
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <bitset>
#include <sstream>
#include <deque>
... | ALGO | 0.999282 | 5.403265 |
9ec09ad6-bff9-456b-bdbe-97f6e60709f0 | hainam20/CP | CSES/Introductory Problem/CoinPile.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
const int MOD = 1000000007;
/**
* Tổng số tiền trong cả hai đống phải chia hết cho 3.
* do mỗi lần di chuyển chúng ta đều giảm tổng số lượng tiền trong hai đống đi 3 đồng (hoặc ( 1 + 2 ) (1+2) hoặc ( ... | ALGO | 0.999773 | 5.289568 |
2f113963-9f19-456f-94e5-1dc8f07f843c | alestafina/NM2_iter_method | realisation.cpp | #include "lab2.h"
ofstream fout("output.csv");
void matrix::input_matrix() {
double tmp = 0;
ifstream fin("input.txt");
fin >> N >> M >> eps >> maxiter;
vector<int> l = { N - M - 3, N - M - 2, N - 1, N,
N - 1, N - M - 2, N - M - 3 };
for (int i = 0; i < size; i++) {
vector... | ALGO | 0.999925 | 3.292062 |
ed73852c-96af-4e6a-973c-74da79c65da9 | Sumeet1954/Data-Structures-and-Algorithms | Arrays/Arrays Basics/Q10.cpp | // Check if Two Elements Exist with a Sum Equal to a Target Value
#include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
void printElement(vector<int> &nums , int target)
{ int i =0;
int j = nums.size()-1;
while(i < j){
if((nums[i]+nums[j]) == targ... | ALGO | 0.999232 | 5.823937 |
91c0b56a-1421-435f-b89e-a2c14dec9c0d | ryanzhang15/RJ_HKOI | NP1821.cpp |
/*
template by c8kbf
*/
// macOS doesn't have <bits/stdc++.h> (shame)
#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <cstring>
#include <ctime>
#include <deque>
#include <string>
#include <stack>
#include <vector>
#include <map>
#include <... | ALGO | 0.999937 | 4.060702 |
f15e1926-643a-42a1-a7f0-cf301a8b71f7 | Sujata005/Leetcode | cpp submissions/Binary Search All Questions/374. Guess Number Higher or Lower.cpp | /**
* Forward declaration of guess API.
* @param num your guess
* @return -1 if num is higher than the picked number
* 1 if num is lower than the picked number
* otherwise return 0
* int guess(int num);
*/
class Solution {
public:
int guessNumber(int n) {
int low = 1,... | ALGO | 0.999956 | 6.132433 |
ba2295cd-6c64-472d-8e91-1a62d200b4b1 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6607_5.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) cout << i + 1 << " ";
cout << 1 << endl;
}
| ALGO | 0.999236 | 3.433536 |
271a291e-457a-4602-ad60-68ada282fb14 | LunaYang1017/unitree_speed | src/control/reMPC.cpp | #include "control/reMPC.h"
#include "common/mathTools.h"
#include "common/timeMarker.h"
#include "common/unitreeRobot.h"
#include "message/LowlevelState.h"
#include "common/unitreeLeg.h"
#include "FSM/State_MPC.h"
#include <sys/time.h>
/**
* @brief 构造函数,初始化MPC控制器。
* @param robModel 机器人的模型对象,提供机器人的物理属性。
*
* 状态估计器 ... | ALGO | 0.999266 | 4.193806 |
8c428ec2-9a75-4b5c-9b5f-7b999b07cc3f | wise1ight/ProblemSolving | boj/18258.cpp | #include <iostream>
#define MAX_SIZE 2000000
using namespace std;
class queue {
private:
int arr[MAX_SIZE];
int _front;
int _back;
public:
queue() {
_front = 0;
_back = 0;
}
void push(int target) {
arr[_back++] = target;
}
int pop() {
if(!empty())
return arr[_front++];
els... | ALGO | 0.999014 | 4.323154 |
a18a552b-1651-482c-b3ca-d649e3976e35 | kisigami/test | GameTemplate/k2EngineLow/ExEngine/effekseer/Effekseer/Effekseer/SIMD/Effekseer.Mat43f.cpp | #include "Effekseer.Mat43f.h"
#include "../Effekseer.Matrix43.h"
#include <cmath>
namespace Effekseer
{
//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
const Mat43f Mat43f::Identity = Mat43f(
... | ALGO | 0.881824 | 6.168111 |
85666c00-2566-4811-a549-e5aa39b1b3ee | Manish12-verma/Cpp-DSA | Pattern/Question1.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cout <<"*";
} cout <<endl;
}
return 0;
} | ALGO | 0.999532 | 3.0067 |
13fabf2c-c917-4b5f-add8-7108fc63bbcf | ituki0426/dev_atcoder | src/Algo/Graph/BIT/ Shift_and_Inversion.cpp | #include <iostream>
#include <vector>
using namespace std;
using ll = long long;
class BIT {
public:
BIT() = default;
explicit BIT(size_t size) : m_bit(size + 1, 0) {}
explicit BIT(const std::vector<long long>& v) : BIT(v.size()) {
for (size_t i = 0; i < v.size(); i++) {
add(i, v[i]);... | ALGO | 0.999913 | 3.881389 |
35dab83d-3bb5-4b55-be05-53aef2e49734 | bhavyaGP/CPworld | SlidingWindow/sumofsubarrwithsizek.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int k = 3;
int start = 0, end = 0;
int sum = 0;
vector<int> sums;
while (end < arr.size())
{
sum += arr[end];
if (end - start + 1 < k)
{
end++;
... | ALGO | 0.999722 | 3.279461 |
c4a07e92-f373-42b8-9b79-577fef07745d | AlfengYuan/leetcode-cplusplus-offline | leetcode5/l00204.cpp | class Solution {
public:
int countPrimes(int n) {
int count = 0;
vector<bool> is_prime(n, true);
for(int i = 2; i*i < n; i++){
if(is_prime[i]){
for(int j = i * i; j<n; j+=i){
is_prime[j] = false;
}
}
}
... | ALGO | 0.999934 | 5.93735 |
c7207811-f177-4aee-a4f4-f1560b2909bf | kangjunyoung37/algorizm-c | 4963_problem.cpp | #include<iostream>
#include<queue>
using namespace std;
int dx[8] = { 1,-1,0,0,-1,-1,1,1 };
int dy[8] = { 0,0,1,-1,-1,1,-1,1 };
int map[51][51];
bool visit[51][51];
int w, h;
void bfs(int x, int y)
{
visit[x][y] = true;
map[x][y] = 0;
queue<pair<int, int>> q;
q.push(make_pair(x, y));
while (!q.empty())
{
int c... | ALGO | 0.999706 | 4.488867 |
7ce56313-02ed-423d-9653-460196e5dc1d | bappasahabapi/Level-1-ProblemSet-div-3- | URI-Solved-Problems/uri1046.cpp | #include<iostream>
using namespace std;
int main()
{
int a, b;
cin>>a>>b;
if(a==b)
{
cout<<"O JOGO DUROU 24 HORA(S)"<<endl;
}
else if(a>b)
{
cout<<"O JOGO DUROU "<<24-(a-b)<<" HORA(S)"<<endl;
}
else
cout<<"O JOGO DUROU "<<(b-a)<<" HORA(S)"<<endl;
}
| ALGO | 0.999079 | 3.14808 |
e1bc75ce-42e9-42b5-bee2-0cf628c20c17 | papiot/CarND-MPC-Project | src/Eigen-3.3/doc/examples/DenseBase_template_int_middleCols.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl;
return 0;
}
| ALGO | 0.887526 | 3.154174 |
046eaa40-0924-4247-9013-a596e0a2112c | siddofficial13/DSA-251-codes | FInd element that appears twice.cpp | int singleNonDuplicate(vector<int>& nums)
{
// Write your code here
//O(n) approach
// int xorval=0;
// for(int i=0;i<arr.size();i++){
// xorval=xorval^arr[i];
// }
// return xorval;
int n = nums.size();
int low = 0;
int high = n - 2;
while (low <= high) {
int... | ALGO | 0.999869 | 5.226093 |
d1570b3c-6814-45d3-bd71-67564e66014c | Pyt-Sergei/Sports-programming | C++/940.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
string s;
cin>>n>>s;
s[n-1]='7';
for(int i=0;i<s.length();i++){
if(s[i]>='A' && s[i]<='Z') cout<<s[i];
}
}
| ALGO | 0.994399 | 3.411433 |
31c13715-9574-4909-a6a1-4e62d467ef58 | cdegree/ACM | 日常/Data_Structure/A.cpp | #include <cstdlib>
#include <cstring>
#include <cctype>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#define X first
#define Y second
#define sqr(x) ((x)*(x))
using namespace std;
const dou... | ALGO | 0.999888 | 3.744524 |
9cded1ee-e7aa-40b4-82de-f248094f51ec | MahendraDani/problem-solving | src/contests/codeforces/cf-998-3/a.cpp | #include <iostream>
#include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define pi pair<int,int>
#define vll vector<long long>
using namespace std;
void solve(){
int a1,a2,a4,a5;
cin >> a1 >> a2 >> a4 >> a5;
int a3 = a1 + a2;
int ans = 1;
if(a4 == a2 + a3) ans++;
if(a5 == a3 + a4) ans+... | ALGO | 0.999605 | 4.912347 |
854304b7-ba8b-4afd-ab53-51b7fcb28be2 | man0045/Data_Structure_with_Cpp | Trees/inorder.cpp | #include<iostream>
using namespace std;
class Node{
public:
int val;
Node* left;
Node* right;
Node(int val){
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
void inorder(Node* root){
if(root == NULL) return;
inorder(root->left);
cout<<root->val<<" ";
... | ALGO | 0.999992 | 4.881444 |
53c4132d-f8c9-4530-b007-7b79ee6711a6 | songdongjing/navigation_car | src/navigation-melodic/amcl/src/amcl/sensors/amcl_laser.cpp | ///////////////////////////////////////////////////////////////////////////
//
// Desc: AMCL laser routines
// Author: Andrew Howard
// Date: 6 Feb 2003
// CVS: $Id: amcl_laser.cc 7057 2008-10-02 00:44:06Z gbiggs $
//
///////////////////////////////////////////////////////////////////////////
#include <sys/types.h> //... | ALGO | 0.984917 | 5.771644 |
f96d4b5c-c4b5-4291-b428-04d856adb88e | sindwerra/Algorithms | CrackingTheCodingInterview/链表/访问单个节点的删除/main.cpp |
struct ListNode {
int val;
struct ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
// 只有单节点的指针,则使用此指针的节点链接的下一个节点的值覆盖本节点的值,再删除下个节点
class Remove {
public:
bool removeNode(ListNode* pNode) {
// write code here
if (pNode == nullptr) { return true; }
if (pNode->next == n... | ALGO | 0.999624 | 5.167574 |
53797f5c-e1de-41ce-8e10-a1799c403dce | shivcodecf/leetcode-start-9-2-24 | 2891-maximum-beauty-of-an-array-after-applying-operation/maximum-beauty-of-an-array-after-applying-operation.cpp | class Solution {
public:
int maximumBeauty(vector<int>& nums, int k) {
int cnt=0;
map<int,int>mp;
for(int i=0;i<nums.size();i++)
{
int x = nums[i]+k;
int y = max(nums[i]-k,0);
mp[y]++;
mp[x+1]--;
}
int n=n... | ALGO | 0.999955 | 5.352088 |
f3cfac1c-2b8e-4c8b-83b6-2fdbd390d3e5 | MinQyu/algorithm | programmersCPP/programmersL0/programmersL0/numCount.cpp | #include "programmersL0.h"
int numCount(vector<int> array) {
int answer = 0, i;
string tmp;
for (i = 0; i < array.size(); i++) {
tmp.append(to_string(array[i]));
}
for (i = 0; i < tmp.length(); i++) {
if (tmp[i] == '7') answer++;
}
return answer;
}
void numCount() {
cou... | ALGO | 0.953847 | 3.824985 |
393efb53-cbda-4836-9dab-e22ec9f51473 | ishandutta2007/codeforces | smax/normal/1373/F.cpp | /*
*/
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...) 6;
#endif
template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename... | ALGO | 0.999908 | 3.618749 |
cf9ad7c5-d11c-46b6-a8bf-89c84b69919e | whogurdevil/DSLAB | Programs/2stack.cpp | #include <bits/stdc++.h>
using namespace std;
class Stack{
private:
int* arr = NULL;
int top;
int max;
public:
Stack(){
this->top = -1;
this->max = 0;
}
Stack(int size){
this->top = -1;
this->max = size;
this->arr = new int[max];
}
Stack(... | ALGO | 0.9893 | 4.922299 |
85d8bde3-e47c-4d63-9c48-4a3d9f10cd6b | vishal1844/leetcode | 3005-count-elements-with-maximum-frequency/3005-count-elements-with-maximum-frequency.cpp | class Solution {
public:
int maxFrequencyElements(vector<int>& nums) {
map<int,int>mp;
for(auto itr:nums)mp[itr]++;
int t=0;
int k=0;
for(auto itr:mp){
if(t<itr.second){
t=itr.second;
k=itr.second;
}
else if(... | ALGO | 0.999956 | 5.716474 |
bdf7dd72-d0ee-4737-a2ad-d44907cc6af8 | revyos-rocm/llvm-project-rocm | compiler-rt/lib/scudo/standalone/crc32_hw.cpp | #include "checksum.h"
namespace scudo {
#if defined(__CRC32__) || defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
u32 computeHardwareCRC32(u32 Crc, uptr Data) {
return static_cast<u32>(CRC32_INTRINSIC(Crc, Data));
}
#endif // defined(__CRC32__) || defined(__SSE4_2__) ||
// defined(__ARM_FEATURE_CRC32)
}... | TOOL | 0.873748 | 6.160818 |
8d5d9154-d871-4858-b1e1-648f274d426d | Sahaj-Bamba/algorithms | cf/Other/Random/677_prob_c.cpp | #include <bits/stdc++.h>
#define fastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define INF LLONG_MAX
#define mem(a,val) memset(a,val,sizeof(a))
#define rep(i,j,n) for(i=j;i<n;i++)
#define invrep(i,j,n) for (i = j-1; i >=n ; --i)
#define prec(n) fixed<<setprecision(n)
#define ... | ALGO | 0.999735 | 3.935676 |
4ec9813e-a6f2-4cb1-92d9-fb2198e20faf | zguoch/saltwatereos | Library/app/lutGen_2D.cpp | #include "H2ONaCl.H"
int main(int argc, char** argv)
{
if(argc!=11)
{
STATUS("Usage: "+string(argv[0])+" [T|H] [T|H|P|X] [z0] [xmin] [xmax] [ymin] [ymax] [min_level] [max_level] [nThread]");
STATUS("Unit: T[deg.C], P[bar], X[wt. NaCl, 0-1], H[MJ/kg]");
STATUS_color("Example 1: T X 0.2 1... | TOOL | 0.971613 | 4.204772 |
ca4c4f35-ce8a-482a-b935-1a5b18987170 | GreyManuel/GreyHacks | SDE Sheet/3_sum.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
/*
link: https://leetcode.com/problems/3sum/
Video link: https://youtu.be/jzZsG8n2R9A
*/
class NaiveSolution
{
public:
vector<vector<int>> threeSum(vector<int> &nums)
{
vector<vector<int>> ans;
vector<int> temp;
... | ALGO | 0.999579 | 5.533392 |
6aef829a-2daf-4dbd-991c-992c415e7095 | syuta-sugawara/c-ForGithub | AssignmentE/AssignmentE1/AssignmentE1/main.cpp |
/* Syuta Sugawara (Syuta)
CIS 22A Winter 2018
Laboratory Assignment E
Problem E1
This program computes and prints the solution of the equation ax2 + bx + c.
*/
#include <iostream>
#include <cmath>
using namespace std;
int main(void) {
int a,b,c;
double x;
double x1 , x2;
cout<< "enter a :";
c... | ALGO | 0.999287 | 3.99431 |
86aa940a-2bca-4691-b529-64d19583a566 | AbhishekSinghDev/dsa-notes | lecture 10/sort012.cpp | #include<bits/stdc++.h>
using namespace std;
void printArray(int arr[], int n) {
for(int i=0; i<n; i++) {
cout<<arr[i]<<" ";
}
}
void sort012(int arr[], int n) {
int left = 0;
int right = n-1;
while(left < right) {
while(arr[left] == 0 && left < right) {
left++;
... | ALGO | 0.999891 | 4.871771 |
682d33d1-0f0a-40d8-a1c8-8c0a4d3ac104 | sliencetian/AndroidFrameWorks | frameworks/ml/nn/common/operations/MaximumMinimum.cpp | #define LOG_TAG "Operations"
#include "MaximumMinimum.h"
#include "IndexedShapeWrapper.h"
#include "OperationsUtils.h"
#include "Tracing.h"
namespace android {
namespace nn {
namespace maximum_minimum {
namespace {
template <typename T>
bool evalGeneric(const T* aData, const Shape& aShape, const T* bData, const Sha... | ALGO | 0.995602 | 7.487933 |
84e3aa08-254f-4014-8792-fa578fa9e230 | Sameer-Pattnaik/leetcode | 2636-maximum-subsequence-score/2636-maximum-subsequence-score.cpp | class Solution {
public:
long long maxScore(vector<int>& nums1, vector<int>& nums2, int k) {
vector<pair<int, int>> p ;
for(int i = 0 ; i<nums1.size() ; i++)
{
p.push_back({nums2[i] , nums1[i]});
}
sort(p.rbegin() , p.rend());
... | ALGO | 0.999974 | 4.862924 |
0295969d-5488-43a0-8ba4-9c3520062e4f | wjingzhe/Jingz_C_lab | lab8_10/lab8_10/lab8_10.cpp | // lab8_10.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
#include<stdio.h>
void main()
{
int large(int x,int y);
int i,a[10],b[10],n=0,m=0,k=0;
printf("enter array a:\n");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
// printf("\n");
printf("enter array b:\n");
for(i=... | ALGO | 0.99913 | 3.107951 |
ac245b94-8f5a-4c3f-9be2-17441b2698b2 | dinhtuantinh/C-plus-plus | Hoc C++/xoa du lieu trong dslk don.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,x;cin>>n;
int a[n+2];
for(int i=0; i<n; i++) cin>>a[i];
cin>>x;
vector<int>kq;
for(int i=0; i<n; i++){
if(a[i]==x) continue;
else kq.push_back(a[i]);
}
for(int i=0; i<kq.size(); i++) cout<<kq[i]<<' ';
return 0;
}
| ALGO | 0.999985 | 3.368488 |
a6d8df4b-d0bb-4619-a716-c117caebd64d | TwentyFiveSeven/Algorithm | C-Code/Pro.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<pair<int,int>> temp,F,S,temp1;
int main(){
int N,a,b,save = -1;
for(int i=0;i<N;i++){
cin>>a>>b;
temp.push_back(make_pair(b,a)); //자식,부모
}
sort(temp.begin(),temp.end());
for(int i=0;i<N-1;i++){
if(temp[i].first == temp[i+1].first)
... | ALGO | 0.999779 | 3.540984 |
9a22bd72-d0ca-427b-a8e8-bc72207e2622 | nirvana369/UVA-problem-solved | 10397.cpp | /*
Hoang Linh
*/
#include <cstdlib>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <map>
#include <queue>
#include <iostream>
#define fi "10397.inp"
#define fo "10397.out"
/**/
using namespace std;
/**/
struct campus{
int dau,cu... | ALGO | 0.999783 | 3.762159 |
99f10624-fbf7-4edd-8a42-7074ec10a310 | ducanhnguyen/cft4cpp-core | data-test/tsdv/Sample_for_R1_4_Eclipse/Sample_for_R1_4/Complex.cpp | #include <string.h>
int ComplexTest2(int x, int y)
{
bool greater = x > y;
int max;
if (greater) {
max = x;
} else {
max = y;
}
bool less = !greater;
less = less && x > 0;
if (max > 0 || less) {
return 1;
} else {
return 0;
}
}
void toUpperCase(char* str, int len)
{
for (int i = 0; i < len; i++)... | ALGO | 0.994953 | 5.226815 |
19b89fe4-acd3-44ed-9395-bc0e1ffa69f1 | joshzhouyy/Algos | cpp/magic.cpp | // Problem: |
// Define rules for magic strings |
// a --> e |
// e --> a || i |
// i --> a || e || o || u |
// o --> u || i ... | ALGO | 0.999739 | 6.155453 |
4514dd5a-39bf-437f-8c3e-1b033e2af968 | Shubham2816/DSA_Problems | 806-domino-and-tromino-tiling/domino-and-tromino-tiling.cpp | class Solution {
private:
static const int mod = 1e9 + 7;
vector<vector<long long>> multiply(const vector<vector<long long>> &A, const vector<vector<long long>> &B) {
vector<vector<long long>> C(3, vector<long long>(3, 0));
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
... | ALGO | 0.999956 | 5.671963 |
1ae47efc-fb68-4628-bf8a-c79c80e15e8c | sarvex/leetcode-clojure | solution/0000-0099/0063.Unique Paths II/Solution.cpp | class Solution {
public:
int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
int m = obstacleGrid.size(), n = obstacleGrid[0].size();
vector<vector<int>> dp(m, vector<int>(n));
for (int i = 0; i < m && obstacleGrid[i][0] == 0; ++i) {
dp[i][0] = 1;
}
... | ALGO | 0.999789 | 6.297352 |
23855bf5-d227-47b2-815d-2a6ac1b9f658 | ReynoldZhao/ReyRay-LC-Practice-ForManyOffers | Leetcode_C++/LC_Previous/招商.cpp | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
#include<utility>
using namespace std;
class Solution {
public:
void FindNumsAppearOnce(vector<int> data,int* num1,int *num2) {
int temp = data[0];
for(int i=1;i<data.size();i++){
temp = ... | ALGO | 0.999947 | 4.545444 |
81533104-06d1-4c21-a12e-dcee98c6b9db | ANLAB-KAIST/adios | dispatcher/deps/faiss/faiss/IndexShards.cpp | #include <faiss/IndexShards.h>
#include <cinttypes>
#include <cstdio>
#include <functional>
#include <faiss/impl/FaissAssert.h>
#include <faiss/utils/Heap.h>
#include <faiss/utils/WorkerThread.h>
namespace faiss {
// subroutines
namespace {
// IndexBinary needs to update the code_size when d is set...
void sync_d... | TOOL | 0.896986 | 7.312356 |
14f3a43e-4ecb-436e-8836-91fd916c1236 | Doorbals/Coding_Test | 프로그래머스/lv2/68936. 쿼드압축 후 개수 세기/쿼드압축 후 개수 세기.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <tuple>
#include <cmath>
using namespace std;
vector<vector<int>> map;
vector<int> result(2);
void compress(int n, int y, int x)
{
if (n == 1)
{
if (map[y][x] == 0)
result[0]++;
else
result[1]++;
return;
}
bool exist_... | ALGO | 0.999801 | 4.216274 |
f76fe26e-69af-4733-a2f1-6c18128eb3db | kepler-moment/LeetCode | RemoveDuplicatesfromSortedList.cpp | //implementation
class Solution {
public:
ListNode *deleteDuplicates(ListNode *head)
{
ListNode *p,*pre_p;
ListNode *newhead = new ListNode(0);
newhead->next = head;
pre_p = newhead,p = head;
while(p && p->next)
{
if(p->next && p->next->val == p->val)... | ALGO | 0.999943 | 5.744471 |
b3bc3a97-67f8-41e6-b60f-94ef5af319f8 | jjpprrrr/frameworks_av | media/codecs/amrnb/common/src/inv_sqrt.cpp | /*
Pathname: ./audio/gsm-amr/c/src/inv_sqrt.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Put file into template.
Description: Synchronized file with UMTS version 3.2.0. Updated coding
template. Removed unnecessary include files.
De... | ALGO | 0.999886 | 5.675018 |
c5ab3df3-3aff-4e48-aa5d-52800e6dbabd | Gaurav-Dewangan-GD/DSAlgoPractice | practiceprograms/reversearray.cpp | //c++ program to reverse an array
#include<iostream>
/*void swap(int a,int b)
{
int t;
t = a;
a = b;
b = t;
}*/
void reverse_arr(int arr[], int size)
{
int start = 0;
int end = size -1;
while(start <= end)
{
std::swap(arr[start],arr[end]);
start++;
end--;
}
}
int main()
{
int a[5] = {1,2,3,4,5};
... | ALGO | 0.999599 | 4.432947 |
4484e16c-c96f-470c-8e0d-1f9e578789e0 | manaswijain28/Trees | subtreesize.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
void solve() {
int n;
cin>>n;
vector<int> adj[n+1];
for(int i=1;i<n;i++){
int a,b;
cin>>a>>b;
adj[a].push_back(b);
adj[b].push_back(a);
}
vector<int> subtreesize(n+1,1);
function<void(int... | ALGO | 0.999926 | 4.034314 |
381fd246-5540-47c4-abb7-64c994999992 | sajjadjuel/DATA_STRUCTURE | Lab task 1/odd.cpp | #include<iostream>
#include<string.h>
using namespace std;
int func(int a,int b)
{
for (int i=a; i<=b; i++)
{
if (i%2!=0)
{
cout<<i<<" ";
}
else{}
}
}
int main()
{
int a,b;
cout<<"Starting Value : ";
cin>>a;
cout<<"Ending Value : ";
cin>>b;... | ALGO | 0.998535 | 3.515885 |
13782a94-5f3d-44f9-b262-b8fa2cf7590b | LeetAnkit/LeetCode-Solutions | 1818-maximum-score-from-removing-substrings/maximum-score-from-removing-substrings.cpp | class Solution {
public:
int maximumGain(string s, int x, int y) {
stack<char> st;
int count=0;
for(int i=0;i<s.length();i++)
{
if(!st.empty() && x>=y && s[i]=='b' && st.top()=='a')
{
st.pop();
count=count+x;
}
... | ALGO | 0.99993 | 5.555872 |
da36f7f7-f201-444e-8e61-aefac264c777 | nkc512/6Companies30days | 1_11FindMissingAndRepeating.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int *findTwoElement(int *arr, int n) {
// code here
int i=0;
int temp;
int repeat=-1;
int *arr2=new int[2];
int j=0;
while(i<n)
{
... | ALGO | 0.999878 | 4.987386 |
9521997f-46dc-4dcf-84b1-c01b92d6aef0 | sri-soumya/leetcode-questions | N-Queen Problem - GFG/nqueen-problem.cpp | // { Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
bool check(int j,vector<int> &a,int n)
{
int i=a.size(),c=i;
for(int x=0;x<i;x++)
{
if(a[x]==... | ALGO | 0.999038 | 6.077256 |
38cd94dc-61ed-4a84-8724-bc86228b51cd | traviskahl/programming_work | cpp/learncpp/ch5/sec5/unsigned.cpp | #include <iostream>
int main() {
unsigned int count = 10;
// count from 10 down to 0
while (count >= 0) {
if (count == 0)
std::cout << "Blastoff!";
else
std::cout << count << '\n';
--count;
}
return 0;
} | TOOL | 0.996103 | 5.619529 |
3bd327df-390c-4e67-8ad8-ac0193ece83b | xuxinpie/IMServer | cpp/src/base/crypt.cpp | /********************************************************************
purpose:
*********************************************************************/
#ifdef WIN32
#include "stdafx.h"
#else
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#endif
#include "crypt.h"
#include <netinet/in.h>
... | ALGO | 0.986804 | 4.097783 |
2d8194b7-ea8b-4efa-830a-d4cf40e47142 | aditya13902/Leetcode | 846-hand-of-straights/846-hand-of-straights.cpp | class Solution {
public:
bool isNStraightHand(vector<int>& hand, int groupSize) {
unordered_map<int,int>mp;
// priority_queue
sort(hand.begin(),hand.end());
for(int i=0;i<hand.size();i++){
mp[hand[i]]++;
}
for(auto ele:hand){
if(mp[ele]==0){
... | ALGO | 0.999996 | 5.773033 |
7bb3cd71-bf75-47ae-89b0-ff607e6f0d5b | topology-tool-kit/ttk | core/vtk/ttkIntegralLines/ttkIntegralLines.cpp | #include "Triangulation.h"
#include <string>
#include <ttkIntegralLines.h>
#include <ttkMacros.h>
#include <ttkUtils.h>
#include <ArrayLinkedList.h>
#include <vtkCellData.h>
#include <vtkDataArray.h>
#include <vtkDataObject.h>
#include <vtkDataSet.h>
#include <vtkDoubleArray.h>
#include <vtkInformation.h>
#include <vt... | ALGO | 0.991185 | 3.406703 |
11350c83-3eb4-4c2a-a6cf-74330cd558b7 | pbysu/BOJ | ~2017/2442.cpp | #include<iostream>
using namespace std;
int main() {
int flo;
cin >> flo;
int k = flo;
for (int i = 1; i < flo+1; i++) {
for (int m = 0; m < k-1; m++) {
cout << " ";
}
k = k - 1;
for (int j = 0; j < 2*i-1; j++) {
cout << "*";
}
cout << "\n";
}
} | ALGO | 0.99983 | 3.472002 |
2648c087-8fe2-46f6-bdd4-2956c7c54d45 | StringAna/required-programs | binarysearch.cpp | #include <iostream>
using namespace std;
int main()
{
int lb,ub,mib,a[10],ele,i;
cout<<"enter array : ";
cout<<"\n";
for (i=0 ; i<10 ; i++)
{
cout<<"enter a["<<i<<"] : - ";
cin>>a[i];
}
cout<<"enter element to be searched : ";
cin>>ele;
lb=0;
ub=9;
while(lb<=ub)
{
int mid=(lb+ub)/2;
if(a[mid]==ele)
... | ALGO | 0.997401 | 3.192775 |
59529a36-d040-46c3-9bf1-b7baeb47329c | MdMostafizurRahaman/Information-Security | code/edit_trina_mono.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
char plain[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'k', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
... | ALGO | 0.999964 | 3.364091 |
f260ed00-8615-4cc2-8624-6979add5fa41 | SPL-BGU/BiHS-Consistent-F2E | conference/mapalgorithms/RHRUnit.cpp | #include "RHRUnit.h"
/**
* Make the next move.
*
* Make the next move following the right hand rule.
*/
bool RHRUnit::MakeMove(MapEnvironment *, OccupancyInterface<xyLoc, tDirection> *, MapSimulationInfo *, tDirection& dir)
{
dir = possibleDir[lastIndex];
return true;
}
/**
* set rhr unit location.
*
* To foll... | ALGO | 0.998683 | 5.055937 |
76d83bfd-7059-4d95-a101-503114d92c5b | GGanj/LeetCode | 206.reverse-linked-list/reverse-linked-list.cpp | /*
* @lc app=leetcode.cn id=206 lang=cpp
*
* [206] 反转链表
*
* https://leetcode-cn.com/problems/reverse-linked-list/description/
*
* algorithms
* Easy (72.89%)
* Likes: 2595
* Dislikes: 0
* Total Accepted: 1.1M
* Total Submissions: 1.5M
* Testcase Example: '[1,2,3,4,5]'
*
* 给你单链表的头节点 head ,请你反转链表,并返回... | ALGO | 0.999676 | 6.000673 |
059e931d-ec6f-432c-af6d-c0bce7d3df68 | SKThakur0401/Cpp-Notes | Practice/25.cpp | #include<iostream>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
using namespace std;
void print_DFS(int** arr, int sv, bool* visited, int n)
{
cout<< sv <<" ";
visited[sv]=true;
for (int i = 0; i < n; i++)
{
if(arr[sv][i]==1 && !visited[i])
{
print_DFS(a... | ALGO | 0.999981 | 4.183854 |
5660a8e5-a897-4abd-a760-f8f669ee0c1b | dibikapandey00/ACHS_80117714-DISCRETESTRUCTURE.lab5and6 | Question 3.cpp | //Write a program to check whether a number is prime or not, with the help of Fermat?s little theorem.
#include <stdio.h>
#include <stdlib.h>
int power(int x, unsigned int y, int p) {
int res = 1;
x = x % p;
while (y > 0) {
if (y & 1)
res = (res * x) % p;
y = y >... | ALGO | 0.999942 | 4.940526 |
d3bdb939-b1a1-468d-8e1f-10790250790d | ishandutta2007/codeforces | krk/normal/383/C.cpp | #include <cstdio>
#include <vector>
#pragma comment(linker, "/STACK:16000000")
using namespace std;
const int Maxn = 200005;
const int Maxm = 1048576;
int n, m;
int a[Maxn];
vector <int> neigh[Maxn];
int lvl[Maxn], ind[Maxn];
int cnt[2];
int l[Maxn][2], r[Maxn][2];
int st[2][Maxm];
void Traverse(int v, int p, int my... | ALGO | 0.999967 | 4.525336 |
d7bb968c-f0e3-4dea-899b-efb4230a1f5e | thienmai909/OnThiOLP | FOR9.cpp | #include <iostream>
#include <vector>
using namespace std;
using ull = unsigned long long;
const ull MOD = 1e9+7;
vector<ull> giaiThua(ull n){
vector<ull> factori(n+1);
factori[0] = 1;
for (ull i = 1; i <= n; i++){
factori[i] = (factori[i-1] * i) % MOD;
}
return factori;
}
int main(){
... | ALGO | 0.999976 | 5.268188 |
4dfd169a-f76f-40ae-aea7-0460adc6286b | HaroldCC/CPPprimer5 | Chapter3/3.40.cpp | /*************************************************************************
> File Name : 3.40.cpp
> Author : Harold
> Mail : <EMAIL>
> Github : www.github.com/Haroldcc
> Created Time : 2020年05月18日 13时17分09秒
************************************************************************/
... | TOOL | 0.986979 | 3.504851 |
c2919056-65d9-4fb2-a143-78955c6d2a7a | Anuj-S62/Interview-Bit-Solutions | maximumSumComb.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
void disp(vector<int> arr){
for(int i:arr) cout<<i<<" ";
cout<<endl;
}
vector<int> solve(vector<int> &A, vector<int> &B, int C) {
sort(A.begin(),A.end());
sort(B.begin(),B.end());
priority_queue<pair<int ,pair<int,int>>> pq;
... | ALGO | 0.999977 | 3.455779 |
47fa3db1-e31e-494a-9a8c-300548acb253 | SimpleChance/hw5 | schedwork.cpp | #include <set>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
// add or remove necessary headers as you please
#include "schedwork.h"
using namespace std;
// a constant that can be used to indicate an INVALID
// worker ID if that is useful to your imple... | ALGO | 0.9979 | 5.451487 |
d15fea60-7574-4180-9f78-53772f506a4e | Cs-2410/sde-sheet-question | 654-maximum-binary-tree/654-maximum-binary-tree.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.99999 | 6.540565 |
d08004ef-bdce-4b65-bf03-1de0f975111d | proxmox/ceph | ceph/src/boost/libs/gil/example/hough_transform_circle.cpp | #include <boost/gil.hpp>
#include <boost/gil/extension/io/png.hpp>
#include <boost/gil/extension/rasterization/circle.hpp>
#include <iostream>
#include <limits>
#include <vector>
namespace gil = boost::gil;
// Demonstrates how to use a Hough transform to identify a circle
// Note this relies on the brute force appr... | TOOL | 0.985991 | 6.90143 |
5c30d806-74a6-432a-a6bd-911d760d9ba0 | looechao/leetcode-coding-notebook | 0-Intro/luogu/p2676.cpp | #include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int n,b;
int main()
{
int sum=0;
int p=0;
cin>>n>>b;
vector<int> num(n,0);
for(int i=0;i<num.size();i++)
{
cin>>num[i];
}
sort(num.be... | ALGO | 0.999975 | 3.506924 |
9b3874a6-b3f4-4365-973c-7a3fb9cc3232 | Ashish473797/Cpp-BootCamp | Assignment 54/1.cpp | // Create an ADT array without using STL.
#include<iostream>
using namespace std;
class Array
{
int size=0, capacity = 10;
int arr[10];
public:
void insert(int value)
{
if(size==capacity)
{
cout<<"Array is Full!\n";
}
else
arr[size++] = value;
... | ALGO | 0.995907 | 4.640205 |
ddcba3d3-ca7a-4101-9002-ad730d511867 | tmioton/2DRayCasting | src/app/Casters/Caster.cpp | #include "pch.hpp"
#include "Caster.hpp"
Point closestIntersection(const Ray &ray, std::vector<Point> intersections) {
const unsigned int numIntersections = intersections.size();
Point shortestPath = intersections[0];
for (unsigned int i = 1; i < numIntersections; i++) {
const Point &intersection ... | ALGO | 0.985678 | 6.201334 |
f7f179bd-4f4c-4f9d-b2b7-4e41dfec3baa | green-fox-academy/Jhona3 | week1/day5/sum-all/main.cpp | #include <iostream>
#include <string>
int main(int argc, char* args[]) {
// - Create an array variable named `ai`
// with the following content: `[3, 4, 5, 6, 7]`
// - Print the sum of the elements in `ai`
int ai[]{3,4,5,6,7};
int sum = ai[0];
int a;
for(int i = 1; i < sizeof(ai) / size... | TOOL | 0.880693 | 4.369221 |
b6922b82-dec2-4698-ab81-ee92cd56bc62 | Tiwari12abha/c-competitive-programming- | hackr.cpp | /*#include<iostream>
using namespace std;
int main(){
int a;
long b;
char c;
float d;
double e;
cin>>a>>b>>c>>d>>e;
cout<<a<<b<<c<<d<<e;
}*/
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
int a,b,i;
cin>>a>>b;
for(i=a;i<=b;i++){
switch(i)
... | ALGO | 0.998143 | 3.469923 |
e30f7d6d-3292-43c7-b0eb-276ebe7835d8 | githubcrce/Cpp-Programs | mathproblems/ncr.cpp | #include<iostream>
#include<math.h>
#include <bits/stdc++.h>
using namespace std;
int fact(int n){
if(n==1){
return 1;
}
return n*fact(n-1);
}
int nCr(int n,int r){
int n_fact = fact(n);
int n_minus_r_fact = fact(n-r);
int r_fact = fact(r);
return (n_fact)/(n_minus_r_fact*r_... | ALGO | 0.999547 | 5.439423 |
4c6f091f-865d-45ac-95ba-95fff741d186 | raincross7/code-similarity | codes/train_code/problem090/problem090_5.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
int l, c, len, m_len, m_cnt;
int cnt[500] = {};
string str, word[500];
while(cin >> str){
for(int i=0; i<500; i++){
if(word[i] == ""){
word[i] = str;
cnt[i] = 1;
break;
}
else if(word[i] == str)... | ALGO | 0.999923 | 3.080429 |
51cb82e0-012d-4861-89fb-47c3f767a044 | gbudiman/gpa4grp1 | GPA4/Cube.cpp | /*
* File: Cube.cpp
* Author: Wan Kuk
*
* Created on November 7, 2010, 5:29 PM
*/
#include "Cube.h"
#include <iostream>
#include <string.h>
using namespace std;
Cube::Cube() {
for (int i = 1; i < 10; i++) {
state[YELLOW][i] = 'Y';
state[RED][i] = 'R';
state[GREEN][i] = 'G';
... | ALGO | 0.985797 | 5.003729 |
4af61fe4-2440-4385-993b-e6ab8c6f86a5 | samyoahri/baekjoon_group_study | 2023/Feb_2023/week06/src/Tue_boj_24444/boj_24444_mcsoya.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#define ARR_MAX 100001
using namespace std;
vector<int> adj[ARR_MAX]; // 인접 리스트
int visited[ARR_MAX] = { 0 }; // 방문 여부
int result[ARR_MAX] = { 0 };
int cnt = 1; // 방문 순서
void BFS(int start, int N) {
visited[start] = 1;
result[start] = cnt... | ALGO | 0.999992 | 4.146434 |
0139d8cb-bd66-4325-ab82-a53ac84d83dc | Anikettt01/tle-eliminators-cp31 | 1000/6. Ski Resort/q6.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, k, q;
cin >> n >> k >> q;
vector<int> v(n);
long long total_count = 0; // Store the total valid subarrays count
for (int i = 0; i < n; i++) {
cin >> v[i];
... | ALGO | 0.999588 | 4.424293 |
44831c63-d3ef-4490-b2fd-2e591214352c | TM-DEV-PRO/DSA-CP | funtion-snippets/Kickstart/Round-G-20/wheels.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <iterator>
using namespace std;
int main()
{
ios_base::s... | ALGO | 0.999749 | 4.030273 |
4af9ce42-5384-4eee-b7c6-ede26daa851a | mrreda1/problem-solving | codeforces/Bookstp.cpp | #include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define make_unique(x) sort(all(x)), x.erase(unique(all(x)), x.end())
using namespace std;
template <typename T> T nxt();
template <typename T> class is_iterable {
public:
template <typename U>
static auto test(U... | ALGO | 0.99992 | 4.74209 |
50cd5867-3c5a-48bf-8c2d-cb39114f6c17 | Mulab11/cntt2016-hw1 | TC-SRM-569-div1-500/wyz.cpp | // BEGIN CUT HERE
// END CUT HERE
#line 5 "TheJediTest.cpp"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
class TheJediTest{
public:
int minimumSupervisors(vector <int> students, int K){
int last=0,ret=0;
for (int i=0;i<students.size();++i){
ret+=(students[i]+last)/K;
if ((students[i... | ALGO | 0.999755 | 4.325766 |
628713a0-1fbc-45a2-b0ac-374e53ec85b4 | mkite29/FJP2-DSA | Level 1/Linked List/Merge k Sorted Lists Brute Force.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
//vector of list... | ALGO | 0.999956 | 5.945596 |
8e2e8adf-cabb-499d-b1d1-a24a8b483890 | arnav-khandelwal/codeForcesQuestions | 112A.cpp | #include<bits/stdc++.h>
using namespace std;
#define Code ios_base::sync_with_stdio(false);
#define By cin.tie(NULL);
#define Asquare cout.tie(NULL);
int main() {
string s1, s2;
cin >> s1 >> s2;
for(int i = 0; i < s1.length(); i++){
if(tolower(s1[i]) > tolower(s2[i])){
cout << 1;
... | ALGO | 0.999994 | 3.372698 |
468fbe28-e435-4f53-a85f-7944614f86ef | TheGupta2012/Coding-Blocks | SegmentTrees/Theory/max_segment_tree_operations.cpp | #include<bits/stdc++.h>
#include<windows.h>
using namespace std;
void buildTree(int s,int e,int *arr,vector<long long int> &tree, int ind){
// base -> equal ranges
if(s==e){
tree[ind] = arr[s];
return;
}
// recurse
// build the left subtree
int mid = (s+e)/2;
buildTree(s,mid,... | ALGO | 0.999872 | 4.48492 |
4b60e032-b151-44ec-b66f-c5d452362024 | lychees/ACM-Training | Note/集训队作业/2014/作业1/试题泛做/dhh1995/MyCode/icpc2009/K.cpp | #include<cstdio>
#include<string>
#include<map>
#include<algorithm>
#include<iostream>
using namespace std;
#define rep(i,n) for (int i=0;i<n;++i)
typedef long long ll;
const ll N=205,inf=1LL<<55;
string s[N],a[25][N],*A;
int Case,L,m,T,n[25]; ll d[25][N][N];
void add(string s){int L=s.size(); rep(i,L) a[L-i][n[L-i]++]... | ALGO | 0.999921 | 3.425626 |
497045cc-35db-43c9-ab06-725c7c967599 | shareone2/LuoGuOj | 1318积水面积.cpp | /*************************************************************************
> File Name: 1318积水面积.cpp
> Author:
> Mail:
> Created Time: 2019年08月16日 星期五 10时20分02秒
************************************************************************/
#include <iostream>
using namespace std;
int n, num[10005], sum = 0, flog = 1... | ALGO | 0.999994 | 4.366287 |
4cdf1aba-19b5-4b64-881c-61d541273a84 | CodeGhostX/CrackYourPlacement | Tree/Binary tree zigzag level order traversal.cpp | class Solution {
public:
vector<vector<int>> zigzagLevelOrder(TreeNode* root) {
if(!root) return {};
int idx = 1;
queue<TreeNode*> q;
q.push(root);
vector<vector<int>> ans;
while(!q.empty()){
int n = q.size();
vector<int> arr;
for(i... | ALGO | 0.999994 | 6.078895 |
6fa4a31f-b1dd-488a-9d1d-a58c3819eb17 | jfemon8/XPSC | Week-7/Day-5/D_Rudolf_and_the_Ball_Game.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--)
{
int n, m, x;
cin >> n >> m >> x;
vector<bool> dp(n, false);
x--;
dp[x] = true;
for (in... | ALGO | 0.999979 | 4.120471 |
76a688bf-ae91-4589-bbe5-39a481331c3c | ishandutta2007/codeforces | wzyeustia/normal/1511/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tuple<ll, ll, ll> tll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i, a, b) for (ll (i) = (a); (i) <= (b); (i)++)
#define ROF(i, a, b) for (ll (i) =... | ALGO | 0.999814 | 4.136142 |
952629b1-57e1-4e07-98b3-5926de540d74 | meet-talaviya/Placment | code/Heap/3/MergeKSortedArray.cpp | #include<bits/stdc++.h>
using namespace std;
class info{
public:
int data;
int row;
int col;
info(int val, int r , int c){
data = val;
row = r;
col = c;
}
};
class compare{
public:
bool operator()(info* a, info* b){
return a->data > b->data;
}
};
v... | ALGO | 0.999893 | 4.262432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.