uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6caa98fd-5b85-49e9-a663-332b577216b7 | Multigaming/WoW434 | src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp | /* ScriptData
SDName: Boss_Celebras_the_Cursed
SD%Complete: 100
SDComment:
SDCategory: Maraudon
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
enum Spells
{
SPELL_WRATH = 21807,
SPELL_ENTANGLINGROOTS = 12747,
SPELL_CORRUPT_FORCES = 21968
};
class celebr... | TOOL | 0.876665 | 7.132463 |
034bea92-d5a2-4e95-9c05-d4bb3beaa1fb | AbhinayaKandadi/WEEK1-DSA-CIPHERSCHOOLS | Lecture28-CipherSchools.cpp | // Q3 sorted LL to BST
// Q4 Print BST Range
// Q5 LCA of BST
// Q6 Unique BST Count -> Generation
// Q3 sorted LL to BST
TreeNode * buildTree1(vector<int> &sortedArr,int start,int end){
if(start>end) return NULL;
int mid=start+(end-start)/2;
TreeNode* newNode =new TreeNode(sortedArr[start]);
newNode... | ALGO | 0.999852 | 4.978658 |
9c2105a2-c5a8-45af-917d-eb18fbdde58e | shamikh1014/code | codeRemoveMinUse.cpp | #include<iostream>
using namespace std;
#include"codeRemoveMin.cpp"
int main(){
codeRemoveMin p;
p.insert(100);
p.insert(10);
p.insert(15);
p.insert(4);
p.insert(17);
p.insert(21);
p.insert(67);
cout<<p.getSize()<<endl;
cout<<p.getMin()<<endl;
while(!p.isEmpty()){
... | ALGO | 0.997196 | 4.276124 |
eeb7206b-d282-4eff-8210-4f3a81b2f493 | abhishek0508/cp-algo | DynamicProgramming/StringDP/edit_distance.cpp | // find the min no of operations required to convert str1 to str2
#include<bits/stdc++.h>
using namespace std;
int dp[1001][1001];
int helper(string s1, string s2, int i, int j){
if(i==s1.length()){
return s2.length()-j;
}
if(j==s2.length()){
return s1.length()-i;
}
if(dp[... | ALGO | 0.999999 | 5.632725 |
21d4eab8-6336-4bb4-996c-2db7c6443216 | ProdriveTechnologies/pd_cpu_compiler | libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/set_intersection_comp.pass.cpp | // <algorithm>
// template<InputIterator InIter1, InputIterator InIter2, typename OutIter,
// CopyConstructible Compare>
// requires OutputIterator<OutIter, InIter1::reference>
// && OutputIterator<OutIter, InIter2::reference>
// && Predicate<Compare, InIter1::value_type, InIter2::value_type... | TEST | 0.982976 | 6.899891 |
6444b8a6-e409-48d1-91df-1c6bc3f9aa3b | shivshankarzapbuild/training_example | Algorithms/power_of_two.cpp | #include<iostream>
using namespace std;
int main() {
long long int power, number=1;
cout<<"Enter any number as power of 2";
cin>>power;
for(int i = 1;i<=power;i++){
number = number *2;
}
cout<<"2 Power "<<power<<"="<<number;
return 0;
} | ALGO | 0.999257 | 4.916495 |
97b746a1-7338-4921-bdc2-0b2d81c41374 | sarvex/leetcode-malbolge | solution/1000-1099/1008.Construct Binary Search Tree from Preorder Traversal/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.999994 | 6.355505 |
88658be9-5ecf-4f5f-8ee7-f119e04e2b0a | onkarbartakke/DSA-Marathon | Stacks and Queues/Circular_Tour_petrol_pumps.cpp | #include <iostream>
#include <queue>
using namespace std;
struct petrolPump
{
int petrol;
int distance;
};
int tour(petrolPump p[], int n)
{
//Your code here
int balance, start, i, j;
for (i = 0; i < n; i++)
{
balance = p[i].petrol - p[i].distance;
if (balance >= 0)
{... | ALGO | 0.999748 | 4.752691 |
c46ae401-7f69-4bdc-8c57-0e1644f81139 | g-akca/hackerrank | 1 Week Preparation Kit/Day 6/Jesse and Cookies/Solution.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'cookies' function below.
*
* The function is expected to return an INTEGER.
* The function accepts following parameters:
* 1. INTEGER k
* 2. INTEG... | ALGO | 0.999958 | 4.969205 |
791668c1-63e5-4374-8f21-28c4ebbc1835 | jNiMhora/CDDLabs | revisedLab3/mutexExclusion.cpp | /*!author: Jessica Moore
date: March 2018
purpose: revised lab of the original lab 3 exercise: using semaphore to demo mutual exclusion */
#include "Semaphore.h"
#include <iostream>
#include <thread>
#include <mutex>
std::mutex m;
int count = 0;
/*!to ensure the threads do not run altogether, a mutex lock is p... | ALGO | 0.999455 | 5.175448 |
daa64905-26aa-46af-8a80-57a3d61ed4a0 | nikhilkumar22898/lab6 | 3.cpp | // library
//Q.3.MAXIMUM by value and by reference.
#include<iostream>
using namespace std;
/*
Write a program with a function that takes two int parameters, finds the maximum, then returns the maximum.
*/
int COMPARE1(int x, int y){
int z;
if (x>y){
z = x;
}
else {
z = y;
}
return z;
... | ALGO | 0.998676 | 4.548531 |
4739de10-4885-4a94-9d0f-2a2ffce8d311 | underbent/slashdiablo-maphack | BH/Common.cpp | #include <string>
#include <vector>
#include <Windows.h>
#include "Common.h"
using namespace std;
void Tokenize(const string& str,
vector<string>& tokens,
const string& delimiters = " ")
{
// Skip delimiters at beginning.
string::size_type lastPos = str.find_first_n... | TOOL | 0.9294 | 4.39993 |
07e56738-8517-4834-b495-58283bd1bb71 | PravinMandal/Supreme_3.0_DSA | 18. Maps & Tries/01. Lec 1/01_Map.cpp | #include<iostream>
#include<map>
#include<unordered_map>
using namespace std;
int main() {
unordered_map<int,string> uMap;
map<int,string> oMap;
uMap[2] = "baleno";
uMap[1] = "scorpio";
uMap[3] = "maruti";
oMap[2] = "baleno";
oMap[1] = "scorpio";
oMap[3] = "maruti";
cout<<"Print... | TOOL | 0.967676 | 4.337021 |
996cb97e-3221-4f0c-bb44-95315018004d | radsadorn/POSN | solve/ค.ร.น.cpp | #include <stdio.h>
#include <conio.h>
#include <stdlib.h>
int main()
{
int A, B, start;
scanf("%d\n %d", &A, &B);
{
if(A < B) start = A;
else start = B;
}
while(((A%start) != 0)||((B%start) != 0))
{
start = start-1;
}
printf("%d\n",start*(A/start)*(B/start));
... | ALGO | 0.999965 | 3.786451 |
145ca6b1-2e1d-4b9e-938f-8a44308558ff | HCIILAB/DeRPN | caffe/tools/compute_image_mean.cpp | #include <stdint.h>
#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include "boost/scoped_ptr.hpp"
#include "gflags/gflags.h"
#include "glog/logging.h"
#include "caffe/proto/caffe.pb.h"
#include "caffe/util/db.hpp"
#include "caffe/util/io.hpp"
using namespace caffe; // NOLINT(build/name... | DATA | 0.879728 | 6.438655 |
9c33494b-8bf5-4bab-904e-ec89350ae910 | Medfac9/UGR_Fundamentos_de_Programacion | Relación de ejercicios 3/Ejercicio 5/Ejercicio 5/main.cpp | #include <iostream>
using namespace std;
int main() {
string mvp = "Medfac9";
int pts_mvp = 1234;
string mvp2 = "Rafa";
int pts_mvp2 = 1200;
string aspirante;
int pts_aspirante;
cout << "Introduzca el nombre: " << endl;
cin >> aspirante;
cout << "Introduzca los puntos: " << end... | TOOL | 0.951585 | 4.146352 |
2ea5fb09-82a5-474e-bd56-a8c83ec4d074 | monikapatidar27/450_Question | 450 questions/Count pairs with given sum.cpp | #include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int getPairsCount(int arr[], int n, int k) {
int i,c=0;
int max=arr[0];
for (i=0;i<n;i++) {
if (max<arr[i])
max=arr[i]; }
int h[max+1]={0};
... | ALGO | 0.999822 | 5.637751 |
2e551fb9-a92c-4be8-9326-b34976b4e6bf | Aleksa-Stojano/prac2-s2-2022 | main-1-3.cpp |
#include <iostream>
using namespace std;
extern void count_digits(int array[4][4]);
int main() {
int array[4][4] = {{0, 1, 2, 3},
{3, 2, 1, 0},
{3, 5, 6, 1},
{3, 8, 3, 4}};
count_digits(array);
return 0;
} | ALGO | 0.994593 | 4.116214 |
d1e456e8-c712-4c55-9cb3-1e143f8758a8 | v7m0k/aed-cpp | caracteres/caracter.cpp | #include <iostream>
#include <string>
using namespace std;
int parametro(char c, string frase) {
for(int i=0; i<frase.size(); i++){
if(frase[i] == c) {
return i;
}
}
}
int main (int argc, char** argv) {
char c;
string frase;
cout << "\nDigite uma frase: ";
getline... | ALGO | 0.998072 | 5.124728 |
afa063ea-3795-45b2-976b-957b07d91dee | borispopoff/caelus-cml-unofficial | src/applications/utilities/preProcessing/mapFields/mapLagrangian.cpp | #include "MapLagrangianFields.hpp"
#include "passiveParticleCloud.hpp"
#include "meshSearch.hpp"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace CML
{
static const scalar perturbFactor = 1e-6;
// Special version of findCell that generates a cell guaranteed to be
// compatib... | ALGO | 0.996557 | 6.547559 |
2a5f3df5-9e5e-43fa-8fd9-977f9cd22a99 | sarvex/leetcode-basic | solution/2600-2699/2608.Shortest Cycle in a Graph/Solution.cpp | class Solution {
public:
int findShortestCycle(int n, vector<vector<int>>& edges) {
vector<vector<int>> g(n);
for (auto& e : edges) {
int u = e[0], v = e[1];
g[u].push_back(v);
g[v].push_back(u);
}
const int inf = 1 << 30;
auto bfs = [&](in... | ALGO | 0.999936 | 5.569103 |
7035768d-de50-437e-948a-814809fc6f37 | SHIVA-GARG/dsa-codes | dsa/tree2.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node*l;
node* r;
};
class queue{
private:
int size,front,rear;
node** q;
public:
queue(int);
bool isempty();
bool isfull();
void enque(node*);
node* deque();
};
queue::queue(int size){
this->size = size;
front = rear = -1;... | ALGO | 0.999951 | 3.866417 |
a2f017a6-161e-4d41-8086-a76524bf2f0f | pmosharrof21/DSS-2102 | Queue/Priority.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
class PriorityQueue {
private:
priority_queue<int> pq;
public:
void insert(int value) {
pq.push(value);
}
int extractMax() {
if (pq.empty()) {
cout << "Queue is empty!" << endl;
return -1;... | ALGO | 0.999318 | 4.463882 |
cafc433c-02d3-4249-acc4-4f4b9cda477e | neamul-haq/XPSC_DailyCodes | week4/Day4(26.6.23)/D_Twist_the_Permutation.cpp | /*
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define ndl '\n';
#define cyes cout << "YES" << '\n';
#define cno cout << "NO" << '\n';
#define print cout << ans << '\n';
#define ump unordered_map<int,int>mp;
#define mp map<int,int>mp;
int const mod = 1e9+7;
const ll inf = 1e18;
const ll N... | ALGO | 0.999997 | 4.086727 |
7ae87b17-e487-4930-af25-68b3e06f7d70 | LeeKeeEE/AlgorithmExercise | Binary Search/TemplateFromAI.cpp | #include <iostream>
#include <vector>
int binarySearch(const std::vector<int>& nums, int target) {
int left = 0;
int right = nums.size(); // 䣬right ʼΪ nums.size()
while (left < right) { // Ϊ right ǿ䣬 left < right
int mid = left + (right - left) / 2; // ֹ
if (nums[mid] == target) {
... | ALGO | 0.999912 | 6.827309 |
7931e8f3-7319-4673-aaf3-a98c9c77bf21 | SI-Abid/Hello-world | Weekly/w104b.cpp | #include "bits/stdc++.h"
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define be begin()
#define en end()
#define all(x) (x).begin(),(x).end()
typedef vector<int> vi;
typedef vector<ll> vll;
typedef set<int> si;
typ... | ALGO | 0.999757 | 3.360578 |
5e72172b-10a5-49b2-853f-1899401e57cb | rudeUltra/DSA | 0283-move-zeroes/0283-move-zeroes.cpp | class Solution {
public:
void moveZeroes(vector<int>& nums) {
int n=nums.size();
int left=0;
int right=0;
while(left<n && right<n){
if(nums[right]!=0){
int temp=nums[left];
nums[left]=nums[right];
nums[right]=temp;
... | ALGO | 0.999979 | 6.627658 |
632e202d-ac5e-4819-897e-bbf1dbee1803 | shinchan367/REVISION_SHEET | sliding window/continous subarray.cpp | /**************************************************************** C++ ****************************************************************/
//Approach-1 (Using Ordered Map)
//T.C : ~O(n) - Explained in the video why O(n) ?
//S.C : ~O(1) - Explained in the video why O(1) ?
class Solution {
public:
long long continuousSu... | ALGO | 0.999987 | 6.765486 |
238595eb-da8a-446c-a1df-e5c374e27dde | ChuannanTao/SecSMT | mitigations/gem5/src/systemc/tests/systemc/misc/user_guide/chpt4.2/stage1.cpp | /*****************************************************************************
stage1.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************... | ALGO | 0.985327 | 5.389411 |
737f22a0-f032-4cdf-b7d1-94ec987534cb | gagreen/Algorithm | codeUp/codeup-1027.cpp | #include <stdio.h>
int main()
{
int y, m, d;
scanf("%d.%d.%d", &y, &m, &d);
printf("%02d-%02d-%04d", d, m, y);
return 0;
}
| ALGO | 0.952954 | 4.06536 |
f0635e19-304a-4420-9a0c-3b0402107668 | ProgramMarcos/Autodidacta | C++(1)/calcInteresCompuesto.cpp | #include <iostream>
#include <conio.h>
#include <cmath> // Necesario para pow()
#include <clocale>
using namespace std;
int main() {
setlocale(LC_CTYPE, "Spanish"); // Para caracteres especiales en espaol (, , etc.)
float CapIni = 0;
float TasaInteres = 0;
int tiempo = 0;
float resultado = 0;
... | ALGO | 0.970056 | 3.961365 |
33971a8f-ec29-423e-8c38-e49feb472585 | hafizsameed/datascience_website | media/binaryTree_DTqyvsK.cpp | #include<iostream>
#include<stack>
using namespace std;
static int count=0;
class Node {
public:
int key;
Node *left;
Node *right;
public:
Node(int key) {
this->key = key;
left=NULL;
right=NULL;
}
};
Node *minValueNode(Node* node)
{
Node* current = node;
while (current && current->left != N... | ALGO | 0.999894 | 4.859814 |
1bec8fd4-b713-4c03-ba17-a6c348231c07 | Dankak0n/GameOfLife | tests/test.cpp | #include <life_game.h>
#include <iostream>
template <int HEIGHT, int WIDTH>
void my_judge(const std::array< std::array<int32_t, WIDTH>, HEIGHT >& arr,
std::array< std::array<int32_t, WIDTH>, HEIGHT >& res) {
static int32_t dx[] = {0, 0, 1, 1, 1, -1, -1, -1};
static int32_t dy[] = {-... | ALGO | 0.983792 | 5.739512 |
f195a5c9-05ac-4293-9825-d9f85b88945e | kmjp/procon | codeforce/901-950/947/d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999686 | 4.25416 |
52a19acc-da4b-4dab-9935-5b35b991021e | aadarshaAB/Discrete-Structure | Lab 2/GCD Eucledian algorithm.cpp | #include<iostream>
using namespace std;
void euclidean_Algorithm(int,int);
int main(){
int r1,r2;
cout<<"Enter Two numer for GCD calculation:";
cin>>r1>>r2;
euclidean_Algorithm(r1,r2);
}
void euclidean_Algorithm(int r1,int r2)
{
int r1_store,r2_store;
int r;
r1_store=r1;
r2_store=r2;
while (r2>0)
{
r=r1%r2;... | ALGO | 0.999376 | 4.003623 |
e14024f6-a524-4464-822d-e14971f11727 | RitabrataDas343/Codeforces-Solutions | 800/Creep.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t, n, k;
cin >> t;
while(t--){
cin >> n >> k;
int score = abs(k - n), s = 0;
string str = "";
char maj = (n >= k) ? '0':'1';
char min = (maj == '1')? '0': '1';
for(int i = 0; i < (k + n); i++)... | ALGO | 0.999957 | 4.056348 |
e181f2c5-4c07-484c-9b10-eaf37228bf6b | r0r0k/BOJ | class4/15654/15654.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int N, M;
int number[8]; // 입력으로 받은 숫자를 저장하는 배열
int arr[8]; // 출력할 수열을 저장할 배열
bool is_used[8]; // number의 index가 사용되었는지 저장하는 배열
void foo(int size)
{
if (size == M)
{
for (int i = 0; i < M; i++)
{
cout << arr[i];
... | ALGO | 0.99998 | 4.472464 |
5e38c8c1-4649-4617-bf55-314653caa858 | sahil2050/spoj | FREQUENT.cpp | #include<bits/stdc++.h>
using namespace std;
#define node struct TreeNode
struct TreeNode{
int mode,mode_freq,left,left_freq,right,right_freq;
TreeNode(int a=0,int b=0,int c=0,int d=0,int e=0,int f=0){
mode=a,mode_freq=b,left=c,left_freq=d,right=e,right_freq=f;
}
};
int const N=1e5;
node t[2*N];
i... | ALGO | 0.999964 | 4.281961 |
684c1a15-70d5-4eca-b9d3-3faf7ff7a123 | Les-opossums/Ros2_base_cdf | obstacle_detector_2/src/obstacle_tracker.cpp | /*
* Author: Mateusz Przybyla
*/
#include "obstacle_detector/obstacle_tracker.h"
using namespace std::chrono_literals;
using namespace obstacle_detector;
using namespace arma;
using namespace std;
ObstacleTracker::ObstacleTracker(std::shared_ptr<rclcpp::Node> nh, std::shared_ptr<rclcpp::Node> nh_local){
nh_ = nh... | TOOL | 0.985334 | 6.548067 |
f8140e06-ba54-488b-b918-c71881327f59 | mononokehime14/Leetcode | c++/array/countBinarySubstrings.cpp | using namespace std;
/**
* 696. Count Binary Substrings
* 想不到的easy题 我第一开始想套用palindrome substring的背向双指针方法 但是这样是会TLE的 最坏复杂度应该是n平方
* 然后我又在想dp 但是dp似乎并没有子问题存在 知道ij中间的binary substrings数量并不能帮助我们计算ij
* 答案是考虑以i结尾的binary substring 如果i是1 前面有x个连续的1 那么合法的substring只有一个就是前面也连续有x+1个0
* 那么我们就one pass计算consecutive 1 or 0, 数字变化的时候换
... | ALGO | 0.99999 | 5.927087 |
cfdf326c-5ae9-46a2-ad39-11cf574897fe | gloriamok/baekjoon-online-judge-codetree-solution-cpp | baekjoon_n14890_Implementation.cpp | #include <iostream>
using namespace std;
int n, l, numPath = 0;
void findNumPath(int map[100][100]) {
for (int i = 0; i < n; i++) {
int s = 0, e = 0;
bool path = 1;
while (path && e < n) { // 한 행씩 보기
e++;
if (!(e < n && map[i][s] == map[i][e])) { // e가 n 이상이거나 i번째 행에서 s번째와 e번째 열의 map의 값이 같지 않을 경우
if ... | ALGO | 0.999964 | 3.341652 |
b3861796-0883-4004-885c-f1e972089f52 | ntanthedev/Cpp | mrs.Minh/de hsg/de18/bai13.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
const long long MOD = 1e9+7;
const long long N = 1e6+9;
ll n, x, a[N], s[N];
unordered_map<ll, ll>M;
void solve(){
ll res = 0;
for(int i = 1; i <= n; i++){
if(M[s[i] - x] != 0)
res+= M[s[i] - x];
}
... | ALGO | 0.999989 | 4.252303 |
901ccd21-f1c2-4823-adc7-e5c9e66390db | HJY214/Code_Practise | repos/file_stream/write_binary.cpp | #include <iostream>
using namespace std;
#include <fstream>
//二进制 写文件
class Person
{
public:
char m_Name[64];
int m_Age;
};
void test1(){
//1、创建流对象
ofstream ofs("person.txt",ios::out | ios::binary);
//2、打开文件
//ofs.open("person.txt",ios::out | ios::binary);
//3、写入文件
Person p = {"张三",18}... | TOOL | 0.883323 | 3.569192 |
0bfcaead-4d96-4a68-995f-15afc403b58a | HectorPuch/cpp | reviewExercises03/ejercicio06.cpp | #include <iostream>
int main() {
float primerLadoTriangulo;
float segundoLadoTriangulo;
float tercerLadoTriangulo;
std::cout << "Introduzca el primer lado de un tringulo:" << std::endl;
std::cin >> primerLadoTriangulo;
std::cout << "" << std::endl;
std::cout << "Introduzca el segundo lado de un tringulo:" <<... | ALGO | 0.995426 | 4.174934 |
b7a7f493-6a9f-436a-abfb-c2b45162221f | prady7330/c-comp-prograamming- | completestr.cpp | #include<iostream>
#include<sstream>
using namespace std;
int main(){
string s,s1,s2,s3,s4,s5;
long int t,i;
long int a,b;
cin>>t;
for(i=0;i<t+1;++i){
getline(cin,s);
istringstream iss(s);
iss>>s1>>s2>>s3>>s4>>s5;
if(s1=="?"){
istringstream ist(s3);
ist>>a;
istringstream ists(s5);
ists>>b;
c... | ALGO | 0.998634 | 3.064603 |
efdfa910-8821-429c-8b14-6c4840b97978 | ishandutta2007/codeforces | tutis/normal/1077/A.cpp | /*input
6
5 2 3
100 1 4
1 10 5
1000000000 1 6
1 1 1000000000
1 1 999999999
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int main()
{
ios_base::sync_with_stdio(false);
ll t;
cin >> t;
while (t--)
{
ll a, b, k;
cin >> a >> b >> k;
if (k % 2 == 1)
{
ll c = ... | ALGO | 0.99979 | 4.029973 |
dd5972f5-4661-4ef1-a69b-19918b098e3d | GridinD/Comp_math | montecarlo.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>
using namespace std;
double monte_carlo_pi(int n) {
srand(time(NULL));
int count = 0;
for (int i = 0; i < n; i++) {
double x = (double) rand() / RAND_MAX;
double y = (double) rand() / RAND_MAX;
if (sqrt(x * x +... | ALGO | 0.999772 | 5.860741 |
6fc1e11f-03fa-48c6-8fdd-85115eca95b0 | QinghaoHu/programming | algo/c/ac164/sol.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = a; i >= n; i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define SZ(x) ((int)x.size())
#defin... | ALGO | 0.999965 | 4.479476 |
9b59b1d7-5776-403f-9fe1-98744c054b08 | omagonmar/nosphereskirt | FitSKIRT/galib/GATreeBASE.cpp | #include "GATreeBASE.h"
#include "gaerror.h"
static int _GATreeSize(GANodeBASE *);
static int _GATreeDepth(GANodeBASE *);
GANodeBASE * _GATreeTraverse(unsigned int, unsigned int &, GANodeBASE *);
int _GATreeCompare(GANodeBASE * anode, GANodeBASE * bnode);
// Traverse up the tree until we find the root node. If the n... | ALGO | 0.99746 | 6.370929 |
ca372066-7dcc-40cd-aaa4-b226b073d11d | aryika78/C-Programming-and-DataStructures | C/Data_Structures/Singly_LL.CPP | #include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<ctype.h>
struct node
{
int info1;
int info2;
struct node *next;
};
typedef struct node NODE;
void CREATE_LINK_LIST(NODE*);// declaration of function
void Display(NODE*);// declaration of function
void main()
{
NODE *head;
clrscr();
head=(NODE*)ma... | ALGO | 0.987459 | 3.18267 |
03b6bb04-a8b2-486d-9e39-91687feb24de | k2font/atcoder | abc079_C.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
return string(1, val);
}
int char_to_int(char val) {
return val - '0';
}
int main() {
string s; cin >> s;
... | ALGO | 0.999784 | 4.171666 |
d60f8e68-88b7-4738-a626-94a9b4f728e1 | GCongCong/C-PlusPlus | STL/迭代器/流式迭代器--输出流.cpp | int main()
{
int a[]={3,2,1,5,4};
int len=sizeof(a)/sizeof(a[0]);
std::vector<int> vec(a,a+len);
std::copy(vec.begin(),vec.end(),std::ostream_iterator<int>(std::cout,"+"));
std::cout<<std::endl;
}
| TOOL | 0.983168 | 3.743448 |
ac275608-da92-4bbe-9999-ca740c60a978 | DiegoDA04/CodeForces | A_Insomnia_cure.cpp | #include<bits/stdc++.h>
#define ll long long
#define lli long long int
#define vi vector<int>
#define mpii map<int,int>
using namespace std;
void solve()
{
int k, l, m, n, d;
cin >> k >> l >> m >> n >> d;
int ct = 0;
for (int i = 1; i <= d; i++)
{
if(i % k == 0 || i % l == 0 || i % m == 0 |... | ALGO | 0.999699 | 3.822262 |
9214b15e-d9cc-4af0-865b-f618854f6d00 | user3301/hackerrank | questions/BonAppetit.cpp | //
// Created by user3301 on 2019-04-27.
//
#include <vector>
#include <iostream>
class BonAppetit
{
public:
void bonAppetit(std::vector<int> bill, int k, int b) {
int shared = 0;
for (int i = 0; i < bill.size(); ++i) {
if(i == k) continue;
shared += bill[i];
}
... | ALGO | 0.999672 | 3.492843 |
0e33d9e5-acea-4202-be96-4e901e074f7a | 3gx/vmath | old/simd.h/SoA/fac++11.cpp | #include <iostream>
#include <stdexcept>
// constexpr functions use recursion rather than iteration
constexpr int factorial(int n)
{
return n <= 1 ? 1 : (n * factorial(n-1));
}
// literal class
class conststr {
const char * p;
std::size_t sz;
public:
template<std::size_t N>
constexpr conststr(const char... | TOOL | 0.99463 | 7.655018 |
1fbcf761-3434-47ab-a38d-ac3befb314ed | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-cot-gpt4/Codenet/p00424/313142143/response_2.cpp | #include <iostream>
int main() {
std::cin.tie(NULL);
std::ios_base::sync_with_stdio(false);
int n;
for (char a, b; std::cin >> n, n; std::cout << "\n") {
int d[256] = {};
for (; n--; d[a] = b - a)
std::cin >> a >> b;
for (std::cin >> n; n--; std::cout << static_cast<char>(a + d[a]))
s... | ALGO | 0.998623 | 4.033671 |
4917e0a6-2a40-4fb5-8b95-6836a051d4ff | Lizhmq/Introduction2Computing-Hw | 第一阶段/第一阶段编程练习1/4.cpp | /*****
* 描述
输入一个整数,判断它能否被3,5,7整除,并输出以下信息:
(1)能同时被3,5,7整除(直接输出3 5 7,每个数中间一个空格);
(2)能被其中两个数整除(输出两个数,小的在前,大的在后。例如:3 5或者 3 7或者5 7,中间用空格分隔)
(3)能被其中一个数整除(输出这个除数)
(4)不能被任何数整除;(输出小写字符n)
* 关于输入
一个整数
* 关于输出
实现题目的要求
*****/
#include <iostream>
using namespace std;
#define N_NUM 3
int main()
{
int num, arr[N_NUM] = {3, 5,... | ALGO | 0.999142 | 3.789266 |
77cb9b07-f150-4fe4-9bbb-2a84170a53b1 | kefhuang/leetcode | problems/27.remove-element.cpp | /*
* @lc app=leetcode id=27 lang=cpp
*
* [27] Remove Element
*/
// @lc code=start
class Solution {
public:
int removeElement(vector<int>& nums, int val) {
if (nums.size() == 0) return 0;
int idx = 0;
for (int i = 0; i < nums.size(); i++) {
if (nums[i] != val) {
... | ALGO | 0.999035 | 6.590049 |
e1aa979a-3311-403c-9eea-e544517061f1 | EPFL-LGG/CurvedWeaving | elastic_rods/3rdparty/libigl/include/igl/crouzeix_raviart_massmatrix.cpp | #include "is_edge_manifold.h"
#include "doublearea.h"
#include "volume.h"
#include <cassert>
#include <vector>
template <typename MT, typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedEMAP>
void igl::crouzeix_raviart_massmatrix(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::Matri... | ALGO | 0.984722 | 6.560311 |
6471a3d3-18f0-4904-a25a-9df0d7dcbc75 | ishandutta2007/codeforces | couplefire/normal/1329/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 1000000000000000009ll
long long up(long long a, long long d){return (a+d-1)/d;}
long long down(long long a, long long d){return a/d;}
void solve(){
long long n, m, k; cin >> n >> m >> k;
long long pr = 0;
vector<long long> vals(m+1);
for(int i ... | ALGO | 0.999982 | 3.627336 |
250c67ab-94fd-4623-a866-6d1f0111fe6c | Wankupi/cpp | 数学/[NOI2018]屠龙勇士.cpp | #include <cstdio>
#include <set>
using namespace std;
typedef long long ll;
typedef multiset<ll>::iterator Ptr;
int const maxn = 100003;
inline ll max(ll a, ll b) { return a < b ? b : a; }
int n = 0, m = 0;
ll a[maxn], p[maxn], rw[maxn];
ll c[maxn];
multiset<ll> sw;
struct Eq {
Eq(ll A, ll M) :a(A), m(M) {}
ll a, m... | ALGO | 0.999941 | 3.430282 |
6e3bc577-146b-4487-9e5b-f97e1c905159 | jesushilarioh/C-Plus-Plus | Chapter-3-Expressions-and-Interactivity/Review Questions and Exercises/Short Answer/09.cpp | /********************************************************************
*
* 09. Rewrite the following variable definitions so the variable is
* is a named constant.
*
* int rate;
*
* Jesus Hilario Hernandez
* January 2nd 2018
*
*
********************************************************************/
#include... | CONFIG | 0.956006 | 3.742766 |
39f4ef04-941c-4d0f-97c4-197a9a7b873e | MikeZylka/Intel_CET_Emulator | pin_root/source/tools/Mmx/mmx_test1_app.cpp | #include <windows.h>
#include <stdio.h>
extern "C" int MMXSequence(unsigned int a, unsigned int b, unsigned int c, UINT64* aConcaTb);
int main()
{
UINT64 aConcaTb;
UINT32* ptr = (UINT32*)(&aConcaTb);
UINT32* ptr1 = ptr + 1;
unsigned int res = MMXSequence(0xdeadbeef, 0xbaadf00d, 0xfeedf00d, &aC... | ALGO | 0.982171 | 3.820237 |
0c3d0cad-1509-4df2-8bf3-58e974b8048e | yplusplus/aabbyy | 20140219/i.cpp | #include <bits/stdc++.h>
using namespace std;
typedef double DB;
typedef pair<DB, DB> Point;
#define x first
#define y second
const DB EPS = 1e-10;
const DB PI = acos(-1.0);
const int T = 333;
DB x[2][3];
bool input() {
DB sum = 0;
for (int i = 0; i < 2; i++) for (int j = 0; j < 3; j++) {
cin >> x[i][j];
sum +=... | ALGO | 0.999883 | 3.77699 |
6c0ba57a-9684-493e-a41e-7144edd90b5d | ftreier/CGRA408_FinalProject | pbrt-v3/src/shapes/cone.cpp | // shapes/cone.cpp*
#include "shapes/cone.h"
#include "paramset.h"
#include "efloat.h"
#include "stats.h"
namespace pbrt {
// Cone Method Definitions
Cone::Cone(const Transform *o2w, const Transform *w2o, bool ro, Float height,
Float radius, Float phiMax)
: Shape(o2w, w2o, ro),
radius(radius),
... | ALGO | 0.979107 | 7.143877 |
38856774-d183-47cf-8a6b-07f7937a1b4a | yoowonsuk/cpp | ch1/SimpleAdder.cpp | #include <iostream>
int main(void)
{
int val1;
std::cout<<"first integer? ";
std::cin>>val1;
int val2;
std::cout<<"second integer? ";
std::cin>>val2;
int result = val1 + val2;
std::cout<<"result: "<<result<<std::endl;
return 0;
}
| TOOL | 0.87698 | 4.460929 |
6698f26e-6a0a-4817-8917-c228319496d7 | mrcrdg/Algorithms_in_C | ex_36.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
/*36. Faa um programa que preenche uma matriz 4 x 4
com o produto do valor da linha e da coluna de cada elemento.
Em seguida, imprima na tela a matriz.
*/
int main (){
int matriz[4][4];
int i, j;
/*for (i = 1; i < 5; i++){
for ( j = 1; j < 5; j++){... | ALGO | 0.989753 | 3.249165 |
00509c1b-32af-4696-a2d8-bd8eb97b97a0 | coding-blocks-archives/data-structures-online-course-cpp | APP/Lecture-01 Recursion, STL/vector.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
bool cmp(int a,int b){
cout<<"Comparing "<<a<<"and "<<b<<endl;
return a>b;
}
int main(){
vector<int> v;
for(int i=5;i<=10;i++){
v.push_back(i*i);
}
v.push_back(10);
// function as a argument
sort(v.begin(),v.end(),cmp);
for(in... | ALGO | 0.999554 | 4.190869 |
3878ec8f-41d3-44e4-8311-0db36ace1646 | harshitchugh001/-week1-DP4-CipherSchools | fibinoccinumber.cpp | #include<bits/stdc++.h>
using namespace std;
int fib(int n) {
if(n==0)
return 0;
if(n==1)
return 1;
return fib(n-1) + fib(n-2);
}
int main()
{
int n;
cout<<"Enter the number = ";
cin>>n;
cout<<"Fibonacci Number = "<<fib(n)<<endl;
return 0;
} | ALGO | 0.999603 | 4.495588 |
ce1af748-a2f7-4f6e-aa09-addc47f42a7a | Ruyka/Project-Practice | Rock-Paper-Scissors/Rock-Paper-Scissors/Game.cpp | #include"Game.h"
#include<string>
#include<stdio.h>
#include<conio.h>
AI::AI(){
Pattern_Discovered = 0;
mode = 0;
status = 0;
count = 0;
sPrev = 1;
itr = 0;
}
bool mode;
int count;
char AI::Default_Play(){
if (!status || mode){
if (!sPrev)
return 1;
if (sPrev == 1)
return 2;
else
return 0;
}
... | ALGO | 0.99018 | 3.462919 |
078f10bf-07ba-4ac2-b828-51941f243281 | vvkarina/OS | lab5/src/second_lib.cpp | #include "lib.h"
int PrimeCount(int start, int finish)
{
printf("PrimeCount with sieve of Eratosthenes\n");
int curent_number;
int *prime_number_list;
int is_prime;
finish = finish - 1;
prime_number_list = (int *)malloc(finish * sizeof(int));
for (int index = 0; index < finish; ++index)
... | ALGO | 0.999179 | 3.318822 |
6626bdf6-461b-4e83-8601-774932897c77 | neelp1030/algos-ds | deque/deque.cpp | /*
deque.cpp
Purpose: Class to represent a deque.
Provides the following services (outputting success/failure accordingly):
1) Add an element to the front of the deque.
2) Add an element to the back of the deque.
3) Remove an element from the front of the deque.
4) Remove an element from... | TOOL | 0.850916 | 6.43609 |
65ef5bbc-5170-43e2-ad1a-f2995fc7fd4c | EzraCerpac/CSE_minor_octp | lammps-23Jun2022/src/MC/fix_atom_swap.cpp | /* ----------------------------------------------------------------------
Contributing authors: Paul Crozier (SNL)
Alexander Stukowski
------------------------------------------------------------------------- */
#include "fix_atom_swap.h"
#include "angle.h"
#include "atom.h"
#include "bond... | ALGO | 0.990778 | 6.760344 |
215e0ba1-1c48-47c6-b8a1-15f54bf0bc52 | Ansh1693/cpp | stcks/stackBasic.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
class Stack{
public:
int *arr;
int top;
int size;
//functions
Stack(int size){
this->size=size;
arr= new int[size];
top=-1;
}
... | ALGO | 0.998602 | 4.054413 |
84636ce7-4413-4098-8791-c5c1c3bcdcbf | Graham-ella/leetcode | 每日一题/lc/lc25k个一组翻转链表.cpp | /*
牛的,需要多看
用到的知识: 递归 + 倒转链表
麻麻的
这里给出倒转链表的代码:
class Solution {
public:
ListNode* reverseList(ListNode* head) {
ListNode *prev = nullptr;
ListNode *cur = head;
while (cur)
{
ListNode *next = cur->next;
cur->next = prev;
prev = cur, cur = next;
... | ALGO | 0.999998 | 5.333334 |
321394e7-b658-4131-8c20-857a6fdf14fc | notomorrow/hypscript | src/core/lib/Bitset.cpp | #include <core/lib/Bitset.hpp>
#ifdef HYP_WINDOWS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include <bitset> // for output
namespace hyperion {
namespace containers {
namespace detail {
DynBitset::DynBitset(UInt64 value)
: m_blocks { BlockType(value & 0xFFFFFFFF), BlockType((value & (0xFFFFFFFFu... | TOOL | 0.905788 | 6.704234 |
760c7220-2561-443f-98cd-0c6d4c13bcc9 | YanLi26/leetcode | 107. Binary Tree Level Order Traversal II.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
/*refer:
http://www.cnblogs.com/grandyang/p/4051326.html*/
class Solution {
public:
vector<vector<int>> levelOrderB... | ALGO | 0.999991 | 6.01806 |
5ac478e8-56d9-455b-a4de-055b8c1ca13a | DangThanh1903/C-code-PTIT | PhanTichThuaSoNguyenTo.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long num, count = 0;
long long i = 3;
cin >> num;
while (num > 1) {
while (num % 2 == 0) {
num /= 2;
count++;
}
if (count > 0) cout << "2^" << count << " * ";
count = 0;
while (num % i == 0) {
num /= i;
count++;
}
if (count ... | ALGO | 0.999954 | 4.091872 |
a1f9fdb3-4232-47bc-b9da-598179f40651 | PAMCH/Coding_Magic_Iron | ex7-3/ex7-3/ex7-3.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
int main()
{
int a[6][6] = { {0},{0,1,2,3,4,5},
{0,6,7,8,9,10},
{0,11,12,13,14,15},
{0,16,17,18,19,20},
{0,21,22,23,24,25}
};
int i, j, sum = 0;
for (i = 1; i <= 5; i++) {
for (j = 1; j <= 6-i; j++) {
sum += a[i][j];
}
}
printf... | ALGO | 0.997997 | 3.513093 |
5b20c693-c738-498a-a3e4-bdcbe8ab344e | harshrajhrj/problem-solving-lc | 108. Convert Sorted Array to Binary Search Tree/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.999999 | 6.761722 |
8417cb77-d763-4915-8809-29db7ba18da4 | ho04029/tiktok_clone | 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.998733 | 6.76775 |
a22a0a8d-d8fb-460a-8196-99039a0fce1e | gustavofadel/Exercises | Kattis/islandhopping.cpp | # include <bits/stdc++.h>
using namespace std;
# define MAXM 760
struct Edge {
double w;
int u, v;
};
struct Point {
double x, y;
};
int m, n, parent[MAXM];
double distance (double x1, double y1, double x2, double y2) {
return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
bool comparison (Edge a... | ALGO | 0.999928 | 4.233843 |
9059d520-a5cb-4832-8f58-a995d670089b | nadimnesar/Online-Judges-Accepted-Solutions | CodeForces/12C/37592843_AC_15ms_16kB.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define llu long long unsigned int
#define endl '\n'
#define in insert
#define ppb pop_back
#define ppf pop_front
#define pb push_bac... | ALGO | 0.999988 | 3.637958 |
65443ccf-9d06-4180-bb20-680512ccd464 | maithedung/OOP-C | PTTKGT/De Quy/ConvertBin.cpp | #include <bits/stdc++.h>
using namespace std;
void ConvertReverseBin1(int n)
{
if (n == 0)
return;
else
{
return ConvertReverseBin1(n - 1);
cout << n;
}
}
void ConvertReverseBin2(int n)
{
if (n == 0)
return;
else
{
cout << n % 2;
return Conve... | ALGO | 0.999781 | 4.054648 |
1bd7fc49-0447-4523-9a7b-9d1b2eb3e1c5 | SteveHanss/OI-Codes | Atcoder/ABC390/3.cpp | #include <iostream>
#include <algorithm>
#include <time.h>
#include <cstring>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int N = 1010;
int n, m;
char g[N][N];
int main()
{
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i ++ )
scanf("%s", g[i]);
int ey = -1, sx... | ALGO | 0.999922 | 4.083598 |
96821ec1-e1a6-4c95-b54e-c157490be891 | ehnryx/acm | codeforces/1254/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long ll;... | ALGO | 0.999911 | 3.670791 |
a7f9bcf6-5778-44f4-a941-1ee1b5765ba9 | Mr-Python-in-China/LuoguProblem | Luogu_AT_agc_025_d.cpp | #include <bits/extc++.h>
using namespace std;
namespace pbds = __gnu_pbds;
using ui = unsigned int;
using uli = unsigned long long int;
using li = long long int;
using ic = signed char;
template <typename T> T sqr(T x) { return x * x; }
void color(size_t x, size_t y, vector<vector<ic>>& c, bool b, ui d) {
if (c[x][y]... | ALGO | 0.999864 | 3.988766 |
9d053935-e61d-48b5-905e-23703032157a | nayemuddinn/Competitive-programming | Codeforces/JOE is on TV! 1293B.cpp | /**
.
author-> NATE
.
**/
#include<bits/stdc++.h>
using namespace std;
#define first_in_out ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define For(i,n) for(ll i=0;i<n;i++)
#define For2(i,n) for(ll i=1;i<=n;i++)
#define For3(i, j, n) for (ll j = i; j <= n; j++)
#def... | ALGO | 0.998708 | 4.174813 |
853ab21c-9d2d-40e5-806e-e179d7a6aac3 | BonexGoo/Boss2D | Boss2D/addon/opencv-3.4.7_for_boss/modules/videostab/src/inpainting.cpp | #include "precomp.hpp"
#include <queue>
#include "opencv2/videostab/inpainting.hpp"
#include "opencv2/videostab/global_motion.hpp"
#include "opencv2/videostab/fast_marching.hpp"
#include "opencv2/videostab/ring_buffer.hpp"
#include "opencv2/opencv_modules.hpp"
namespace cv
{
namespace videostab
{
void InpaintingPipel... | TOOL | 0.937178 | 6.608719 |
a709b565-6ace-4a27-b5b8-b2d5919c0639 | ArfanAlbaar/DISBAR051122 | ALGO 2/ParameterMasukan.cpp | #include<iostream>
using namespace std;
void Luas(int a, int b); //Prototype Procedure
//PARAMETER MASUKAN
int main(){
int panjang=5,lebar=3;
Luas(panjang,lebar);
}
void Luas(int p, int l){
int luas;
luas=p*l;
cout<<"Luas = "<<luas<<endl;
}
| TOOL | 0.969268 | 4.243475 |
a7ca6975-a1f8-4079-a58e-5c0327de80e2 | pskshyam/Extended-Kalman-Filter | src/tools.cpp | #include "tools.h"
#include <iostream>
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
using std::cout;
using std::endl;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
/*... | ALGO | 0.991844 | 6.218193 |
087ee96d-ea87-4e3e-ab08-a43e2681cfce | chetanpant11/InterviewBit-Solution | Parity Queries.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
unsigned long long int mod =1e9+7;
const int maxn=262144+5;
int num[maxn];
void solve(vector<int>&A,vector<char>&B, int n)
{
memset(num,0,sizeof(num));
int t = A.size();
int j = 0;
vector<int> ans;
while(t--)
{
long lo... | ALGO | 0.999949 | 3.74035 |
b42f4f5f-c1d9-4ee9-9546-2e26eb809608 | cmrohityadav/DSA-prac | Searching/Binary Search/12_mountainArray.cpp | #include<iostream>
#include<vector>
using namespace std;
int peakInMountainArray(vector<int>&arr){
int start=0;
int end=arr.size()-1;
int ans=-1;
while(start<=end){
int mid=start+(end-start)/2;
if(arr[mid]>arr[mid-1]){
// on inc curve
ans=mid;
start=m... | ALGO | 0.999975 | 5.142683 |
39a2a789-b61f-4d2f-b3d5-8ceecd69f6b9 | nileshwankhede03/basic-cpp-programs | .history/pattern8_20250218202107.cpp | #include "./stdc++.h"
using namespace std;
void print8(int n)
{
for(int i = 0; i < n; i++)
{
//space
for(int j = 0; j < i; j++)
{
cout << " ";
}
// star
for(int k = 0; k < 2n2 * i + 1; k++)
{
cout << "*";
}
// sp... | ALGO | 0.999833 | 4.594935 |
561396fd-43d7-4151-83e7-ab55f546d1e1 | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8/pkwv/3264486_5654742835396608_pkwv.cpp | #include<bits/stdc++.h>
#include<stdio.h>
#include<string.h>
using namespace std;
typedef long long ll;
typedef double db;
const int N = 1005;
int occupy[N], Left[N],Right[N];
int Min[N], Max[N];
int main() {
#ifdef PKWV
freopen("C-small-1-attempt0.in","r",stdin);
freopen("C-small-1-attempt0.out","w",stdout)... | ALGO | 0.999857 | 3.449271 |
748252f9-c57d-4e5a-a5e4-94f5bfde67a8 | SurbhiYadav03/Leetcode-it | Array/CanMakeArithmeticProgressionFromSequence.cpp | class Solution {
public:
bool canMakeArithmeticProgression(vector<int>& arr) {
sort(arr.begin(),arr.end());
int diff = arr[1]-arr[0];
int i=1,j=2;
while(j<arr.size())
{
if(arr[j]-arr[i]!=diff){
return false;
}
i+... | ALGO | 0.999843 | 5.641305 |
0f481b35-e6e9-439c-8c5c-58525c13b5f5 | pavja2/eoshield | contracts/libc++/upstream/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find_pred.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, EquivalenceRelation<auto, Iter::value_type> Pred>
// requires CopyConstructible<Pred>
// Iter
// adjacent_find(Iter first, Iter last, Pred pred);
#include <algorithm>
#include <functional>
#include <cassert>
#include "test_iterators.h"
int main()
{
int ia[]... | TEST | 0.997884 | 6.080983 |
c938fd6d-84b0-431c-9c2c-c8c7ae9d1510 | JsimonH/CPP | ConverDateToDay.cpp | /*
输入某年某月某日,判断这一天是这一年的第几天?
*/
#include<iostream>
using namespace std;
int main()
{
static int monthDays[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int year, month, day;
//不断接收输入测试
while (cin >> year >> month >> day)
{
int n = 0;
// 累加[1,month-1]月的天数
for (int i = 1; i < month; ++i... | ALGO | 0.999362 | 3.827754 |
9ce173ad-42c7-463e-9c34-cd4982a38c42 | fishy15/competitive_programming | online/cf/638/beauty.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <array>
#include <algorithm>
#include <utility>
#include <map>
#include <queue>
#include <set>
#include <cmath>
#define ll long long
#define eps 1e-8
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3f
// ... | ALGO | 0.999726 | 4.16139 |
d982818f-fb44-4219-ad99-9e0998b70d74 | Raghav1209/Leetcode_practice_questions | Topological sort - GFG/topological-sort.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
void DFS(vector<int> adj[],vector<bool> &vis,stack<int> &st,int s){
vis[s] = true;
for(auto v : adj[s]){
if(vis[v]==false){
DFS(adj,vis,st,v);
}
... | ALGO | 0.999947 | 6.728453 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.