uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
04fac3bd-b40a-4c03-aed1-ca4e9782378b | PKU-GeekGame/geekgame-4th | players_writeup/61/algo-complexity/spfa.cpp | /* https://codeforces.com/blog/entry/3730 */
#include <bits/stdc++.h>
int N = 2000;
std::vector<std::tuple<int, int, int>> edges;
int main() {
const int W = 100000000;
for (int i = 2; i <= N; ++i)
edges.emplace_back(1, i, W / (i + 1));
for (int i = 2; i < N; ++i)
edges.emplace_back(i, i + 1, 1);
std::cout << ... | ALGO | 0.985661 | 3.475904 |
3a413fd6-9736-479f-81e8-91d6b02a2f42 | Bharatkgupta/leetcode-bkg | 2530-maximal-score-after-applying-k-operations/2530-maximal-score-after-applying-k-operations.cpp | class Solution {
public:
long long maxKelements(vector<int>& nums, int k) {
priority_queue<int> pq(nums.begin(), nums.end());
long long ans = 0;
while(k--) {
double largest = pq.top();
pq.pop();
ans += largest;
pq.push(ceil(largest/3));
... | ALGO | 0.999957 | 5.141581 |
a80f775d-e315-4d3d-b359-06bfe6242d69 | KaiYanagisawa/college_2022_c- | week5/ex05-2-main.cpp | #include <iostream>
#include <queue>
#include <string>
int main()
{
std::string s{};
// queueの初期化
std::queue<std::string> q, q_sub;
// 5回の入力を実行
for (int i = 0; i < 5; i++)
{
// cin で値を入力する
std::cout << "Input: ";
std::cin >> s;
// queue へ格納
if (q.empty... | ALGO | 0.99743 | 5.542233 |
cf58d008-0ef1-4d75-abef-aaf911ec90b4 | SarthakKeshari/CPP-Questions-and-Solutions | CodeForces/Non_Decreasing_Dilemma.cpp | /*Alice has recently received an array a1,a2,…,an for her birthday! She is very proud of her array, and when she showed her friend Bob the array, he was very happy with her present too!
However, soon Bob became curious, and as any sane friend would do, asked Alice to perform q operations of two types on her array:
1... | ALGO | 0.999602 | 4.438288 |
53d0caf9-174a-46f3-8c49-6ddb3e7b2cad | Praveenkumar07007/DSA | pattern printing/invertedpyramid.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=0; i<n; i++) {
for(int j=0; j<i;j++) {
cout<<" ";
}
for(int k=0; k<(2*n-(2*i+1)); k++) {
cout<<"*";
}
for(int j=0; j<i;j++) {
cout<<" ";
}
cout... | ALGO | 0.999885 | 3.31496 |
295b12c8-5d32-460e-95b1-c9626b715cfb | pranshu771/coding-questions | algos/dynamic-programming/basic/problem90.cpp | #include<bits/stdc++.h>
using namespace std;
int solve(int n,int m) {
if(n==0) {
return 1;
}
if(n<0) {
return 0;
}
return solve(n - 1, m) + solve(n - m, m);
}
int main() {
int t;
cin >> t;
while(t--) {
int n;
cin >> n;
int m;
cin >> m;
... | ALGO | 0.999967 | 4.971702 |
6bdb7849-fde1-458b-b286-6b7db7556510 | glerium/acm-life | codeforces/2073/J.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define rep(i,x,y) for(int i=x;i<=y;i++)
using namespace std;
typedef long long ll;
constexpr int maxn = 2e5+10;
constexpr ll mod = 998244353;
void solve() {
int n; cin >> n;
int a[n+5] = {};
rep(i,1,n) cin >> a[i];
struct SpItem {
int lx,ly,rx,ry;
... | ALGO | 0.999807 | 5.276615 |
91f4fc3a-3cb6-448d-a3f4-3a14c7aa90df | saarang123/Competitive-Programming | codeforces/1370F2.cpp | #include <bits/stdc++.h>
using namespace std;
const int mxn = 1003;
vector<int> g[mxn], depth[mxn];
int dt[mxn], dmx[mxn], n;
array<int, 2> ask(vector<int> &q) {
cout << "? " << q.size() << ' ';
for(int x : q)
cout << x << ' ';
cout << endl;
int v, d;
cin >> v >> d;
return {v, d};
}
void dfs(int v, int p = -1... | ALGO | 0.999322 | 4.858059 |
513dcaf7-880a-4eaf-881b-0a2a2df6f25e | shreya593/Binary-tree | posttraversals.cpp | #include <iostream>
using namespace std;
struct node{
int data;
struct node *left;
struct node *right;
};
struct node *newnode(int data){
struct node *nnewnode = new node;
nnewnode->data = data;
nnewnode->left = NULL;
nnewnode->right = NULL;
return nnewnode;
}
struct node *insert(struct node *root... | ALGO | 0.999953 | 4.430953 |
5d7b01e1-d5eb-4d87-b83a-5893755f02fa | samiulislam22/CSE_4302 | task_220041207.cpp | #include <bits/stdc++.h>
using namespace std ;
int main()
{
double a , b, c , d ;
char dummychar ;
cout << "enter the first fraction: ";
cin >> a >> dummychar >> b ;
cout <<endl << "enter the next fraction: ";
cin >> c >> dummychar >> d ;
auto result = [](double a , double b , double... | ALGO | 0.992292 | 4.197588 |
b2635622-1ab6-4b1c-a3f7-19efcd815a7c | miemie2013/ncnn_ppyolov2 | src/layer/innerproduct.cpp | #include "innerproduct.h"
#include "layer_type.h"
#include "fused_activation.h"
namespace ncnn {
InnerProduct::InnerProduct()
{
one_blob_only = true;
support_inplace = false;
}
int InnerProduct::load_param(const ParamDict& pd)
{
num_output = pd.get(0, 0);
bias_term = pd.get(1, 0);
weight_data_s... | DATA | 0.918286 | 6.658662 |
82794753-d374-4ff2-99c7-a01026904d4a | Dustin-Wang/Cplusplus_programming-study | typed codes/Maximum Width of Binary Tree.cpp | include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <vector>
#include <random>
#include <set>
#include <stack>
#include <vector>
#include <cstdio>
#include <cmath>
#include <list>
#include <cctype>
#include <typeinf... | ALGO | 0.999672 | 5.282546 |
117e8b3e-8a47-4750-b739-9373098f27df | jingtianhua/LeetCode | 第3章 玩转双指针/680.验证回文字符串-ⅱ.cpp | /*
* @lc app=leetcode.cn id=680 lang=cpp
*
* [680] 验证回文字符串 Ⅱ
*/
// @lc code=start
class Solution {
public:
bool validPalindrome(string s) {
int head = 0, rear = s.size() - 1;
//第一次从两边遍历,如果遇到不匹配回文,记录
while (head < rear) {
if (s.at(head) != s.at(rear)) {
return... | ALGO | 0.999899 | 6.193804 |
a85e99c5-3be2-4f92-9ffb-3eae4df3e59b | sir-rasel/Online_Judge_Problem_Solve | Codeforces/codeforces_977E.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 200 * 1000 + 11;
int n, m;
int deg[N];
bool used[N];
vector<int> comp;
vector<int> g[N];
void dfs(int v) {
used[v] = true;
comp.push_back(v);
for (auto to : g[v])
if (!used[to])
dfs(to);
}
int main() {
scanf("%d %d", &n, &m);
for (int i = 0; i <... | ALGO | 0.999775 | 4.869387 |
c82872af-307b-46c2-9825-c600a9274859 | AllenLin3/2023aaib3 | week18/week18-3.cpp | class Solution {
public:
string addBinary(string a, string b) {
int carry= 0;
int i = a.length()-1, j=b.length()-1;
vector<int>ans;
while(i>=0 ||j>=0){
if(j<0){
int now=a[i]-'0'+carry;
ans.push_back(now%2);
carry = now/2;
... | ALGO | 0.999931 | 6.317533 |
be5b9509-013a-4e63-9dcc-8bb625e55bcd | duduita/leetcode | facebook/productExceptSelf.cpp | vector<int> productExceptSelf(vector<int> &nums)
{
int n = nums.size();
vector<int> res(n);
res[0] = 1;
for (int i = 1; i < n; i++)
res[i] = res[i - 1] * nums[i - 1];
int R = 1;
for (int i = n - 1; i >= 0; i--)
{
res[i] = res[i] * R;
R *= nums[i];
}
return ... | ALGO | 0.999979 | 5.510583 |
c817cbaa-3135-4d09-8e7a-4182e18dd858 | Rai-Sama/Codeforces | Practice/29.cpp | #include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
const int MAX_N = 1e5 + 1;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
void solve() {
ll n, temp, prev, max = 1, cnt = 1;
cin>>n;
for(int i = 0; i < n; i ++){
cin>>temp;
if(i != 0){
if(temp >= prev){
... | ALGO | 0.999962 | 4.75084 |
3fba1863-caf6-40e9-bea6-c4781dbf5668 | arclab-hku/ESVIO | dependences/opengv-master/src/point_cloud/methods.cpp | #include <opengv/point_cloud/methods.hpp>
#include <opengv/Indices.hpp>
#include <Eigen/NonLinearOptimization>
#include <Eigen/NumericalDiff>
#include <opengv/OptimizationFunctor.hpp>
#include <opengv/math/arun.hpp>
#include <opengv/math/cayley.hpp>
namespace opengv
{
namespace point_cloud
{
transformation_t threep... | ALGO | 0.999681 | 5.03543 |
7ab34f10-c040-45ae-abc8-f036047d2113 | ishandutta2007/codeforces | amnesiac_dusk/normal/792/D.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
#ifndef rd
#define endl '\n'
#endif
#ifdef rd
#def... | ALGO | 0.999883 | 4.777118 |
492acfee-b18b-4123-ba13-93d3f1dd3e26 | pingjuiliao/softbound | llvm-project-13.0.0.src/mlir/lib/IR/Dominance.cpp | #include "mlir/IR/Dominance.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/RegionKindInterface.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/GenericDomTreeConstruction.h"
using namespace mlir;
using namespace mlir::detail;
template class llvm::DominatorTreeBase<Block, /*IsPostDom=*/false>;
template cl... | ALGO | 0.982255 | 7.281507 |
aa0d1ac4-89fc-489f-9f78-88ca51dc3549 | Aakash-mishra2/DSA-basic-prep | arrays-lvl1/revn-1/string-window.cpp | #include <bits/stdc++.h>
using namespace std;
string stringWindow(string big, string small)
{
}
int main()
{
string big, small;
cin >> big >> small;
cout << stringWindow(big, small);
return 0;
} | ALGO | 0.999686 | 3.289451 |
e45e00b0-8236-4f67-9329-28bb516d882c | thexa4/source-pbr | mp/src/utils/vbsp/disp_vbsp.cpp | #include "disp_vbsp.h"
#include "tier0/dbg.h"
#include "vbsp.h"
#include "mstristrip.h"
#include "writebsp.h"
#include "pacifier.h"
#include "disp_ivp.h"
#include "builddisp.h"
#include "mathlib/vector.h"
// map displacement info -- runs parallel to the dispinfos struct
int nummapdispinfo = 0;
mapdispinfo... | ALGO | 0.938379 | 5.58144 |
1700b8eb-03df-4730-889b-ae50d87b7bc9 | Manisha152/GFG23 | sliding_window_and_two_pointer/medium_problem/4m.cpp | ERROR: type should be string, got "\n\nhttps://practice.geeksforgeeks.org/problems/longest-repeating-character-replacement/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=longest-repeating-character-replacement\n\nclass Solution {\n public:\n int characterReplacement(string s, int k) {\n /*\n \n int res=0,maxfreq=0;\n int n=s.size();\n \n for(int i=0;i<n;i++){\n unordered_map<char,int>mp;\n \n for(int j=i;j<n;){\n \n mp[s[j++]]++;\n maxfreq=max(maxfreq,mp[s[j-1]]);\n while(j-i-maxfreq>k)\n {\n mp[s[i++]]--;\n \n }\n \n res=max(res,j-i);\n \n }\n }\n \n return res;*/\n\n vector<int>v(26,0);\n int n=s.size();\n int start=0;\n int end=0;\n int maxfreq=0;\n int maxlen=0;\n \n while(end<n){\n v[s[end++]-'A']++;\n \n maxfreq=max(maxfreq,v[s[end-1]-'A']);\n\n while(end-start-maxfreq>k){\n v[s[start++]-'A']--;\n maxfreq=* max_element(v.begin(),v.end());\n }\n\n maxlen=max(maxlen,end-start);\n }\n\n return maxlen;\n\n }\n};" | ALGO | 0.999865 | 5.779605 |
1fe48550-801f-429f-9f16-49cde3d87c4c | Rprop/wke-extend | wke/Source/WebCore/svg/SVGPathParser.cpp | #include "config.h"
#if ENABLE(SVG)
#include "SVGPathParser.h"
#include "AffineTransform.h"
#include <wtf/MathExtras.h>
static const float gOneOverThree = 1 / 3.f;
namespace WebCore {
SVGPathParser::SVGPathParser()
: m_consumer(0)
{
}
void SVGPathParser::parseClosePathSegment()
{
// Reset m_currentPoint f... | TOOL | 0.9401 | 6.575725 |
77564ad6-ac2b-4a4d-9410-2635b438b2a2 | a962702/CPE-Problem-Solution | UVA10137 - The Trip/main.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main(){
int n;
while(cin >> n && n){
double money[1000], avg = 0, ans1 = 0, ans2 = 0;
for(int i = 0; i < n; i++){
cin >> money[i];
avg += money[i];
}
avg = (double)((int)(avg * 100 / n + 0.5)) / 100;
for(int i = 0; i < n; i++)
if(mone... | ALGO | 0.989299 | 3.662233 |
6314b698-feb8-4a91-95be-837b34c3caf7 | duylonggg/DSA-CodePTIT | Dynamic Programming/DSA05016.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio() ios::sync_with_stdio(false); cin.tie(nullptr);
#define MOD 1000000007
long long findUglyNumber(int N) {
vector<long long> dp(N);
dp[0] = 1;
int i2 = 0, i3 = 0, i5 = 0;
long long next2 = 2, next3 = 3, next5 = 5;
for (int i = 1; i < N... | ALGO | 0.999968 | 5.604886 |
96dfe621-b9a0-4dd1-b990-0437a2ef6be8 | pingchungchang/CP | CF1461B.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 tlll tuple<ll,ll,ll>
const int mxn = 550;
string arr[mxn];
int pref[mxn][mxn];
int n,m;
void solve(){
for(int i= 0;i<=n+1;i++){
for(int j = 0;j<=m+1;j++)p... | ALGO | 0.999069 | 3.53979 |
8cf588d9-63f6-4603-b4fc-f075f8bbc0dd | RashakDude/codeforces | CPP solutions/750A.cpp | #include <iostream>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
while(240-k < (n*(n+1)*5)/2 )
n--;
cout << n;
} | ALGO | 0.999592 | 3.036066 |
fbbfa766-4c4c-4e58-a05d-71769b6d5f81 | itsnotkatya/OMP-Randomize | fib.cpp | //#include "fib.h"
//
//unsigned Fibonacci(unsigned n){
// if (n <= 2)
// return 1;
// return Fibonacci(n-1) + Fibonacci(n-2);
//}
//
//unsigned Fibonacci_omp(unsigned n){
// if (n <= 2)
// return 1;
// unsigned x1, x2;
//#pragma omp task
// {
// x1 = Fibonacci_omp(n-1);
// };
//#... | ALGO | 0.999774 | 4.529522 |
5d3828c9-229a-42cf-be58-73f794cdb815 | BartlomiejStepek/CPP | Polynomial/Polynomial.cpp | /*** Bartlomiej Stepek ***/
#include "Z2.h"
#include "Polynomial.h"
Polynomial::Polynomial() {
degree = 0, array_of_coefficients = new Z2[1];
array_of_coefficients[0] = 0;
}
Polynomial::Polynomial(unsigned int _degree, Z2* array)
: degree(_degree) {
while(array[degree].number == 0 && degree>0)
... | ALGO | 0.871543 | 3.744007 |
8baf03d7-ef65-4963-a811-47b1630fd705 | rlatkdgus2627/Military_PS | 2243.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n;
int segtree[4000001];
int getKth(int node, int s, int e, int k){
if(s == e) return s;
int mid = (s + e)/2;
if(k <= segtree[node * 2]) return getKth(node * 2, s, mid, k);
else return getKth(node * 2 + 1, mid + 1, e, k - segtree[node * 2]... | ALGO | 0.998985 | 4.195519 |
478fe6d7-8622-42b3-a280-cbaa4f74b00d | hngdiep/-n-t-p-cod | 16tongday.cpp | #include<stdio.h>
int main(){
int n; scanf("%d", &n);
int s=0;
for(int i=1; i<=n; i++){
s+=i;
}
printf("%d", s);
return 0;
}
| ALGO | 0.999777 | 3.721435 |
ea6d3991-7540-42af-a479-52a690adc756 | VMyalo/OAIP-1kurs | sem2/lab 4 - queue/lab 4 - queue/queue.cpp | #include <iostream>
using namespace std;
class DLS
{
private:
struct Cell
{
int value;
Cell* next;
Cell* prev;
};
Cell* begin = nullptr;
Cell* end = nullptr;
void add(int item, int option)
{
if (begin == nullptr && end == nullptr)
{
Cell* c = new Cell;
c->value = item;
c->next = c->prev = n... | ALGO | 0.991414 | 3.526819 |
e276a38e-252c-4611-bfc7-f915f47c8f54 | carlsonaaron/Ender3Firmware | Marlin/src/lcd/menu/game/snake.cpp | #include "../../../inc/MarlinConfigPre.h"
#if ENABLED(MARLIN_SNAKE)
#include "game.h"
#define SNAKE_BOX 4
#define HEADER_H (MENU_FONT_ASCENT - 2)
#define SNAKE_WH (SNAKE_BOX + 1)
#define IDEAL_L 2
#define IDEAL_R (LCD_PIXEL_WIDTH - 1 - 2)
#define IDEAL_T (HEADER_H + 2)
#define IDEAL_B (LCD_PIXEL_HEIGHT -... | TOOL | 0.917056 | 6.458833 |
c92e02fc-2931-438a-9675-4ec59ff4258f | aadityab7/Practice | 368. Largest Divisible Subset.cpp | class Solution {
public:
vector<int> largestDivisibleSubset(vector<int>& nums) {
sort(nums.begin(), nums.end());
unordered_map<int, vector<int>> mp;
for(int i : nums) mp[i].push_back(i);
int n = nums.size();
for(int i = 0; i < n - 1; i++){
for(int j = i + 1; j... | ALGO | 0.999983 | 5.173901 |
51a0d13c-6c1f-46ee-8ba8-55af77311e11 | Niltiwari7/Topic-wise-question-for-Interview | Stack/Easy/2696. Minimum String Length After Removing Substrings.cpp | class Solution {
public:
int minLength(string s) {
if (s.size() == 0)
return 0;
stack<char> st;
for (int i = 0; i < s.size(); i++) {
if (!st.empty() && st.top() == 'A' && s[i] == 'B') {
st.pop();
} else if (!st.empty() && st.top() == 'C' &&... | ALGO | 0.999754 | 6.014641 |
41da66a2-12f0-48be-a177-2682325e31fc | vedsharma8877/DSA-A2Z | Step_2/Lec_2/MergeSort.cpp | #include <bits/stdc++.h>
using namespace std;
void merge(vector<int> &arr, int low, int mid, int high) {
vector<int> temp;
int left = low;
int right = mid + 1;
while(low <= mid && right <= high) {
if(arr[left] <= arr[right]) {
temp.push_back(arr[left]);
left++;
}... | ALGO | 0.999993 | 5.628214 |
44240ab8-448d-4098-8e34-4be3b92391fd | Md-Noman-Biswas/Codeforces_problems | B_Two_Large_Bags.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define nl "\n"
#define YES cout << "Yes\n"
#define NO cout << "No\n"
#define pb push_back
#define llmx LONG_LONG_MAX
#define llmn LONG_LONG_MIN
#define mod 1000000007
const int N = 1e5 + 7;
const int INF = 1e9 + 10;
void solve(){
ll n;
cin >> n... | ALGO | 0.999909 | 4.623497 |
888efc97-fcb3-463b-90ba-6ee66e014cc4 | Help3D-Padova/Marlin-2.0.9.2-ARTILLERY-X2-GENIUS-PRO | buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
// Pin number
const PinName digitalPin[] = {
PA_0, //D0
PA_1, //D1
PA_2, //D2
PA_3, //D3
PA_4, //D4
PA_5, //D5
PA_6, //D6
PA_7, //D7
PA_8, //D8
PA_9, //D9
PA_10, //D10
PA_11, //D11
PA_12, //D12
PA_13, //D13
PA_14,... | CONFIG | 0.914598 | 3.876639 |
3ea7f7cc-b2c9-4f5d-a359-dd43e345afa2 | hjm113/Algorithm | 프로그래머스/lv3/43238. 입국심사/입국심사.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
long long num = 0;
vector<int> ins;
int solve(long long n) {
long long sum = 0;
for(int i = 0; i < ins.size(); i++) {
sum += (n/ins[i]);
}
if(sum >= num) {
return 1;
}
else {
return 0;
}
}
l... | ALGO | 0.999877 | 4.795549 |
04921f6b-ec2d-4665-9fb7-fe7fdead8aea | tejashreegaikwad20/LP-5 | bfs1.cpp | #include<iostream>
#include<stdlib.h>
#include<queue>
using namespace std;
class node
{
public:
node *left, *right;
int data;
};
class Breadthfs
{
public:
node *insert(node *, int);
void bfs(node *);
};
node *insert(node *root, int data)
// inserts a node in tree
{
if(!root)
{
root=new node;
root->left=NULL;
root->righ... | ALGO | 0.999682 | 3.729167 |
aec0d068-79a3-4a0e-b2b4-0c81755644c0 | eriktai/gem5-Orca | src/systemc/tests/systemc/misc/user_guide/chpt11.3/mean.cpp | /*****************************************************************************
mean.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.99899 | 4.530694 |
916995b4-394e-4608-8c8b-81bc9860e339 | eunjuyummy/Baekjoon | 듣보잡(1764).cpp | #include <iostream>
#include <set>
#include <vector>
#include<algorithm>
using namespace std;
int main()
{
int N, M;
cin >> N >> M;
string name;
int j = 0;
set<string> name_list;
vector<string> answer;
int count = 0;
for(int i = 0; i < N; i++)
{
cin >> name;
name_list.insert(name);
}
for(int... | ALGO | 0.999963 | 3.791476 |
32928eaa-bbcf-4b1d-a8af-7288d42ad18d | wuyuhang05/My-OI-Code | Luogu/P4460.cpp | #include <algorithm>
#include <iostream>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <cstdio>
#include <bitset>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <map>
#include <set>
#define fi first
#define se second
#define U unsigned
#define P std::... | ALGO | 0.999959 | 3.652984 |
50a2a7bd-8b26-47c3-8c0c-4c95c9f4a355 | Sylar009/Scaler-Academy-Modules | Introduction to Problem Solving (Intermediate) 2/Intermediate DSA - Recursion - 2/Homework/Q3. Kth Symbol - Hard.cpp | /*
Problem Description
On the first row, we write a 0. Now in every subsequent row, we look at the previous row and replace each occurrence of 0 with 01, and each occurrence of 1 with 10.
Given row number A and index B, return the Bth indexed symbol in row A. (The values of B are 0-indexed.).
Problem Constraints
1 <=... | ALGO | 0.999973 | 4.697937 |
e6fde3d3-8480-4887-8154-3f3a6b1e8708 | sushaoxiang911/NPApproximation | Untitled Folder/cover.cpp | #include <stdlib.h>
#include <iostream>
#include<vector>
#include<fstream>
#include<sstream>
#include<algorithm>
#include<climits>
#include<math.h>
#include<ctime>
using namespace std;
class MainData
{
public:
int antennanum;
int stationnum;
vector <vector<int> > antenna;
vector <vector<int> > station;
//vecto... | ALGO | 0.998305 | 3.557972 |
e1325430-93ea-4f5d-9bb9-428e6c451e26 | Muzain187/level3 | binary_tree/assignments/zigzag.cpp | /**********************************************************
Following is the Binary Tree Node class structure
template <typename T>
class BinaryTreeNode {
public :
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data) {
this -> data = data;
le... | ALGO | 0.999996 | 5.349009 |
35bf14ff-9585-456a-a738-e61980891895 | tatajack/coding_interview_practices | templates/tree/inorder.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.999965 | 6.642688 |
8ad0d607-5f58-4da0-a4d3-fc8613a4e33c | andongfan/oicode | 4286.cpp | #include<iostream>
#include<iomanip>
#include<cstring>
#include<cmath>
#include<cstdio>
using namespace std;
int n,m,k,low[10005]={0},high[10005]={0},up[10005]={0},down[10005]={0},dp[10005][1005]={0},sum[10005]={0},ans=0x3f3f3f3f;;
int main()
{
scanf("%d%d%d",&n,&m,&k);
for(int i=0;i<n;i++)
{
scanf("%d%d",up+i,dow... | ALGO | 0.999962 | 3.390149 |
75d50e3c-0212-45f6-b38d-236d3be86783 | Alpha-Mintamir/leetcode | 172-factorial-trailing-zeroes/factorial-trailing-zeroes.cpp | class Solution {
public:
int trailingZeroes(int n) {
int result = 0;
while (n >= 5) {
n /= 5;
result += n;
}
return result;
}
};
| ALGO | 0.999871 | 6.596769 |
3b59bdfb-850e-476d-bced-b39d660dc7f2 | Rahul-Palahwat/LeetCode_Problems | 0721-accounts-merge/0721-accounts-merge.cpp | class DisjointSet{
private:
vector<int> parent , size;
public:
DisjointSet(int n){
parent.resize(n+1);
size.resize(n+1 , 1);
for(int i=0;i<=n;i++){
parent[i] = i;
}
}
int findParent(int node){
if(node == parent[node]){
return node;
... | ALGO | 0.999981 | 6.205706 |
2a32e262-4d93-4f79-a46f-ee47f2089a05 | CaioCity/IFCE---Maratona-SBC-2024 | Semana_7/F_LeetCode_Flood_Fill.cpp | // https://leetcode.com/problems/flood-fill/
// Flood Fill
class Solution {
public:
vector<vector<int>> floodFill(vector<vector<int>>& image, int sr, int sc, int color) {
//bfs
int m=image.size(),n=image[0].size(),i,j;
int inicial=image[sr][sc];
queue<pair<int,int>> casas;
... | ALGO | 0.998941 | 6.249844 |
a2995de7-05f0-4818-a5af-89dcdc55e76b | inzrv/Triangulation | libs/CGAL-5.6/examples/BGL_polyhedron_3/polyhedron_partition.cpp | #include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/boost/graph/partition.h>
#include <fstream>
#include <iostream>
int main(int argc, char** argv)
{
typedef CGAL::Simple_cartesian<double> K;
std::ifstream in((argc>1) ? argv[1] : CGAL::data_file_path("mesh... | ALGO | 0.958121 | 6.002029 |
19036d70-75b9-47d8-890c-0a846b0f927b | rem1xed/lab_diskret_01 | diskret_lab_1/Source.cpp | #include <iostream>
#include <vector>
using namespace std;
void printS(bool S[], int size)
{
for (int i = 0; i < size; i++)
{
if (S[i])
cout << "T";
else
cout << "F";
cout << endl;
}
}
void printS(bool S[], bool S1[], bool S2[], int size)
{
for (int i = 0; i < size; i++)
{
if (S[i])
cout << "T\t... | ALGO | 0.998792 | 4.124133 |
20f62c9d-559e-447a-bb94-70e7c199f988 | AlAmin-Kabir/Numerical_Analysis | Numerical Analysis/Forword defference Table.cpp | #include<bits/stdc++.h>
using namespace std;
void print(vector<vector<double>>&table,int n,vector<double>&X)
{
for(int i =0;i<n;i++)
{
cout<<X[i];
for(int j=0;j<n-i;j++)
{
cout<<"\t"<<table[i][j];
}
cout<<endl;
}
}
void forDiffTable(vector<vector<double>>&... | ALGO | 0.999615 | 3.646116 |
da564ef6-6427-4ba4-b410-f63b4c06927b | mikihiroikura/RATE | haste_ros/haste/thirdparty/eigen/doc/examples/Tutorial_BlockOperations_block_assignment.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
Array22f m;
m << 1,2,
3,4;
Array44f a = Array44f::Constant(0.6);
cout << "Here is the array a:" << endl << a << endl << endl;
a.block<2,2>(1,1) = m;
cout << "Here is now a with m copied into its cent... | ALGO | 0.982973 | 3.290376 |
5ab3a33d-21fe-4dcf-8879-bb5ff2cf591b | auca-algorithm-languages-spring-2023/personal-git-repo-eldiiar-b-auca-2021 | lab-07/Problem4.cpp | #include <bits/stdc++.h>
template <typename C>
int sz(const C &c) { return static_cast<int>(c.size()); }
using namespace std;
int main()
{
int N;
cin >> N;
for (int testCases = 1; testCases <= N; testCases++)
{
map<int, set<int>> collectorOfInitData;
map<int, int> collectorOfEquivalen... | ALGO | 0.98869 | 4.11873 |
293ce1cc-8a52-4fcc-9319-12b188e0dc34 | gauthamip/MissionRnD-C-LinkedLists2-Worksheet | src/reverseLinkedList.cpp | /*
OVERVIEW: Given a single linked list, reverse the linked list.
E.g.: 1->2->3->4->5, output is 5->4->3->2->1.
INPUTS: A linked list.
OUTPUT: Reverse the linked list.
ERROR CASES: Return NULL for error cases.
NOTES:
*/
#include <stdio.h>
#include<malloc.h>
struct node {
int num;
struct node *next;
};
struct nod... | ALGO | 0.999166 | 4.55026 |
0f9ee82c-d5c8-4538-b09c-138896a8f1b2 | Arjun31415/DSA_templates | Graphs/DFS-BFS_spanning_trees.cpp |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(a) a.begin(), a.end()
#define REP(i, a, b) for (ll i = a; i < b; i++)
#define REPI(i, a, b) for (ll i = b - 1; i >= a; i--)
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define lc(x) (x... | ALGO | 0.999986 | 5.073445 |
34c53909-2ec6-4eae-b12a-9751e738d051 | HimanshuDS14/String-Questions | String Intermediate/Longest Common Subsequence/main.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
int lcs(string s1 , string s2 , int m , int n)
{
int l[m+1][n+1];
for(int i=0;i<=m;i++)
{
for(int j=0;j<=n;j++)
{
if(i == 0 || j== 0)
l[i][j] = 0;
else if(s1[i-1] == s2[j-1])
... | ALGO | 0.999968 | 5.019943 |
48010a02-0b36-429e-a1a1-20baa0a4927c | AnjaliNanaware/LP | BestFit.cpp |
#include <iostream>
#include <vector>
using namespace std;
int main() {
int num_blocks, num_files;
cout << "Enter the number of blocks: ";
cin >> num_blocks;
cout << "Enter the number of files: ";
cin >> num_files;
vector<int> block_sizes(num_blocks);
vector<int> file_sizes(num_files);... | ALGO | 0.998779 | 4.479369 |
219014c8-c4ff-4836-bddb-06d4d6d44a94 | UIT-AnhTu-0325/sync-repo | leetcode/_done/y2024/7-2024/is-subsequence/main.cpp | #include <algorithm>
#include <bitset>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
class Solution {
public:
bool isSubsequence(string s, string t) {
int fir = 0, sec = 0;
while (fir < s.... | ALGO | 0.999805 | 5.716777 |
f76a82a3-0c54-455a-b7c3-f9fd4460d6f4 | raincross7/code-similarity | codes/train_code/problem435/problem435_239.cpp | //Code by Mukul Totla
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,i;
cin>>n;
int arr[n];
for(i=0; i<n; i++)
cin>>arr[i];
int k=1;
int flag=0;
int cnt=0;
for(i=0; i<n; i++)
{... | ALGO | 0.999933 | 3.511611 |
f68f79e7-b70c-4cc4-bb89-d713c15a8638 | cuicuijiamin/-1.1 | 树/abc287-Karuta.cpp | // https://atcoder.jp/contests/abc287/tasks/abc287_e
//补题:树
#include <bits/stdc++.h>
using namespace std;
const int N=5e5+10;
int son[N][26],cnt[N],idx;
string s[N];
void insert(string str)
{
int cur = 0;
for (int i = 0; i<str.size(); i ++ )
{
int u = str[i] - 'a';
if (!son[cur][u]) son[cur][u] = ++ idx;//idx是... | ALGO | 0.999973 | 4.864249 |
152b219b-7993-4fcc-9e7c-c6a0b5dd842f | Do-then-quit/algo | legacy/BJ_11650/BJ_11650/main.cpp | //
// main.cpp
// BJ_11650
//
// Created by LeeMinkyo on 2020/12/27.
//
#include <iostream>
#include <algorithm>
using namespace std;
struct dot {
int x;
int y;
};
bool cmp(dot a, dot b) {
if (a.x < b.x) {
return true;
}
else if (a.x == b.x) {
return a.y < b.y;
}
else {... | ALGO | 0.99991 | 5.037203 |
009b61f9-b0a9-41df-ad19-a6e690ea637c | Ravikisha/CodeArchive | GeeksForGeeks/ExitPointInAMatrix.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
vector<int> FindExitPoint(int n, int m, vector<vector<int>> &matrix)
{
int i = 0, j = 0, previ = 0, prevj = 0, face = 0;
while (i < n and i >= 0 and j < m and j >= 0)
{
... | ALGO | 0.999975 | 5.725651 |
e9847f45-834f-4a68-95b5-169b1efaef9f | ghostbsd/ghostbsd-src | contrib/llvm-project/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp | #include "llvm/Transforms/Scalar/LoopInstSimplify.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/LoopInfo.h"
#include ... | ALGO | 0.988338 | 4.593301 |
143f7db1-3f7d-46f9-aae2-e80dc8fe9a7a | jaumet/PdV | OF/pdv/src/ofxTween/src/Easings/ofxEasingQuint.cpp | #include "ofxEasingQuint.h"
float ofxEasingQuint::easeIn (float t,float b , float c, float d) {
return c*(t/=d)*t*t*t*t + b;
}
float ofxEasingQuint::easeOut(float t,float b , float c, float d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
}
float ofxEasingQuint::easeInOut(float t,float b , float c, float d) {
if ((t/=d/... | ALGO | 0.993945 | 5.599082 |
7c8bca71-4340-49e5-b596-237ec1cd879b | ishandutta2007/codeforces | farhod_farmon/normal/722/D.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define sc scanf
#define pr printf
#define pb push_back
#define mp make_pair
#define fin(s) freopen( s, "r", stdin );
#define fout(s) freopen( s, "w", stdout );
const int N = 50050;
using namespace std;
int n, a[N], b[N];
bool can(int x)
{
map < int, ... | ALGO | 0.999995 | 3.205981 |
1b0e0a87-0392-448a-974b-620af6e9442d | rokonrj403/CSE-2204_Algo_Lab | Algo_Lab1_12-Jan-2025/2_ii_NumberPattern_Floyd's_Triangle.cpp | // To Print the Floyd's Triangle till N number of user Input
// 0
// 01
// 101
// 0101
// 10101
#include <iostream>
using namespace std;
int main(){
int numberN;
cout << "Enter the N: ";
cin >> numberN;
int k = 1;
for (int i = 1; i <= numberN; i++)
{
for (int j = 1; j <= i; j++)
... | ALGO | 0.999955 | 5.61561 |
2e9ff4ce-c111-425c-8be2-d3ab4785594d | charlotte-visionlab/Vision_FLP | MRF/MRFCode/src/eff_mlabel_ver1/main.cpp |
/*** Please see README.txt ***/
#include <cstdio>
#include "image.h"
int main() {
image* Image;
// b. Create an image object using a ppm file:
// image* Image = image("file.ppm", number_of_labels);
// pgm files are also supported. Change image::image(char*, int) accordingly.
int nu... | ALGO | 0.995127 | 4.403324 |
49bbf72a-d263-4c8f-8939-a8de95ca32b2 | StolasIn/leetcode_Submissions | content/validate-stack-sequences/Accepted/8-15-2021, 2_20_35 PM/Solution.cpp | // https://leetcode.com/problems/validate-stack-sequences
class Solution {
public:
bool validateStackSequences(vector<int>& pu, vector<int>& po) {
stack<int> st;
int cnt=0;
for(int i=0;i<pu.size();i++){
st.push(pu[i]);
while(cnt<po.size()){
if(st.size... | ALGO | 0.999695 | 6.346292 |
1bcba6e3-a01c-461b-b0c0-dbffe9384705 | Mandeepbamane/Programming | C IN C++/area funoverload.cpp | #include<iostream>
using namespace std;
int area(int l,int b){
int area1=l*b;
cout<<"area of rectangle is "<<area1<<endl;
}
float area(float r){
float area2=3.14*r*r;
cout<<"area of circle is "<<area2;
}
int main(){
area(12,2);
area(3);
}
| ALGO | 0.996977 | 3.496881 |
13717df5-6ee6-4fa9-8629-991bc6d460a2 | daniel-raad/myLeetCode | problem746.cpp | /**
Problem 746: Min cost climbing stairs
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).
Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of the floor, and you can either start from the step with index 0, or the step ... | ALGO | 0.999975 | 6.004014 |
c638add4-8230-492a-adcc-d4501835bdf2 | guru-divine/Codeforces_Code | 735_d.cpp | //Author: DIVYA RAJ
#include <bits/stdc++.h>
#define ll long long
#define int long long
#define nl "\n"
#define pb push_back
#define popb pop_back
#define F first
#define S second
#define sz(arr) arr.size()
#define vi vector<int>
#define vs vector<string>
#define pii pair<int, int>
#define mapi map<int, int>
#define un... | ALGO | 0.999968 | 4.79469 |
a03092c6-013a-495d-8015-c1b4acf6ef92 | vinay-nmamit/my-cpp | patterns-yt/invertedpyramid.cpp | //inverted half pyramid
// *****
// ****
// ***
// **
// *
#include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
for(int i = n; i >= 1; i--){
for(int j = 1; j <= i; j++){
cout << "*";
}
cout << endl;
}
return 0;
} | ALGO | 0.999977 | 4.159739 |
e57a3327-23ac-42b8-b50c-a0d983df28fd | parksanghoon-sys/ProgrammingStudy | Language/C++/C++/STL자료구조/Projects/operator.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
class Student
{
public:
string name;
int age;
public:
Student(string name, int age): name(name),age(age){}
~ Student() = default;
bool operator<(Student s) const{
if(this->name == s.name){
... | ALGO | 0.997582 | 4.905799 |
aa9f3a0d-5f52-4753-a4f8-c5679306b2d3 | Aratz/kattis | cpp/paired.cpp | #include <map>
#include <queue>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int analyse(const vector<int> &array){
if(!array.size())
return 0;
map<int, queue<int>> counts;
for(int i=0;i<array.size();i++)
counts[array[i]].push(i);
priority_queue<int, ve... | ALGO | 0.999962 | 4.284612 |
a39bfde7-e0a0-46d9-aeb7-0cd76887adac | HootChain/HootChain | src/bls/bls_ies.cpp | #include <bls/bls_ies.h>
#include <hash.h>
#include <random.h>
#include <crypto/aes.h>
template <typename Out>
static bool EncryptBlob(const void* in, size_t inSize, Out& out, const void* symKey, const void* iv)
{
out.resize(inSize);
AES256CBCEncrypt enc(reinterpret_cast<const unsigned char*>(symKey), reint... | ALGO | 0.981712 | 7.292222 |
54a1b758-14c0-41b1-a666-11a1acc18ae1 | Akshat-Das/Leetcode-Practice | 1338-reduce-array-size-to-the-half/1338-reduce-array-size-to-the-half.cpp | class Solution {
public:
int minSetSize(vector<int>& arr) {
unordered_map<int,int>count;
for(auto num : arr){
count[num]++;
}
vector<int> freq;
for (auto [_,con] : count){
freq.push_back(con);
}
sort(freq.begin(), freq.end());
i... | ALGO | 0.999906 | 5.830986 |
fea1d8bc-98e7-4e86-8e56-c9bc2c20c4b1 | SelvaLakshmiSV/C-exercise | Quadratic eqaution.cpp | #include <iostream>
using namespace std;
int main()
{
int a,b,pos,neg,formula,eformula,result;
cin>>a>>b;
pos = a*a;
neg = 2*a + 1;
//-1=+1==>//Making the -1 to o without change in +-1 using
formula = (b+1)/2;//no change for b = +1
//Now add 1 to 0
eformula = 1-formula;
result = fo... | ALGO | 0.999933 | 3.637092 |
7288bd22-1c08-4847-990e-e2bbede55d9c | StolasIn/leetcode_Submissions | content/design-hashset/Accepted/7-13-2021, 10_22_06 AM/Solution.cpp | // https://leetcode.com/problems/design-hashset
class MyHashSet {
public:
/** Initialize your data structure here. */
bool arr[1000010];
MyHashSet() {
memset(arr,0,sizeof(arr));
}
void add(int key) {
arr[key]=true;
}
void remove(int key) {
arr[key]=false;
... | ALGO | 0.999201 | 5.385542 |
ff4dffc9-cae7-4a6a-86ef-90ada4ad7e20 | atuluttam/cpp_dsa_essentials | 10_backtracking/sudoku.cpp | /*---------------------------------------------------------------------
* code : sudoku
* @author : Atul Uttam
* Date Created : 08-02-2023(00:32:24)
--------------------------------------------------------------------*/
#include <iostream>
#include <algorithm>
#include <ve... | ALGO | 0.999421 | 6.140252 |
7baa3237-032e-407f-b960-86146edb83aa | BorsukUlamThm/Computational-Geometry-pedagogical-animations | animations/chapter-1/src/utils.cpp | #include "../include/utils.h"
namespace convex_hull_utils
{
Options process_command_line(int argc,
char** argv)
{
Options opt;
utils::Program_options program_options;
enum Options
{
INPUT_FILE_OPT,
ACQUISITION_OPT,
RANDOM_OPT,
SEED_OPT
};
program_options.add_option("input_file", "i... | TOOL | 0.88859 | 6.852215 |
f08181dd-5706-4ad1-8094-5e828306299e | zxcv859500/Dovelet | koi_garden/688689_WA.cpp | #include<stdio.h>
int days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31},N,min=0x7fffffff;
bool chk[100001],zerochk=false;
struct A{
int st,fi;
}flower[100001];
bool ok(void){
int i,j;
bool daychk[366];
for(i=1;i<=N;i++){
if(chk[i]){
if(flower[j].st<flower[j].fi)
daychk[j]=true;
}
}
for(i=60;i<=344;i++){... | ALGO | 0.999899 | 3.643253 |
5a4ad7d0-fb81-47ca-91ca-2d359826dca4 | jskong1124/PS | Baekjoon/2562.cpp | #include <iostream>
using namespace std;
int main(void) {
cin.tie(NULL);
ios::sync_with_stdio(false);
int n, max, index;
max = 0;
for (int i = 0; i < 9; i++) {
cin >> n;
if (max < n) {
max = n;
index = i + 1;
}
}
cout << max << '\n' << index << '\n';
return 0;
} | ALGO | 0.999955 | 4.277862 |
a57ec2fa-5371-4ef5-8e8d-3bbc08f75549 | 50915136/exan | 二分搜尋算法來查找目標值.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// 使用二分搜尋算法來尋找目標值
int binarySearch(const vector<int>& arr, int target)
{
int left = 0;
int right = arr.size() - 1;
while (left <= right)
{
int mid = left + (right - left) / 2;
if (arr[mid] == target)
... | ALGO | 0.999943 | 5.640267 |
35ae8555-8c9a-40e6-8c6b-9be3f156aef7 | ishandutta2007/codeforces | geniucos/normal/568/A.cpp | #include<cstdio>
#include<bitset>
#include<vector>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<map>
#include<set>
#include<queue>
#include<algorithm>
using namespace std;
int P, Q;
bool cr[10000009];
bool pal (int val)
{
if (val % 10 == 0) return 0;
int ras = 0, aux = val;
... | ALGO | 0.999917 | 3.637939 |
217b3b47-ca6a-4ba6-a39a-a308c7d45db9 | RafScrap/SysAnalis | task4/task4/task.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include <vector>
double truncDouble(double x) {
return std::trunc(x * 100) * 0.01;
}
int main(int argc, char* argv[]) {
unsigned int n1 = 6, n2 = 6;
unsigned int count = n1 * n2;
double HA = 0, HB = 0, HAB = 0, H_A_B = 0, I_A_B = 0;
std::... | ALGO | 0.999306 | 3.077848 |
a9407400-1f44-436a-8f24-778c7530416d | aanda-stcloudstate-edu/WebSpace | cs201/Gaddis/8e/SourceCode/Chapter 04/Pr4-2.cpp | // This program averages three test scores
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
const int HIGH_SCORE = 95; // A high score is 95 or greater
int score1, score2, score3; // To hold three test scores
double average; // TO hold the average score
// Get the t... | ALGO | 0.876575 | 5.099542 |
6cc1e253-9304-45ed-9e17-113cfc1c061e | joginderNrajput/Leetcode-Problems | Longest Increasing Subsequence - GFG/longest-increasing-subsequence.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find length of longest increasing subsequence.
int solve(int n, int a[], int prev, int curr){
if(curr == n){
return 0;
}
int take = 0;
... | ALGO | 0.999897 | 6.05175 |
471100a6-9d94-47e5-a40b-6ecc72cf66d5 | peterpa-web/FileSync | FileSync/StringDiff.cpp | #include "StdAfx.h"
#include "afxtempl.h"
#include "StringDiff.h"
#ifdef _UNICODE
#define TCHAR2 DWORD
#else
#define TCHAR2 WORD
#endif
CStringDiff::CStringDiff(void)
{
}
CStringDiff::~CStringDiff(void)
{
}
void CStringDiff::ResetAll(void)
{
m_strMark.Empty();
}
void CStringDiff::Compare( const CString &strOwn,... | TOOL | 0.969581 | 5.129643 |
eb9b2b3d-bccf-4f1c-8d3a-835c1523c196 | Prathamesh01110/DSA | Codeforces/A0266-Stones_on_the_Table.cpp | //https://codeforces.com/contest/266/problem/A
#include <bits/stdc++.h>
using namespace std;
int main(){
int n{0};
cin>>n;
int ans{0};
string a;
cin>>a;
while(--n){
if(a[n]==a[n-1]){
ans++;
}
}
cout<<ans;
return 0;
} | ALGO | 0.999733 | 3.901835 |
251ff771-a7f7-4545-80ae-b073350c576f | vzhuang/CS143 | source/node.cpp | #include "node.hpp"
#include <map>
#include <vector>
#include "parser.hpp"
#include "network.hpp"
extern Network network;
extern priority_queue<Event *, vector<Event *>, CompareEvents> routing_queue;
using namespace std;
Node::Node() {
ip = this;
// Distance from node to istelf is 0
distance_vector[ip] = 0.0;
}
/... | ALGO | 0.963851 | 4.345012 |
bfe6c887-0847-4e4b-b728-ddd812a9540b | gabrielpastori/Competitive-Programming | SPOJ-BR/telefone.cpp | #include <iostream>
using namespace std;
char verifica(char p){
if(p=='A' or p =='B' or p=='C') return '2';
if(p=='D' or p =='E' or p=='F') return '3';
if(p=='G' or p =='H' or p=='I') return '4';
if(p=='J' or p =='K' or p=='L') return '5';
if(p=='M' or p =='N' or p=='O') return '6';
if(p=='P' or p =='Q' or p=='... | ALGO | 0.999537 | 3.756447 |
87659be7-5a99-4d75-b8e6-47ea0758e6d4 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_5260_1.cpp | #include <bits/stdc++.h>
using namespace std;
map<char, int> m;
char t[50];
int main() {
int k;
cin >> k >> k;
string s;
cin >> s;
for (int i = 97; i < 123; i++) {
char c = i;
m[c] = i - 96;
t[i - 96] = c;
}
for (int i = 0; i < s.size(); i++) {
char c = s[i];
if (k == 0) {
cout <... | ALGO | 0.999982 | 4.277746 |
a0f28a40-a72a-4ace-a11a-275c8427db38 | annu050/Leetcode | 66-plus-one/plus-one.cpp | class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
int n=digits.size();
for(int i=n-1;i>=0;i--){
if(digits[i]!=9){
digits[i]+=1;
return digits;
}
digits[i]=0;
}
digits.insert(digits.begin(),1);
... | ALGO | 0.999795 | 6.880234 |
b42a91f7-7614-40f6-86c1-28949a8543eb | ishandutta2007/codeforces | oleh1421/normal/1103/A.cpp | #include <bits/stdc++.h>
typedef long long ll;
#define endl '\n'
///#define int long long
using namespace std;
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int cnt0=0;
int cnt1=0;
string s;cin>>s;
for (auto i:s){
if (i=='0'){
cnt0++;
... | ALGO | 0.999813 | 3.167815 |
d53a52bc-5ff1-432a-a3bb-3728c0cad5fb | willychen0146/Programming-Design | hw2/hw2_2.cpp | # include <iostream>
using namespace std;
const int MAX_STATION_NUM = 20;
// This is the prototype of the function you need to complete.
// 這是你需要完成的函數的 prototype
int checkCorrectness(int stationNum, int initPass, int maxPass, const int getInPass[], const int getOutPass[]);
int main(){
int stationNum = 0, initPa... | ALGO | 0.999619 | 3.915625 |
477f1745-428a-4e98-b708-e841fbfb90a3 | iains/LLVM-7-branch | openmp/runtime/src/kmp_environment.cpp | /*
* kmp_environment.cpp -- Handle environment variables OS-independently.
*/
/* We use GetEnvironmentVariable for Windows* OS instead of getenv because the
act of loading a DLL on Windows* OS makes any user-set environment variables
(i.e. with putenv()) unavailable. getenv() apparently gets a clean copy of
... | TOOL | 0.860144 | 6.795941 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.