uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
cc38c4b8-df60-41e3-9b71-3cadd8b2cc40 | SeSACAlgorithm/AlgorithmStudy | 프로그래머스/LEVEL 3 (1)/43163) 단어 변환/석희.cpp | #include <string>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
// 서로 바꿀수있는 관계인지 확인
bool check_same_word(string words1, string words2)
{
int same = 0;
for (int k = 0; k < words1.length(); k++)
if (words1[k] == words2[k])
same++;
return same == words1.len... | ALGO | 0.999947 | 5.452211 |
982a35e4-3fdb-4e00-877f-fc88a606c3bd | pinaky/aims-2016 | src/proposal_rwmhisotropicnormal.cpp | #include "utilities.h"
#include "proposal_rwmhisotropicnormal.h"
#define _USE_MATH_DEFINES
#include <math.h>
namespace aims
{
// Constructor:
// - Takes in the isotropic standard deviation for this isotropic normal
Proposal_RWMHIsotropicNormal::Proposal_RWMHIsotropicNormal(double const &s)
{
// Check that ... | ALGO | 0.950841 | 4.76182 |
5452569e-34b9-482f-b8fc-deeb05a68271 | NaiveeDev/DM1_lab02 | DM1_lab01/DM1_lab02.cpp | #include <iostream>
#include <vector>
#include <cstdarg>
#include <Windows.h>
#include <random>
#include <array>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <string>
#include <tuple>
//#1
void fillArr() {
const int SIZE = 1000;
std::array<int, SIZE> A;
for (size_t i = 0; i < A.si... | TOOL | 0.974031 | 4.355211 |
fb6bbdad-fc0b-4ac9-b22b-b89cd6f8a215 | sabbirislam111/algoritham | module 11 exam/test.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
int sv, ev;
vector<vector<int>> g;
vector<int> vis;
vector<int> parent;
bool dfs(int u, int p)
{
vis[u] = true;
parent[u] = p;
for(auto v: g[u])
{
if(v == p) continue;
if(vis[v])
{
sv = v;
ev = u;
return true;
}
if(!vis[v])
if(dfs(v,u))... | ALGO | 0.999954 | 4.857181 |
20c86f61-4b9b-4196-9b03-06f0645b744f | Alex-jpeg1/HardProblems- | Ball.cpp | ///This is a solution to the problem https://vjudge.net/problem/CodeForces-12D
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
///#include<fstream>
using namespace std;
/*ifstream cin("date.in");
ofstream cout("date.out");
ofstream fout("debug.out");
*/
struct Lady {
int beauty, intellec... | ALGO | 0.999842 | 4.150931 |
eb29ba7b-caef-4210-aa5a-4b72fb3e4d79 | tic40/atcoder | abc/abc304/b/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define endl '\n'
int main() {
int n; cin >> n;
int now = 1e3, x = 1;
while(1) {
if (n < now) { cout << n/x*x; return 0; }
now *= 10; x *= 10;
}
} | ALGO | 0.999753 | 3.433191 |
1f4ddbcc-d37c-43b5-8389-d58bfba6ef3c | ArduCAM/ArduCAM_ESP32S_UNO_PSRAM | libraries/ESP32WebServer/Parsing.cpp | #include <Arduino.h>
#include "WiFiServer.h"
#include "WiFiClient.h"
#include "ESP32WebServer.h"
//#define DEBUG_ESP_HTTP_SERVER
#ifdef DEBUG_ESP_PORT
#define DEBUG_OUTPUT DEBUG_ESP_PORT
#else
#define DEBUG_OUTPUT Serial
#endif
static char* readBytesWithTimeout(WiFiClient& client, size_t maxLength, size_t& dataLength... | WEB | 0.877969 | 4.095035 |
6438029b-03bc-4927-8fcf-0513019c0c24 | ishandutta2007/codeforces | khuepr123/normal/1513/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fi first
#define se second
#define endl "\n"
#define ii pair<int, int>
#define PI 3.141592653589793238462643383279502884
#define ll long long
const ll mod = 1e9 + 7;
const int maxN = 200005;
const ll oo = 1e18 + 7;
int n, a... | ALGO | 0.999966 | 3.935603 |
77b7a1ad-1b72-4ab7-a195-87ff22ab1d9f | EmilJohns1/IDATT2104 | exercise_1/prime_numbers.cpp | #include <iostream>
#include <vector>
#include <thread>
#include <mutex>
using namespace std;
bool isPrime(int number) {
if (number < 2) {
return false;
} else if (number == 2) {
return true;
}
int divisor = 2;
while (divisor * divisor <= number) {
if (number % divisor == ... | ALGO | 0.999971 | 5.764159 |
7fe31125-fe5c-462a-99b2-0a82a1e951a7 | Debadrita438/flutter-favorite-places | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
606ba62d-af2c-477d-ba33-ab18cf01abfd | philippebaron4152/APC523-Final-Project | lammps/src/pair_lj_expand.cpp | // clang-format off
#include "pair_lj_expand.h"
#include <cmath>
#include <cstring>
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neigh_list.h"
#include "math_const.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace MathConst;
/* ---------------------------------... | ALGO | 0.998731 | 6.553897 |
2d133046-a94c-4f1d-b22a-1c189a1d6d12 | ishandutta2007/codeforces | kostroma/normal/568/C.cpp | #pragma comment (linker, "/STACK:1280000000")
#define _CRT_SECURE_NO_WARNINGS
//#include "testlib.h"
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <bitset>
#include <deque>
//#... | ALGO | 0.999992 | 3.555351 |
f1dab934-2b7c-4ee5-98d8-839a46a1c0cb | MehtaAum/CPP | day 21/grading.cpp | #include <iostream>
using namespace std;
class superhero{
public:
int flyingpoints;
int fightpoints;
int powerlevel;
// constructor
superhero(){
flyingpoints = 10;
fightpoints = 20;
powerlevel = 0;
}
// constructor
string calculategrade(){
if(powerlevel >= 80){
return "A1 - TOP... | TOOL | 0.915305 | 3.84142 |
a135dffc-210c-4b10-bcf6-9e2796701889 | cliffszz/Leetcode | Cpp/Daliy Topic/264_nthUglyNumber.cpp | //https://leetcode-cn.com/problems/ugly-number-ii/
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
int nthUglyNumber(int n) {
vector<int> dp(n + 1);
dp[1] = 1;
int p2 = 1, p3 = 1, p5 = 1;
for(int i = 2; i <= n; i++) {
... | ALGO | 0.999962 | 5.244453 |
49331080-ca2a-4050-bc07-6fa60ac334d1 | sanketnaik20/Programming-Only | practice.cpp/listlink.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node(int data)
{
val = data;
this->next = NULL;
}
};
void insertAtHead(Node *&head, int element)
{
Node *temp = new Node(element);
temp->next = head;
head = temp;
}
void display(Node *&he... | ALGO | 0.999632 | 4.952771 |
bf6bbe73-585c-4673-b9c8-660da0574394 | sumitsojha88/Placement-Preparation | Interview Bit Solutions/Stacks And Queues/Evaluate Expression.cpp |
int Solution::evalRPN(vector<string> &A) {
stack<int> nums;
for(string& op: A){
if(op=="+" || op=="-" || op=="*" || op=="/"){
int b = nums.top();
nums.pop();
int a = nums.top();
nums.pop();
if(op=="-") nums.push(a-b);
else if(op==... | ALGO | 0.999384 | 5.081268 |
b08e85a5-f480-430e-be09-a746436f75c1 | EslamAsHhraf/Codeforces-practice | FE-CU Training 2021-2022/FECU - Team Formation 2022 #3/(O) Hard Problem V2.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
vector<vector<ll>> e;
bool visited[5009],good[5009];
int coun;
ll n, m, s, x, y;
void dfs1(int v)
{
good[v] = true;
for (auto to : e[v])
if (!good[to])
dfs1(to);
}
void dfs2(int v)
{
visited[v] = true;
++coun;
for ... | ALGO | 0.99975 | 3.775023 |
32bed430-232c-464c-85e3-67252abc8650 | MichaelAquilina/advent-of-code-2024 | day05/main.cpp | #include "lib.h"
#include <filesystem>
#include <iostream>
#include <vector>
int main(int argc, char *argv[]) {
std::vector<std::string> args(argv, argc + argv);
if (args.size() != 2) {
throw std::runtime_error("Must provde path to input.txt");
}
const std::filesystem::path path = args[1];
auto [queue... | ALGO | 0.966183 | 5.73792 |
7b378ead-ae65-4cf6-bf75-327ec5ea13d0 | pingchungchang/CP | CF1473A.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()
void solve(){
int n,d;
cin>>n>>d;
int arr[n];
... | ALGO | 0.999892 | 4.34622 |
c90f7358-619c-48c1-8a5d-8f77199aade4 | mdrion12/cps-academy-batch-4 | weekly-contest-1/Maximum_Element_in_Stack.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> v;
void push_to_stack(int y)
{
v.push_back(y);
}
int pop_to_stack()
{
if (!(v.empty()))
{
int x = v.back();
v.pop_back();
return x;
}
else
{
return -1;
}
}
void print_maximum()
{
if (v.empty())
... | ALGO | 0.999366 | 4.389132 |
4d439000-1b27-4d9b-a329-6d036499b541 | ymatevva/FMI-UP | ExamProblems/1st Problem Concatanate 2022C1.cpp | #include <iostream>
#include<cmath>
//N = A . K . B
int a,b;
int digitsCount(int number)
{
int count = 0;
while(number > 0)
{
count ++;
number/=10;
}
return count;
}
bool concatenate(int N, int K)
{
int maxA = pow(10,digitsCount(N)- digitsCount(K));
for (int A = 1; A <... | ALGO | 0.997153 | 5.11177 |
103f02c5-a5d8-4001-b796-b89716558139 | tameesoul/critical-SKILLS-using-C- | function/hw6.cpp | #include<iostream>
using namespace std;
void is_power(int arr[], int leng = 5 ,int n = 2)
{
arr[0] = 1;
for(int i = 1 ; i<leng;i++)
{
arr[i] = arr[i-1] * n;
}
}
int main()
{
int arr[100];
int leng , n;
cin >>leng >> n;
is_power(arr, leng,n);
for(int i = 0;i<leng;i++)
... | ALGO | 0.999914 | 3.421669 |
cfda9c20-d6cd-4bf5-b473-3c07c42bb493 | Abhishek2533/DSA | GeeksForGeeks/Medium/Longest_Span_in_two_Binary_Arrays.cpp | class Solution {
public:
int longestCommonSum(vector<int> &a1, vector<int> &a2) {
// Code here.
int n = min(a1.size(),a2.size());
map<int,int> mp;
int ans=0,sum=0;
mp[0]=-1;
for (int i=0;i<n;i++)
{
sum+=a1[i]-a2[i];
if(mp.count(sum))
... | ALGO | 0.999977 | 5.584033 |
c066195f-6db1-4df0-b146-6e7b99a49369 | Mahaprasad003/Competitive-Code | long challenges/tempCodeRunnerFile.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
char first,second,third,x,y;
cin>>first>>second>>third;
cin>>x>>y;
if(first == x || first == y)
{
cout<<first;
}
else if ( second ==... | ALGO | 0.9991 | 3.385323 |
c9e30b8b-7f5f-49a3-afbc-ea398ad612d2 | SageWu/recommend | recommend-node.cpp | #include <vector>
#include <nan.h>
#include "src/collaborative-filtering.cpp"
#include "src/tfidf.cpp"
using namespace v8;
using namespace Nan;
using namespace std;
//协同过滤推荐列表
void getCFRecommendations(const Nan::FunctionCallbackInfo<Value>& info) {
//检查输入
if(!info[0]->IsArray()) Nan::ThrowError("scores must... | TOOL | 0.92248 | 5.863621 |
3f67910a-7b1b-406e-afa2-8e423fc9409d | FreeEric001/CSP | S/4-DFS/空间搜索.cpp | #include <iostream>
using namespace std;
int n, x, y;
int ans = 114514;
int vis[210]; //标记数组
int s[210]; //数据
void dfs(int now, int step) { //在第now层,走了step步
if(now == y) { //到达
ans = min(ans, step); return;
} else if(step >= ans) return; //剪枝
if(now + s[now] <= n && vis[now + s[now]] =... | ALGO | 0.999988 | 3.674744 |
393897da-b760-4b12-a614-9bf7cf63399c | ShuhengLi/LeetCode | week4/493.ReversePairs.cpp | /*493. Reverse Pairs
* Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j].
You need to return the number of important reverse pairs in the given array.
Example1:
Input: [1,3,2,3,1]
Output: 2
Example2:
Input: [2,4,3,5,1]
Output: 3
*/
class Solution {
public:
int rever... | ALGO | 0.999932 | 5.287692 |
05c71f7c-0c28-41d2-a382-e736a554f1d7 | VishalSharma0309/cpp_coding | codechef_april_long/april_unitgcd.cpp | #include <bits/stdc++.h>
#include<sys/time.h>
using namespace std;
#define lli long long int
lli getTimeinMicroSeconds(){
struct timeval start;
gettimeofday(&start, NULL);
return start.tv_sec*1000000 + start.tv_usec;
}
void unitgcd(lli N){
if (N==1){
cout<<"1"<<endl;
cout<<"1"<<" "<<"... | ALGO | 0.99953 | 3.75558 |
20d850cb-a7d1-4f06-be47-2b2ccfab6850 | vickyguptaa7/CrackYourPlacement | 45DaysChallenge/Heap And PQs/Medium/Furthest_Building_You_Can_Reach.cpp | class Solution
{
bool isValid(int mid, vector<int> &heights, int bricks, int ladders)
{
vector<int> move;
for (int i = 1; i <= mid; i++)
{
if (heights[i] - heights[i - 1] <= 0)
continue;
move.push_back(heights[i] - heights[i - 1]);
}
... | ALGO | 0.999939 | 6.271341 |
65102f13-8dee-4f03-96bd-eef0413007a2 | VictorNBatista/Software-Engineering | Algoritmo-e-Programacao/Códigos Semana 3/2. Média/VictorMedia.cpp | #include<stdio.h>
#include<math.h>
#include<locale.h>
main()
{
setlocale(LC_ALL,"Portuguese");
// Declarao das Variveis
float a, b, c;
// Entrada de Dados
printf("Digite a 1 nota: ");
scanf("%f" ,&a);
printf("Digite a 2 nota: ");
scanf("%f" ,&b);
printf("Digite a 3 nota: ");
scanf("%f" ,&c);
// Pr... | ALGO | 0.997971 | 3.565099 |
074691f2-a13a-48fe-8847-41581e7b343a | raincross7/code-similarity | codes/train_code/problem330/problem330_4.cpp | // C++ 14
#include <bits/stdc++.h>
using namespace std;
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) { os << "["; for (int i = 0; i < v.size(); ++i) { os << v[i]; if (i != v.size() - 1) os << ", "; } os << "]"; return os; }
template <typename T> void print(T v, string s = "\n") ... | ALGO | 0.99993 | 4.426342 |
fc7bc030-5848-4720-a0a4-70fef2d734a2 | KiranJana/SimpleCPUandMemory | cpu.cpp | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <iostream>
#include <string>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <ctype.h>
#include "cpu.h"
// Function Prototypes for the methods in the class.
void intializeCPU(int secondArgument);
void proces... | TOOL | 0.963771 | 3.195889 |
cf366f2b-0cb3-45e6-aa91-7097a4f15323 | mowangblog/C-Demo | 2018.12/比大小.cpp | # include <stdio.h>
int main(void)
{
int a, b, c, t;
printf("");
scanf("%d %d %d", &a , &b, &c);
if(a>b&&a>c)
{
printf("%d",a);
}
else if(b>a&&b>c)
{
printf("%d",b);
}
else if(c>a&&c>b)
{
printf("%d",c);
}
return 0;
}
| ALGO | 0.999873 | 3.761121 |
dbcfc168-9de8-4bcb-b36a-c477474cc55e | zzgchina888/opencv | samples/cpp/mask_tmpl.cpp | #include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace std;
using namespace cv;
int main( int argc, const char** argv )
{
CommandLineParser parser(argc, argv,
"{ i | lena_tmpl.jpg |image name }"
"{ t | tmpl.png |template name }"
"{ m | mask.png |m... | ALGO | 0.961709 | 4.887125 |
ddd4d841-9b10-40e2-9166-c2e36fec03a7 | sahilwep/DSA-Workspace | Leetcode/Easy/3024_Type_of_Triangle.cpp | /*
// 3024. Type of Triangle
// Problem Link: https://leetcode.com/problems/type-of-triangle/description/
*/
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
class Solution {
public:
string triangleType(vector<int>& nums) {
sort(begin(nums), end(nums)); // sort them for easier compa... | ALGO | 0.999948 | 5.678887 |
0204ee07-272a-487f-a84e-e9ac80294ae0 | ZZiAnnn/XMU-Learning | 大二下/计算机图形学/Lab/计图实验5/eigen-3.3.7/doc/examples/QuickStart_example2_dynamic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXd m = MatrixXd::Random(3,3);
m = (m + MatrixXd::Constant(3,3,1.2)) * 50;
cout << "m =" << endl << m << endl;
VectorXd v(3);
v << 1, 2, 3;
cout << "m * v =" << endl << m * v << endl;
}
| ALGO | 0.999523 | 3.513991 |
cbd84850-63f0-4cb8-9f1e-c4a3125d0fcd | ZivFerdinand/CompetitiveProgramming | C++ Code/Calculating_Function.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <map>
#include <sstream>
#define ll long long
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
ll n;
cin >> n;
if(n%2==0){
cout << n/2 << '\n';
}
else{
cout << (n/2)-n << '\n';
}
} | ALGO | 0.999396 | 3.333355 |
13be9258-697e-4ad1-b6b0-ea09aa182a69 | mfrancisc/usaco | arithmetic_progression/Ariprog.cpp | /*
ID: muntean3
PROG: ariprog
LANG: C++11
*/
#include <string>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <set>
#include <vector>
using namespace std;
struct result
{
int a;
int b;
};
bool cmp(const result& a, const result& b)
{
if (a.b != b.b) {
return a.b < b.b;
}
else {
return a... | ALGO | 0.999326 | 3.888762 |
e1e5ea0a-4f49-4ae4-a741-b9d90d03daef | stwuhan/leetcode | solution/1800-1899/1819.Number of Different Subsequences GCDs/Solution.cpp | class Solution {
public:
int countDifferentSubsequenceGCDs(vector<int>& nums) {
int mx = *max_element(nums.begin(), nums.end());
vector<bool> vis(mx + 1);
for (int& x : nums) {
vis[x] = true;
}
int ans = 0;
for (int x = 1; x <= mx; ++x) {
int g... | ALGO | 0.999915 | 5.836481 |
6f30a4df-79d0-4a56-ac62-89221a22d9c2 | Kushagra614/Problem-Solving | 0144-binary-tree-preorder-traversal/0144-binary-tree-preorder-traversal.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.999937 | 6.198111 |
815aa047-453e-40dc-803a-7cd21a9b922b | BetterOIer/competitive-cpp-code | Competition/Competition106/end.cpp | #include<iostream>
using namespace std;
inline int read(){int x=0,f=1;char c=getchar();for(;!isdigit(c);c=getchar())if(c=='-')f=-1;for(;isdigit(c);c=getchar())x=(x<<3)+(x<<1)+(c^48);return x*f;}
int n,q;
string opt;
int a[5];
int getPos(char s[]){
if(s[0]=='a') return 1;
if(s[0]=='b') return 2;
if(s[0]=='c') return ... | ALGO | 0.999424 | 3.672863 |
ed00bf0b-c607-4255-9c03-945337d41858 | chinmayjainnnn/CPP | 783-search-in-a-binary-search-tree/search-in-a-binary-search-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.999991 | 5.885269 |
458bcbd6-7dd4-4ad2-b0e2-8308c2593ecb | ACyming/OI | c++/水题/多个三角形面积.cpp | #include<bits/stdc++.h>
using namespace std;
double hs(double x,double y,double z)
{
double s,p=(x+y+z)/2;
s=sqrt(p*(p-x)*(p-y)*(p-z));
return s;
}
int main()
{
double a,b,c,d,e,f,g,sum=0;
cin>>a>>b>>c>>d>>e>>f>>g;
sum=sum+hs(a,e,f)+hs(b,f,g)+hs(c,d,g);
cout<<fixed<<setprecision(3)<<sum;
return 0;
}
| ALGO | 0.99973 | 3.155226 |
ee86261e-3ad9-42bf-9193-792bcdd0b8e6 | ArchismanKarmakar/goldeneye-project-ges-code-2013 | utils/vrad/vraddisps.cpp | #include "vrad.h"
#include "utlvector.h"
#include "cmodel.h"
#include "BSPTreeData.h"
#include "VRAD_DispColl.h"
#include "CollisionUtils.h"
#include "lightmap.h"
#include "Radial.h"
#include "CollisionUtils.h"
#include "mathlib/bumpvects.h"
#include "utlrbtree.h"
#include "tier0/fasttimer.h"
#include "disp_vrad.h"
cl... | ALGO | 0.976143 | 4.214846 |
ecde42d3-81c1-442b-af25-d97a83c21290 | Prerna13149/Pattern_Questions | double_side_arrow.cpp | /*
PATTERN DOUBLESIDEDARROW
Take N as input. For a value of N=7, we wish to draw the following pattern :
1
2 1 1 2
3 2 1 1 2 3
4 3 2 1 1 2 3 4
3 2 1 1 2 3
2 1... | ALGO | 0.999959 | 4.298924 |
883d5864-72ca-4a9b-8f2d-0f6297736fc5 | lqryo/leetcode | c++/051-100/052_N-Queens_II.cpp | // 参考:https://leetcode-cn.com/problems/jump-game-ii/solution/chao-jian-dan-de-dong-tai-gui-hua-kan-bu-dong-ni-d/
#include <vector>
#include <array>
#include <algorithm>
#include <iostream>
#include <string>
#include <unordered_set>
using namespace std;
class Solution {
public:
int totalNQueens(int n);
private:
in... | ALGO | 0.999871 | 5.54512 |
20ae959b-7edf-43eb-8a0d-de6a02480739 | solo300m/14.6_home_work | task_3.cpp | #include <iostream>
using namespace std;
static bool compareTo(int arr[][4], int arr2[][4], int size)
{
for (int i = 0; i < size; i++)
{
for (int j = 0; j < 4; j++)
{
if (arr[i][j] != arr2[i][j])
return false;
}
}
return true;
}
static void diagonalMt... | ALGO | 0.999372 | 3.977103 |
b3c18ee0-c4aa-4b65-a216-a9a388a5f5a8 | gagua810/2025aaia | week14/week14-4.cpp | ///week14-4.cpp
///UVA11063: B2-Sequence
///Part 1...Part 6
#include <stdio.h>
int main()
{
int a[100];
int N, t = 1;
while( scanf("%d", &N) == 1 ){ ///Part 1
int bad = 0;///part 3:bad or not bad
for(int i=0; i<N; i++){ ///Part 1
scanf("%d", &a[i]); ///Part 1
if(i>0 && a[i-1] >= a[i]) bad =1;///Part5
}
... | ALGO | 0.99648 | 3.661006 |
307151e5-2ec3-429b-ad9e-9032e0b535b7 | evilsmile/scattered_codes | CompressText.cpp | /*
* Compress text with repeated alphas, and the repeated ones are replaced by a number representing repeated times.
*/
#include <iostream>
using std::string;
using std::cout;
using std::endl;
inline char numToAscii(int num)
{
#define NUM_TO_ASCII_OFFSET 48
return (num + NUM_TO_ASCII_OFFSET);
}
string compressT... | ALGO | 0.999577 | 4.681112 |
ea0fc5e0-d8e6-403f-a7e6-0e7e56820b4c | SahilB21/competitive-programming | USACO 2021 JAN BRONZE/Uddered But Not Herd/uddered-but-not-herd.cpp | #include <bits/stdc++.h>
int main(int argc, char *argv[]) {
std::string alphabet = "";
std::string letters = "";
int times_sang = 0;
int counted = 0;
int current_letter = 0;
std::cin >> alphabet;
std::cin >> letters;
while (counted < letters.length()) {
for (int i = 0; i < 26; i++) {
if (al... | ALGO | 0.999912 | 3.827638 |
f03d4271-bbe9-4f37-bce1-5efe53652289 | mahdisn76/UVa-Online-Judge | 10920.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<vector<int>> dir = { {0,1}, {-1, 0}, {0, -1}, {1, 0} };
int main()
{
int sz, p;
while (1)
{
cin >> sz >> p;
if (sz == 0 && p == 0)
break;
int x, y;
x = y = (sz / 2) + 1;
int step = 1;
int tmp = 0;
int dir_indx = 0;
int current_numb... | ALGO | 0.999684 | 3.637517 |
8302e424-65db-4548-904d-3e8e8044d23c | LeonArif/19623145-SekuroProgramming2024 | Tugas Modul 2/TP2-1-Programming.cpp | #include <iostream>
using namespace std;
int main(){
int arr[10];
int arr2[10];
int hasil;
for (int x = 0; x < 10; x++){
cin >> arr[x];
}
for (int y = 0; y < 10; y++){
cin >> arr2[y];
}
for (int z = 0; z < 10; z++){
hasil = arr[z] + arr2[z];
cout << ... | ALGO | 0.999696 | 3.457237 |
d36ae68b-8cd5-4a66-a13d-ef38b1091f95 | kalectro/pcl_groovy | tools/icp.cpp | #include <pcl/console/parse.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/registration/icp.h>
#include <pcl/registration/icp_nl.h>
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
typedef pcl::PointXYZ PointType;
typedef pcl::PointCloud<PointType> Cloud;
typedef Cl... | ALGO | 0.930152 | 5.849622 |
453f1095-9332-4adb-abaf-359f7fd00037 | prashantdhaka1/codeforces_soln | C_Bricks_and_Bags.cpp | #include<bits/stdc++.h>
using namespace std;
# define ll long long
# define fo(i,n) for(int i=0;i<n;i++)
#include<unordered_map>
int main(){
int t;
cin>>t;
while(t--){
vector<int> v;
// unordered_map<int,int> mp;
int n,x,y,a,b,c,d,e,fl=1;
cin>>n;
fo(i,n){
int k;
cin>>k;
v.push_back(k);
}
s... | ALGO | 0.999779 | 3.951378 |
c879b5da-a9ca-4770-98bb-5273158ebd95 | sarvex/leetcode-lua | solution/1000-1099/1080.Insufficient Nodes in Root to Leaf Paths/Solution.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.999995 | 6.394089 |
a3a4b5b1-b254-4d4e-ad78-94defb733da3 | erosnick/RayTracingTheNextWeekCUDA | RayTracingTheNextWeekCUDA/imgui/misc/fonts/binary_to_compressed_c.cpp | // dear imgui
// (binary_to_compressed_c.cpp)
// Helper tool to turn a file into a C array, if you want to embed font data in your source code.
// The data is first compressed with stb_compress() to reduce source code size,
// then encoded in Base85 to fit in a string so we can fit roughly 4 bytes of compressed data i... | TOOL | 0.896544 | 6.62991 |
8d9e275d-320c-4e0f-9744-55c97cabd9b0 | wenliangsun/LeetCode | 前缀和/矩阵区域和.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* 矩阵区域和
*/
class Solution {
public:
// 二维前缀和
vector<vector<int>> matrixBlockSum(vector<vector<int>>& mat, int K) {
int m = mat.size(), n = mat[0].size();
vector<vector<int>> sum(m + 1, vector<int>(n + 1)); // 计算前缀和
for (int i = 1;... | ALGO | 0.999779 | 5.18124 |
291107b7-a56b-4424-b741-e2118b8cf177 | PrathameshJadhav30/Top-100-Codes | Top 100 Codes/04-Important Codes related to Arrays/17-Finding Maximum scalar product of two vectors in an array/FindingMaximumscalarproductoftwovectorsinanarray.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// Define two arrays
int arr1[] = {1, 2, 6, 3, 7};
int arr2[] = {10, 7, 45, 3, 7};
int n = sizeof(arr1) / sizeof(arr1[0]); // Get the size of the arrays
// Sort both arrays in descending order to maximize product
sort(arr1, arr1 + n... | ALGO | 0.999974 | 5.355298 |
fbf44f18-565b-4bce-a7b7-3b5e4ffd2428 | eric2003/OneFLOW | example/1d-heat-equation/cn/cpp/multiblock/serial/2blocks/01/Solver.cpp | #include "Solver.h"
#include "CgnsUtil.h"
#include "Parallel.h"
#include "Post.h"
#include "Weno.h"
#include "ZoneState.h"
#include "global.h"
#include <fstream>
#include <iostream>
#include <iomanip>
#include <print>
#include <set>
#include <unordered_map>
Solver::Solver()
{
Parallel::Init();
//this->scheme... | ALGO | 0.999248 | 3.881207 |
a62f19fd-1c6b-4dc4-b5c9-4a46ce93e900 | soliton4/webcamoidfeeder | VirtualCamera/src/dshow/VirtualCameraFilter/BaseClasses/src/dllsetup.cpp | #include <streams.h>
#include <strsafe.h>
//---------------------------------------------------------------------------
// defines
#define MAX_KEY_LEN 260
//---------------------------------------------------------------------------
// externally defined functions/variable
extern int g_cTemplates;
extern CFactoryT... | TOOL | 0.931172 | 3.786124 |
848a174e-0f85-498f-b626-25510cd3cd6c | 1duouduo/04 | Project1/Project1/源.cpp | /*ǿɾֵظ*/
#include <iostream>
using namespace std;
typedef struct LNode
{
int data;
struct LNode* next;
}LNode;
void del(LNode* L)
{
LNode *p = L->next, *q;
while (p->next != NULL)
{
if (p->data == p->next->data)
{
q = p->next;
p->next = q->next;
free(q);
}
else
p = p->next;
}
}
void createLis... | ALGO | 0.999731 | 3.885656 |
6ef20aa6-e3c1-448d-a870-5b3659cb6259 | ishandutta2007/codeforces | linkus/normal/964/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define all(a) begin(a),end(a)
#define FOR(x,val,to) for(int x=(val);x<int((to));++x)
#define FORE(x,val,to) for(auto x=(val);x<=(to);++x)
#define FORR(x,arr) for(auto &x: arr... | ALGO | 0.999956 | 4.041129 |
1b03a0cd-fe03-4a52-8768-fcfd331d3eaf | TheFreeMan360/practice | leetcode/0232. Implement Queue using Stacks.cpp | class MyQueue {
public:
MyQueue() {
}
void push(int x) {
this->input.push(x);
}
int pop() {
this->changeIntoOutput();
int tmp = this->output.top();
this->output.pop();
return tmp;
}
int peek() {
this->changeIntoOutput();... | ALGO | 0.999015 | 5.559279 |
0c8fac0b-bc57-4d44-a3d8-711cbfe690ff | vieirinha1104/imeplusplus-notes | Notes/Grafos/Dijkstra/Grafo com peso/dijkstra_com_log.cpp | #include <bits/stdc++.h>
#define N 4000005
using namespace std;
vector<pair<int,long long>> adjw[N];
double dist[N];
int n,m;
void dijkstra (int s) {
priority_queue<pair<double,int>, vector<pair<double,int>>, greater<pair<double,int>>> pq;
for(int i=1;i<=n;i++){
dist[i]=N;
}
dist[s] = 0; pq.push({0,... | ALGO | 0.999508 | 3.834309 |
81ddd550-8727-4a36-9a5a-9c3712b6ee95 | RabadanLab/MITKats | Modules/Classification/CLUtilities/src/mitkCLUtil.cpp | #ifndef _mitkCLUtil_HXX
#define _mitkCLUtil_HXX
#include <mitkCLUtil.h>
#include <mitkImageAccessByItk.h>
#include <Eigen/Dense>
#include <itkImage.h>
// itk includes
#include <itkCheckerBoardImageFilter.h>
#include <itkShapedNeighborhoodIterator.h>
// Morphologic Operations
#include <itkBinaryBallStructuringElemen... | ALGO | 0.911143 | 5.740268 |
8cf0d3a1-c121-4333-9651-9ad539164891 | haoruizh/CS122 | cpts 122/Class file/BST8/BST/BST.cpp | #include "BST.h"
BST::BST()
{
this->mpRoot = nullptr;
}
Node * BST::getRootPtr() const
{
return this->mpRoot;
}
void BST::insert(Data const &newData)
{
insert(this->mpRoot, newData);
}
void BST::insert(Node *pTree, Data const &newData)
{
if (pTree != nullptr)
{
// right subtree
if (newData > pTree->getData... | ALGO | 0.988603 | 4.459131 |
17e67b9d-3a07-424f-9034-3b739a631b91 | wotaku0123/BlockChain | cryptopp880/bench3.cpp | // bench3.cpp - originally written and placed in the public domain by Wei Dai
// CryptoPP::Test namespace added by JW in February 2017
#include "cryptlib.h"
#include "bench.h"
#include "validate.h"
#include "cpu.h"
#include "factory.h"
#include "algparam.h"
#include "argnames.h"
#include "smartptr.h"
#in... | TEST | 0.971046 | 7.198253 |
e65b0375-c98f-4722-8d8a-0067fe1253c7 | Joselsneto/Codeforces-Solutions | 219a.cpp | ///José Luiz da Silva Neto
///Computer Engineering - Federal University of Itajubá
#include <bits/stdc++.h>
using namespace std;
#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef pair <int,int> pii;
typedef vector <int> vi;
... | ALGO | 0.999964 | 3.539265 |
a29f6833-45f9-4e1e-9bd9-0260bb12cbf3 | rikyyardii/weather-app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
71ae8876-7fc6-43fd-a02c-aa7c587eddd6 | dimuedm/GasBrine_PHREEQC | CH4_Solubility/CH4SolubilityInBrine.cpp | #include <iostream>
#include <map>
#include "../Phreeqc.h"
#include "../global_structures.h"
#include "CH4SolubilityInBrine.h"
CH4SolubilityInBrine::CH4SolubilityInBrine()
{
}
CH4SolubilityInBrine::~CH4SolubilityInBrine()
{
}
double CH4SolubilityInBrine::calCH4SolubilityInBrine(double temperatureK, double pressureB... | TOOL | 0.998471 | 5.198645 |
f67e59b9-e5ce-44af-a934-69c71084ec8a | ishandutta2007/codeforces | gyojunyoun/normal/799/C.cpp | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <set>
#define pb push_back
#define sz(V) ((int)(V).size())
#define allv(V) ((V).begin()),((V).end())
#define befv(V) ((V)[(sz(V)-2)])
#define upmin(ans,ansx) (ans... | ALGO | 0.99985 | 4.06527 |
e771393f-d502-440c-af9b-49b3ef78d9fc | Quentinm81/focus_wheel | 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.998799 | 6.776823 |
89cc5f0b-686f-46fb-8523-5aefb27c4127 | derinman/EB_Cpp-Note | ch13/ex13_04.cpp | #include <iostream>
using namespace std;
class Matrix // 計算矩陣相加的自訂類別
{
int Matrix_Num[2][2]; // 設定2x2的矩陣
public:
Matrix()
{
int i,j;
for (i=0; i<2; i++)
for(j=0; j<2; j++)
Matrix_Num[i][j]=0; // Matrix矩陣的建構
// 全部初始化為0
}
Matrix(int Tmp_a1, int Tmp_a2, i... | ALGO | 0.998949 | 4.231025 |
2d925cd3-37cb-407e-93fa-7a3d482da11e | sergrigordeev/yandex-cpp-courses | 02-yellow/excersises/w04-18-demographic-stats/w04-18-demographic-stats/ststicstics.cpp | #include "ststicstics.hpp"
#include <iostream>
#include <algorithm>
using namespace std;
bool IsMale(const Person& p){
return p.gender == Gender::MALE;
}
bool IsEmpoyed(const Person& p){
return p.is_employed;
}
void PrintStats(vector<Person> persons) {
auto females_end = partition(begin(persons), end(per... | TOOL | 0.985579 | 5.037863 |
68261bf1-8428-40b7-8e1c-bc6be40aeb20 | sarvex/leetcode-emoji-code | solution/0300-0399/0328.Odd Even Linked List/Solution.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.999971 | 5.979806 |
3b26908c-fc4e-4c86-aab4-accd3e49ca89 | proj-firefox/MailEnhance | mozilla/gfx/angle/src/compiler/depgraph/DependencyGraphTraverse.cpp | #include "compiler/depgraph/DependencyGraph.h"
// These methods do a breadth-first traversal through the graph and mark visited nodes.
void TGraphNode::traverse(TDependencyGraphTraverser* graphTraverser)
{
graphTraverser->markVisited(this);
}
void TGraphParentNode::traverse(TDependencyGraphTraverser* graphTraver... | ALGO | 0.884308 | 7.431239 |
952d8bd2-21b5-43fc-8fc3-35ace728872f | Yaksh77/DSA | Day_29/Check String Palindrome/code.cpp | #include<iostream>
#include<string>
using namespace std;
// bool isAplhaNum(char ch){
// if((ch > '0' && ch <= '9')||(tolower(ch) > 'a' && tolower(ch) <= 'z')){
// return true;
// }else{
// return false;
// }
// }
bool checkPalindrome(string str){
int start = 0, end = str.length() - 1;... | ALGO | 0.970892 | 4.214234 |
d932a68f-376d-4cde-8dcc-3a6d0815f57a | TINABJan254/DSA_CodePTIT | ChiaVaTri/DSA04004_GapDoiDaySo.cpp | #include <bits/stdc++.h>
using namespace std;
#define EL "\n"
#define ll long long
#define fi first
#define se second
#define sz size()
#define pb push_back
#define vi vector<int>
#define vii vector<vector<int>>
#define faster() ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define pii pair<i... | ALGO | 0.999831 | 5.034693 |
1ee7b3b4-30f8-4214-bb3c-eb73c31c3b31 | reefahtasnia/codeforcesSolve | 507A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, t;
cin >> n >> k;
pair<int, int> c;
vector<pair<int, int>> d;
for (int i = 1; i <= n; i++)
{
cin >> t;
c = make_pair(t, i);
d.push_back(c);
}
sort(d.begin(), d.end());
int count = 0, sum =... | ALGO | 0.999997 | 3.559135 |
b1d08c6a-3adc-4907-9952-3d32295dc636 | Iftekhar-Ahamed/Code | C_Soldier_and_Cards.cpp | /***
** Bismillahir Rahmanir Rahim
** ALLAHU AKBAR
**
** Author: Iftekhar Ahamed Siddiquee
** Bangladesh University of Business and Technology,
** Dept. of CSE.
***/
#include <bits/stdc++.h>
using namespace std;
#define FIO cin.tie(NULL), ios_base::sync_with_stdio(false)
#define read freo... | ALGO | 0.999877 | 3.59793 |
6d99985e-af62-4c61-b8bc-6083cd238f0e | cambridge0427/lightfield | common/matrixOp.cpp | #include <math.h>
#include <float.h>
#include <stdlib.h>
#include <time.h>
#include "matrixOp.h"
#include "basic.h"
// vector dot product vector
double multi(double* inVector1, double* inVector2, int length)
{
if (inVector1 == NULL || inVector2==NULL)
{
return -1.0;
}
double result = 0;
for (int i=0; i<length... | ALGO | 0.996554 | 3.587291 |
685b8907-810e-41e2-9de8-011bb6f165ed | MahinAshraful/CodeWatch_Data | sample-data/p00009/s565603368.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
#define DEBUG(x) cout<<#x<<": "<<x... | ALGO | 0.999218 | 4.057577 |
8f9c2495-5956-4121-9920-f48b5d60b84d | Waqar144/simplecrypto-cxx | simplecrypto-cxx/hmac.cpp | #include "hmac.h"
#include <cstring>
#include <string>
#if BYTE_ORDER == LITTLE_ENDIAN
static constexpr uint64_t inline reverse64(uint64_t w)
{
w = (w >> 32) | (w << 32);
w = ((w & 0xff00ff00ff00ff00ULL) >> 8) | ((w & 0x00ff00ff00ff00ffULL) << 8);
w = ((w & 0xffff0000ffff0000ULL) >> 16) | ((w & 0x0000ffff... | ALGO | 0.984555 | 7.444167 |
056d07c7-bf2f-4a35-a6f8-a1f2d464c1cd | UnsEmp/C_Note | codeforces/Fast_Mathematician.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string s1, s2;
cin >> s1 >> s2;
for(int i = 0;i < s1.size();i++) {
if(s1[i] == s2[i])
cout << '0';
else
cout << '1';
}
return 0;
} | ALGO | 0.999992 | 3.888194 |
e7f4e624-f76e-41a8-83f0-8cd7ec411178 | openharmony/third_party_boost | libs/geometry/doc/index/src/examples/rtree/iterative_query.cpp | //[rtree_iterative_query
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/index/rtree.hpp>
// just for output
#include <iostream>
namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;
int main()
{
... | ALGO | 0.999927 | 6.279555 |
23e38444-d016-427d-a7a7-860208e8edf1 | Itisingh3/DSA-sheet-by-Siddharth-Singh- | 51_LongPressed.cpp | class Solution {
public:
bool isLongPressedName(string name, string typed) {
int i=0,n=name.length(),m=typed.length();
for(int j=0;j<m;j++){
if(i<n && name[i]==typed[j])i++;
else if(!j || typed[j]!=typed[j-1])return false;
}
return i==n;
}
};
| ALGO | 0.999714 | 5.979552 |
5d359d7b-5508-4f12-a257-25a6b228d0c5 | chenshijin1/Aha-Algorithms-practise | 4 SearchTraining/bfs_炸弹人/main.cpp | #include <iostream>
using namespace std;
struct node{
int x;
int y;
};
char a[20][21];
int getNum(int i,int j){
int sum,x,y;
sum =0;
x=i;
y=j;
while(a[x][y]!= '#'){//жǷǽ
//ǵ
if(a[x][y] =='G')sum++;
x--;//ͳ
}
//ͳƵĿ
x=i;y=j;
... | ALGO | 0.99963 | 3.122412 |
1aed1c3e-2936-4660-a610-ec8f5fc8a55a | olimpiada/kurs-oi | zadania/poczatki_programowania/szy/prog/szyb1.cpp | #include <iostream>
#include <cstring>
using namespace std;
const int LEN = 10000;
const int SZYFRUJ = 1;
int main() {
int polecenie, k;
cin >> polecenie >> k;
char tekst[LEN + 1];
cin >> tekst;
int n = strlen(tekst);
for (int i = 0; i < n; i++) {
if ('A' <= tekst[i] && tekst[i] <= 'Z') {
if (po... | ALGO | 0.999625 | 4.300272 |
a9df68ac-ff37-4892-97e6-f3ae35f39580 | juneharold/USACO | usaco_practice/silver/binary_search2/angry_cows.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int hays[50005]={};
int main()
{
//freopen("angry.in", "r", stdin);
//freopen("angry.out", "w", stdout);
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N, K; cin >> N >> K;
for (int i=0; i<N; i++) cin >> hays... | ALGO | 0.999989 | 3.968221 |
17053ee2-e20c-4cc9-8810-c49c8612a911 | STRUKTUR-DATA-SE-07-02/Modul-10-11-Tree- | 21104036_Satria Putra Dharma Prayudha/Unguided/unguided.cpp | #include <iostream>
#include <limits>
using namespace std;
// Struktur data pohon biner untuk menyimpan data dan pointer ke anak kiri, kanan, dan induk
struct Pohon {
char data;
Pohon *left, *right, *parent;
};
// Variabel global untuk menyimpan root (akar) pohon dan node baru
Pohon *root, *baru;
// Inisiali... | ALGO | 0.999633 | 6.732342 |
04054a95-eae3-4c2f-89fa-9088cb250cf7 | Ragebobber/GETRequestBoost | boost_1_78_0/libs/circular_buffer/example/circular_buffer_sum_example.cpp | //[circular_buffer_sum_example_1
/*`This example shows several functions, including summing all valid values.
*/
#include <boost/circular_buffer.hpp>
#include <numeric>
#include <assert.h>
int main(int /*argc*/, char* /*argv*/[])
{
// Create a circular buffer of capacity 3.
boost::circular... | TEST | 0.917655 | 6.429261 |
652379a8-10e5-468d-a006-b1877342b0da | raincross7/code-similarity | codes/train_code/problem334/problem334_145.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
//good luck kittu!
int n;
string s, t, x = "";
cin>>n>>s>>t;
//int n = s.size();
for(int i = 0; i<n; i++){
x.push_back(s[i]);
x.push_back(t[i]);
}
... | ALGO | 0.999946 | 3.471731 |
7e5440b6-0ff9-494f-88ec-d082b4a072a6 | leducthanh041/23521441_23521625_23521555_23520326_23521583_BT04 | Bai115/Source1.cpp | #include <iostream>
#include <iomanip>
void Nhap(float[][500], int&, int&);
bool ktGiamDan(float[][500], int, int);
void LietKe(float[][500], int, int);
using namespace std;
int main()
{
float a[500][500];
int m, n;
Nhap(a, m, n);
LietKe(a, m, n);
return 0;
}
void Nhap(float a[][500], int& m, int& n)
{
cout << ... | ALGO | 0.998666 | 3.247972 |
a2f48209-5ce2-4e51-9cb2-39416c4bb2e9 | Rishav07-05/CppDSA | 60_binaryTree_zigzagTraversal.cpp | #include <bits/stdc++.h>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
node(int d)
{
this->data = d;
this->left = NULL;
this->right = nullptr;
}
};
node *buildTree(node *root)
{
cout << "Enter the data: " << endl;
int data;
cin ... | ALGO | 0.999977 | 4.980845 |
e2d3f6c8-3140-411d-8f96-d02a096e1a90 | mmcguinn/UML-S12-UAV | libraries/APM_PI/APM_PI.cpp | // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-
/// @file ACM_PI.cpp
/// @brief Generic PI algorithm
#include <math.h>
#include "APM_PI.h"
const AP_Param::GroupInfo APM_PI::var_info[] PROGMEM = {
AP_GROUPINFO("P", 0, APM_PI, _kp),
AP_GROUPINFO("I", 1, APM_PI, _ki),
AP_GROUPINFO("... | ALGO | 0.988121 | 5.514909 |
91338ac9-64b6-42a3-b26f-fab3d4b9c4ae | pawan2806/LeetCode | 1091-shortest-path-in-binary-matrix/1091-shortest-path-in-binary-matrix.cpp | class Solution {
public:
int dx[8] = {0,0,1,1,1,-1,-1,-1};
int dy[8] = {-1,1,-1,0,1,-1,0,1};
typedef pair<int,pair<int,int>> pp;
int shortestPathBinaryMatrix(vector<vector<int>>& grid) {
if(grid[0][0])return -1; // beginning node is blocked
int n = grid.size();
vector<vector<bool>> v... | ALGO | 0.999996 | 6.003643 |
36bd3295-d75a-4af0-99a5-78d7173f535c | ClaerhoutN/AdventOfCode | AOC_2021_19/main.cpp | #include <stringUtilities.hpp>
#include <fileUtilities.h>
#include <iostream>
#include <array>
#include <vector>
using namespace std;
#define _cos(a) (a==0 ? 1 : (a == 180 ? -1 : 0))
#define _sin(a) (a==90 ? 1 : (a == 270 ? -1 : 0))
struct Vector3D { int X; int Y; int Z; };
inline Vector3D TransformVector(const Vec... | ALGO | 0.923487 | 4.856044 |
81ec4e1a-be61-4bf8-9a0b-ce51fbe839bf | arturremizov/Leetcode | 1497.Check-If-Array-Pairs-Are-Divisible-by-k.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
class Solution {
public:
bool canArrange(vector<int>& arr, int k) {
unordered_map<int, int> reminderCount;
for (int num : arr) {
int reminder = (num % k + k) % k;
reminderCount[reminder]++;
... | ALGO | 0.999833 | 5.8624 |
771bd5f9-572d-49ca-ae22-4b30a2397e9d | ilhomjonov-ogabek/exam-first | task_159.cpp | #include <iostream>
using namespace std;
int main() {
string word;
cout << "Please enter a word: ";
getline(cin, word);
for (int i = 0; i < word.length(); i++) {
if (isupper(word[i])) {
word[i] ='*';
}
}
cout << word << endl;
return 0;
} | TOOL | 0.914918 | 4.505146 |
c35a75ed-823b-4519-9754-d97cc4008c71 | chinnonae/ADT-Lab | Intro C++/Reverse.cpp | #include <iostream>
using namespace std;
int main(){
int n;
int x[1000];
cin >> n;
for(int i = 0 ; i < n ; i++){
cin >> x[i];
}
for( int j = n-1 ; j >= 0 ; j--){
cout << x[j] << endl;
}
}
| ALGO | 0.999805 | 3.887779 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.