uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
0eaf5dd8-ec74-4db7-8a20-f6e84e3c8b20 | avetisminasyan/cpp_repo | hom3.cpp | #include <iostream>
#include <cstring>
bool check_is_prime(int num);
/*int main ()
{ int num;
std::cout<<"Enter number-";
std::cin>>num;
bool check=check_is_prime(num);
//std::cout<<check<<std::endl;
if (check==true)
{
std::cout<<num<<"-ISprime"<<std::endl;
}
else
{
std::cout<<num<<"-Is not prime"<<std::e... | ALGO | 0.999524 | 3.643567 |
dba05f5a-ce33-48e9-9d9e-9461750d4c2f | ishandutta2007/codeforces | hanbyeol_/normal/1637/C.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false); cin.tie(0);
int T; cin >> T; while(T--)
{
int N; cin >> N;
vector<int> V(N);
for(int i=0; i<N; ++i) cin >> V[i];
if(N == 3 && V[1] % 2 == 1)
{
cout << -1 << '\n';
... | ALGO | 0.999782 | 4.543734 |
413e9d97-5bf2-403b-b6f3-39a22ff1b49e | seranu/nsp | src/rules/min_hours_per_week_rule.cpp | #include "rules/min_hours_per_week_rule.h"
#include <sstream>
#include <string>
#include "log.h"
#include "utils.h"
namespace nsp {
void MinHoursPerWeekRule::search(
const Schedule &schedule,
std::function<void(const Employee &, int, int, int)> onFail) const {
int hoursThisWeek = 0;
for (auto const &[emp, ... | ALGO | 0.997222 | 6.316556 |
e1ea4442-5c54-41be-8825-4ad3f9e8ba0d | somyagupta-2910/DSA-Problems | Basic_Problems/complement_an_integers_bits.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main(){
int n, m;
cin>>n;
m=n;
int mask=0;
//edge case
if (n==0){
cout<<1;
}
else{
// We create a mask that will be multiplied with complement of input number. This is becasue when the input number is comple... | ALGO | 0.999972 | 4.673446 |
1cd90624-7402-4c1f-9a0c-d34344c99c49 | broitman-eugeny/lab1 | Fraction.cpp | #include "Fraction.h"
int Fraction::Count = 0;
Fraction::Fraction():Numerator(1), Denominator(1)
{
Count++;
}
Fraction::Fraction(int N, int D) : Numerator(N), Denominator(D)
{
Count++;
}
Fraction::Fraction(Fraction & F) : Numerator(F.Numerator), Denominator(F.Denominator)
{
Count++;
}
Fraction::~Fraction()
{
Count-... | TOOL | 0.933098 | 4.508746 |
66bfa791-91bd-4e1b-a259-4368f22209db | webdeveloper4gupta/c-basic-level | NAMESPACE_PREPROCESSOR/4.cpp | #include<iostream>
using namespace std;
#define g(x,y) (x+y)
#define k(x,y) (x*x*x)
int main()
{
cout<<g(2,4)<<endl;
cout<<k(3,3)<<endl;
} | TOOL | 0.992428 | 3.118685 |
bc250b03-872d-401d-89c5-0f16227a80eb | MiguelRojas-05/resolviendo_problemas | codeforces/div3_practica_icpc/a.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
const ll MOD = 1e9+7;
const ll INF = 1e18;
void solve() {
int n; cin >> n ;
if(n%2 == 0) cout << "Sakurako"<<'\n';
else cout << "Kosuke"<<'\n';
}
int main() {
... | ALGO | 0.999034 | 4.359639 |
549fbad2-af54-4e4a-8ba6-2049ff5beade | unyieldingGlacier/coding-exercises | can-form-triangle.cpp | /* Given a list of line segments, are there any 3 segments that can form a triangle? If so, return the 3 segments.
* A triangle can be formed by 3 segments a,b and c if:
* a + b > c, b + c > a and a + c > b
*/
#include<iostream>
#include<vector>
using namepsace std;
vector<int> valid(vector<int> &A) {
... | ALGO | 0.999968 | 5.293515 |
f3bf3fed-e00b-4192-b7df-a1259d611665 | codeWithJooy/DSA | Maths/1_count_digits.cpp | #include<iostream>
using namespace std;
int countDigit(int n){
int count=0;
while(n){
count++;
n=n/10;
}
return count;
}
int main(){
int num=12345;
cout<<"Total Number of Digits in "<<num<<" is "<<countDigit(num);
return 0;
} | ALGO | 0.999579 | 4.234684 |
efdc70a3-7010-41b5-bca1-ae876d4215a6 | bhenriksson031/SOP_developablePatcher | include/tools/crossproduct_matrix.cpp | #include "crossproduct_matrix.h"
template <typename derivedMatrix, typename derivedVector>
IGL_INLINE void crossproduct_matrix(const Eigen::PlainObjectBase<derivedVector>& v,
Eigen::PlainObjectBase<derivedMatrix>& J)
{
J.resize(3,3);
J << 0, -v(2), v(1), v(2), 0, -v(0), -v(1... | ALGO | 0.997581 | 5.288867 |
d782589f-91dc-4c61-a35c-ddfb667a84e5 | huangjunhao2019/leetcode-tencent | c++prime/chapter14/exercise14_12_main.cpp | #include"exercise14_12.h"
int main(){
Book cp5_1(12345,"cp5","Lippmen","2012",4);
Book cp5_2(12345,"cp5","Lippmen","2012",2);
std::cout<<cp5_1+cp5_2<<std::endl;
return 0;
} | TOOL | 0.91739 | 3.306457 |
8e53dc49-2d28-4992-bd36-887864b9fc94 | Sadi-Hurayv/Competitive-Programming | Online Judge/Code Forces/Solve/A Problem/A_Twins.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n, tmp, c=0, sum=0, twn=0;
std::multiset<int, greater<int> >coin;
cin >> n;
for(int i=0; i<n; i++)
{
cin >> tmp;
sum+=tmp;
coin.insert(tmp);
}
std::multiset<int, greater<int> >::iterator it;
for(it=coin... | ALGO | 0.999974 | 3.657437 |
c1920f66-947b-4791-9759-1287b868d989 | KumarOjas/Codechef-solutions | Villine.cpp | #include <cstdio>
int main (){
long n;
scanf("%ld",&n);
long m,c;
scanf("%ld %ld", &m, &c);
long up(0), down(0);
for(long p = 0; p < n; p++){
long x, y, w; scanf("%ld %ld %ld", &x, &y, &w);
if(y - m * x - c > 0){up += w;}
else{down += w;}
}
printf("%ld\n", (up > do... | ALGO | 0.999923 | 3.546759 |
936b7dac-c422-4c5d-9f7c-adfa9fe92023 | superjekk0/AdventOfCode2024 | jour2/jour2.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <fstream>
class Resultat {
std::vector<int> _serie{};
const int max{ 3 };
const int min{ 1 };
bool validArray(const std::vector<int>& integerArray) const {
int step{ integerArray[0] - integerArray[1] };
b... | ALGO | 0.985105 | 4.793659 |
e56e5e88-9347-432b-b083-5e22127f7a6e | MuhammadHusnainSarwar/calculator | src/CalcManager/Ratpack/exp.cpp | //-----------------------------------------------------------------------------
//
// FUNCTION: exprat
//
// ARGUMENTS: x PRAT representation of number to exponentiate
//
// RETURN: exp of x in PRAT form.
//
// EXPLANATION: This uses Taylor series
//
// n
// ___
// \ ] ... | ALGO | 0.999844 | 4.104776 |
a9f3b97e-e73c-44d8-ba85-901bf6cb7c79 | sarvex/leetcode-g-forth | solution/2100-2199/2145.Count the Hidden Sequences/Solution.cpp | class Solution {
public:
int numberOfArrays(vector<int>& differences, int lower, int upper) {
long long num = 0, mi = 0, mx = 0;
for (int& d : differences) {
num += d;
mi = min(mi, num);
mx = max(mx, num);
}
return max(0, (int) (upper - lower - (mx... | ALGO | 0.999918 | 5.631695 |
0c9fceca-5554-460d-91e6-f82eaf712c01 | JeffMony/AndroidFFmpegCompile | fdkaac-src/libAACenc/src/band_nrg.cpp | /* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
The Fraunhofer FDK AAC Codec Lib... | ALGO | 0.998808 | 6.152693 |
a357da6f-a2ee-4eb2-957b-5d0aeb2675b3 | yiyongc/ExtractOpenToonz | ExtractOpenToonz/OpenToonz/plastictool_meshedit.cpp |
// TnzCore includes
#include "tmeshimage.h"
#include "tgl.h"
#include "tundo.h"
// TnzExt includes
#include "plasticdeformerstorage.h"
// tcg includes
#include "tcg/macros.h"
#include "tcg/tcg_point_ops.h"
#include "tcg/tcg_iterator_ops.h"
#include "tcg/tcg_function_types.h"
//#include "tcg/tcg_deleter_types.h"
//#... | ALGO | 0.95766 | 4.326189 |
f1bffc9a-66e2-49d7-8899-8c56d2026165 | langningchen/Etiger | 0306.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 305;
int n, f[N], x[N];
int main()
{
freopen("tomb.in", "r", stdin);
freopen("tomb.out", "w", stdout);
cin >> n;
for (int i = 1; i <= n; i++)
cin >> x[i];
f[0] = 0;
f[1] = x[1];
f[2] = max(x[1], x[2]);
for (int i = 3; i ... | ALGO | 0.999963 | 4.25465 |
369ba062-78ac-4516-bfdd-e3e61a81fa7c | pleveris/ads | 2 uzd/Programa/2lab.cpp | // ADS 2 lab.work, task num: 18, done by AA&PL (PRIF 19/3)
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <algorithm>
using namespace std;
struct ConvertedValue
{
double initial;
string converted;
};
class Queue
{
private:
int size = 0;
int capacity = 10;
Conv... | TOOL | 0.860355 | 5.031771 |
a1b5498c-be7e-4f23-a8e3-6ff9aa481ae4 | Kibiandkimi/stu | Problem/Luogu/P2657.cpp | //
// Created by kibi on 24-8-29.
//
#include <cctype>
#include <cmath>
#include <cstdio>
#include <stack>
#include <sys/types.h>
#include <tuple>
#include <vector>
using namespace std;
template<typename T>
T read() {
T s = 0, w = 1, c = getchar();
while (!isdigit(c)) {
if (c == '-') {
w = -1;
}
c = getchar... | ALGO | 0.999679 | 4.142822 |
82142d16-02c9-4422-ac08-9d793cdeb48a | Furqan-10/CS-88 | PD lab/Week 6/task3.cpp | #include<iostream>
using namespace std;
string findZodiacSign(int day, string month);
main(){
int day;
string month;
cout<<"Enter the day of birth: ";
cin>>day;
cout<<"Enter the month of birth (e.g., January, February): ";
cin>>month;
cout<<"Zodiac Sign: "<<findZodiacSign(day,month);
}
... | ALGO | 0.993408 | 4.473913 |
8c5ae4dd-855e-47a9-ac94-58053352871c | mdj982/competition-library | Library_mod.cpp | #include "auto_util_header.hpp"
namespace mod_op {
ll MOD = (ll)1e9 + 7; dont forget to modify;
class modll {
private:
ll val;
ll modify(ll x) const { ll ret = x % MOD; if (ret < 0) ret += MOD; return ret; }
ll inv(ll x) const {
if (x == 0) return 1 / x;
else if (x == 1) return 1;
else return modif... | ALGO | 0.999548 | 4.684059 |
d38319cb-5dad-41fa-b0be-ee059128011a | RobRoseKnows/umbc-cs202 | Projects/Proj2/pokerhand.cpp | /* File: pokerhand.cpp
* Name: Robert Rose
* Date: 3/8/16
* E-mail: <EMAIL>
* Section: Thursday 11:30
CMSC 202 Computer Science II
Spring 2016 Project 2
Implementation of PokerHand class.
See pokerhand.h for documentation.
*/
#include <iostream>
using namespace std;
#include "pokerhand.h"
PokerHand::Poker... | ALGO | 0.964396 | 5.591398 |
cd9955a9-58ee-44f0-af52-bdb463c05cc8 | a798447431/C-plus-plus | 18.lambda.cpp | /*************************************************************************
> File Name: 18.lambda.cpp
> Author:
> Mail:
> Created Time: 2019年11月09日 星期六 20时10分45秒
************************************************************************/
#include <iostream>
#include <algorithm>
using namespace std;
auto add = []... | ALGO | 0.9902 | 4.867609 |
3617f5f3-7254-45da-a13e-d86c09acd26d | ishandutta2007/codeforces | bigbag/normal/703/B.cpp | #include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
const int max_n = 111111, inf = 1111111111;
int n, k, sum, a[max_n], f[max_n];
lon... | ALGO | 0.999781 | 3.285128 |
5aefa612-39aa-4753-a0bd-1dd22aec3502 | NataliyaManolova/CPP | 01. CPP_basics/01. FirstLabCPP/7. Project Creation/7. Project Creation.cpp | #include <iostream>
using namespace std;
int main()
{
string name;
int projectsCount;
cin >> name >> projectsCount;
cout << "The architect " << name << " will need " << projectsCount*3 << " hours to complete " << projectsCount << " project/s.";
return 0;
}
| ALGO | 0.928627 | 4.545267 |
8b2b8c8f-164d-4138-aa6c-82ec268a67bf | afbravo/double_linked_list_cpp | test2.cpp | #include <iostream>
#include "llist.h"
int main(int argc, char** argv){
//the passed in argument is the string to be reversed
char* str = argv[1];
std::cout << "String to be reversed: " << str << std::endl;
//create a new list
LinkedList::list<char> *myString = new LinkedList::list<char>();
... | ALGO | 0.958716 | 4.925735 |
bc4735e9-b3ac-4dd5-9044-7bef171b2b53 | aminjonshermatov/competitive_programming | yandex_algo_training/B_28.cpp | #include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#else
#define dbg(...) 42
#endif
using namespace std;
using i64 = ::int64_t;
using ld = long double;
inline constexpr auto inf = numeric_limits<int>::max();
inline constexpr auto ninf = numeric_limits<int>::min();
using pii = pair<int, int>;
inline constex... | ALGO | 0.999829 | 4.316085 |
3f96757a-7213-4beb-af2f-0377a9242f8b | SVMuthu/Bitcoin_Orginal | src/signet.cpp | #include <signet.h>
#include <array>
#include <cstdint>
#include <vector>
#include <common/system.h>
#include <consensus/merkle.h>
#include <consensus/params.h>
#include <consensus/validation.h>
#include <core_io.h>
#include <hash.h>
#include <logging.h>
#include <primitives/block.h>
#include <primitives/transaction.... | ALGO | 0.999091 | 7.105376 |
8d1bcdf8-74c0-40bf-81c2-7050a7f3ef05 | sunovivid/Problem-Solving | 11048_이동하기_imporved.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <assert.h>
#include <string.h>
#include <string>
#define MAX 1003
using namespace std;
/* 문제 정의
정수 2차원 배열
-> 맨 왼쪽 위에서 오른쪽,아래,오른쪽 아래 대각선으로만 이동할 때 경로상 수열 합의 최댓값
*/
/* 해결 알고리즘 생각
dp[i][j] = (i,j까지 경로 수열 합 최대)
dp[i][j] = max(dp[i][j-1... | ALGO | 0.999844 | 4.022627 |
6e78de32-2529-41b1-9f6b-920af5b4ebd0 | UpCoder/Leetcode | WordSearchII.cpp | //
// Created by 梁栋 on 2019-04-28.
//
#include <vector>
#include <iostream>
#include <string>
#include <unordered_map>
#include <set>
using namespace std;
class TrieMap{
public:
unordered_map<char, TrieMap*> unordered_map1; // 当前节点的子节点
char val; // 当前节点的值
int num; // 当前节点出现多少次
bool isEnd; // 表示当前节点是不... | ALGO | 0.999762 | 6.207924 |
40af599c-b593-4079-82eb-17b4ff4b986a | iDos27/MPI-OpenMP | MPI/Lab01/zad3.cpp | #include <iostream>
#include <mpi.h>
using namespace std;
int main (int argc, char *argv[])
{
MPI_Init(&argc, &argv);
int size;
MPI_Comm_size(MPI_COMM_WORLD, &size);
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (rank == 0)
{
int a;
cout << "Podaj liczbe do pobra... | ALGO | 0.993479 | 3.507453 |
0719e1f5-252d-4c92-8d47-0e8827481872 | AroundPeking/abacus_abf_gen | source/module_hamilt_pw/hamilt_pwdft/operator_pw/veff_pw.cpp | #include "veff_pw.h"
#include "module_base/timer.h"
#include "module_base/tool_quit.h"
#include "module_psi/kernels/device.h"
using hamilt::Veff;
using hamilt::OperatorPW;
template <typename FPTYPE, typename Device>
Veff<OperatorPW<FPTYPE, Device>>::Veff(const int* isk_in,
cons... | TOOL | 0.941272 | 5.592173 |
c601d761-1abb-4cb5-b537-f33029b57245 | azharnian/COMPUTERIGS2425 | 10/INFORMATIKA/C++/10-11/07/73.cpp | #include <iostream>
using namespace std;
int list[] = {11, 35, 6};
int len = sizeof(list)/sizeof(int);
int mystery()
{
int max = list[0];
for (int i = 0; i < len; i++)
{
if (list[i] > max)
{
max = list[i];
}
}
return max;
}
int main()
{
cout << mystery() <<... | ALGO | 0.973206 | 3.33524 |
eb2d75a2-4d6d-494d-b2a4-c770f231714a | skrishna9/comptetive_programming | dimondshape.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout<<"enter the size of inverted pattern: ";
cin>>n;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n-i;j++)
{
cout<<" ";
}
for(int k=1;k<=i;k++)
{
cout<<k<<" ";
}
cout<<... | ALGO | 0.999254 | 3.211378 |
44fc7edf-b48f-42d1-a733-449389a15af1 | SuperBigFive/Charming_XCPC | Codeforces/Div2/873div2/C.cpp | #include <bits/stdc++.h>
#define ll long long
#define int ll
using namespace std;
const int N = 2e5 + 5;
const int MOD = 1e9 + 7;
int t, n;
void init () {}
void charming () {
init ();
cin >> n;
vector <int> a (n + 5), b (n + 5);
for (int i = 1; i <= n; ++i) cin >> a[i];
for (int i = 1; i <= n; ++i) cin >> b[i]... | ALGO | 0.999985 | 4.53482 |
90f7a7f5-09e3-44e8-922c-e1884d1c8760 | uzakotim/kata | C++/toCamelCase.cpp | #include <string>
#include <iostream>
std::string to_camel_case(std::string text)
{
for(int i =0;i<text.size();i++)
{
if ((text[i]=='-')||(text[i]=='_'))
{
text.erase(i,1);
text[i] = toupper(text[i]);
}
}
return text;
}
int main()
{
std::string input ... | ALGO | 0.992637 | 5.315508 |
dff4e191-1543-487d-90e7-05b6feb60ee4 | mixailche/permutation-decoding | src/utils/Utils.cpp | #include <stdexcept>
#include <random>
#include "Utils.hpp"
size_t utils::IntLog2(size_t arg)
{
size_t result = -1;
while (arg > 0) {
arg /= 2;
result++;
};
return result;
}
size_t utils::HammingWeight(size_t x)
{
size_t w = 0;
for (size_t mask = 1; mask != 0; mask <<= 1) {
... | TOOL | 0.991162 | 6.221204 |
7ba029ec-d2bb-4d93-b5f0-4f9639c7d27d | extensure123/opencv | modules/objdetect/src/aruco/charuco_detector.cpp | #include "../precomp.hpp"
#include <opencv2/calib3d.hpp>
#include <opencv2/core/utils/logger.hpp>
#include "opencv2/objdetect/charuco_detector.hpp"
#include "aruco_utils.hpp"
namespace cv {
namespace aruco {
using namespace std;
struct CharucoDetector::CharucoDetectorImpl {
CharucoBoard board;
CharucoParame... | ALGO | 0.998574 | 7.015319 |
b1f1e426-203b-4932-9809-b915ed62160d | hyee0715/Algorithm | BAEKJOON/cpp/2751_수_정렬하기_2.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> vec(n);
for (int i = 0; i < n; i++) {
cin >> vec[i];
}
sort(vec.begin(), vec.end());
for (int i = 0; i < vec.size(); i++) {
cout << vec[i] << "\n";
}
return 0;
} | ALGO | 0.999936 | 4.538754 |
f222ad1a-de63-4916-bf7c-44cda7ed9c5f | MehdiBenSalha/CP-Solutions | CodeForces/GNU C++20 (64)/282B | Painting Eggs/202905736.cpp | #include"bits/stdc++.h"
#include<algorithm>
using namespace std;
#define ll long long
#define nl '\n'
typedef vector<int> vi;
typedef pair<int, int> pi;
#define itn int
#define nit int
#define nti int
#define tin int
#define tni int
#define all(v) v.begin(), v.end()
#define F first
#define S second
#define PB... | ALGO | 0.999827 | 3.861428 |
c3db8f7c-6713-477e-afd5-1b35b5a641a9 | iamkuo/all_program | c++/binary_search/main.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
vector<int> dat;
bool bin_loc(int x)
{
int left = 0;
int right = dat.size()-1;
int middle;
while(left <= right)
{
middle = (left+right)/2;
if(dat[middle]>x) right = middle-1;
else if(dat[middle]<x) left = middl... | ALGO | 0.999983 | 4.343215 |
57cd42a5-8c0a-4bcb-8e5c-c1e080594eed | opencv/opencv_contrib | modules/rgbd/perf/perf_tsdf.cpp | #include "perf_precomp.hpp"
namespace opencv_test { namespace {
using namespace cv;
/** Reprojects screen point to camera space given z coord. */
struct Reprojector
{
Reprojector() {}
inline Reprojector(Matx33f intr)
{
fxinv = 1.f / intr(0, 0), fyinv = 1.f / intr(1, 1);
cx = intr(0, 2), c... | ALGO | 0.972221 | 6.388882 |
0635e375-4664-4904-b366-bb17c5d407c2 | Praveen0125/C-STL | some_algo.cpp | #include <bits/stdc++.h>
using namespace std;
// comparison operator declared.
bool comp(pair<int,int>p1, pair<int,int>p2){
if(p1.second<p2.second){
return true;
} else if(p1.second==p2.second){
if(p1.first>p2.second) return true;
else return false;
}
else return false;
}
int m... | ALGO | 0.99968 | 4.192489 |
d9a05d80-ebdd-4096-ae98-b420362c71dd | navyaarora01/DSA-Problems | Arrays/practice/minmax.cpp |
#include <iostream>
using namespace std;
int main()
{
int n;
cin>> n;
int arr[n];
int count=0;
for(int i=0;i<n;i++){
cin>> arr[i];
}
int maximum = arr[0];
int minimum = arr[0];
for(int i=1;i<n;i++){
if(arr[i]<minimum){
minimum = arr[i];
count++;
}
else{
count++;
}
if(a... | ALGO | 0.999794 | 3.586448 |
3340521f-b292-4ed8-89a8-7428e4e6d934 | lambda-b/atcoder_container | src/past202104-open/H.cpp | /// https://atcoder.jp/contests/past202104-open/tasks/past202104_h
#include <bits/stdc++.h>
#include <algorithm>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = unsigned long long;
int main() {
int n, m, k;
ll q;
cin >> n >> m >> k >> q;
vector<ll> a, b;
for (int i = 0; i ... | ALGO | 0.999866 | 3.935281 |
c0d3c740-21f7-4bfa-a626-84af1845f8a8 | Sowrav14/Algorithm-Explain-Sample | Data Structure/custom hashmap.cpp | /**
* @file custom hashmap.cpp
* @author Sowrav Nath (<EMAIL>)
* @version 0.1
* @date 2024-09-10
* @copyright Copyright (c) 2024
* @problem: https://cses.fi/problemset/task/1642
* @approach: greedy with hashmap
* @explanation:https://usaco.guide/gold/hashmaps#:~:text=%C2%A00/2-,(Optional)%20Hashmaps,Maintaining... | ALGO | 0.999913 | 4.38642 |
df86c0dd-6390-4dfe-8d7f-2662b69bb69e | aoxiangzhang/shangji | 2014/3.cpp | #include<iostream>
#include<string>
using namespace std;
int main() {
int cur = 0, biggest = 0;
string in;
cin >> in;
for(int i = 0; i < in.length(); i++) {
if(in[i] == '(')
cur + 1 > biggest ? biggest = ++cur : ++cur;
else if(in[i] == ')')
cur--;
}
cout ... | ALGO | 0.993816 | 3.727182 |
007dc229-edda-4f1b-ab8b-ac1d3bf3ff20 | S-o-y-k-a/hw | ENV-2/comp_num_main.cpp | #include "cmp_num_sort.hpp"
#include "ComplexNumber.hpp"
#include <iostream>
#include <array>
int main()
{
ComplexNumber arr[3];
arr[0] = ComplexNumber(5, 4);
arr[1] = ComplexNumber(5, -6);
std::cout << "unsorted: \n";
for (int i = 0; i < 3; i++) {
std::cout << arr[i] << "\n";
... | ALGO | 0.997452 | 3.947033 |
5836b86c-a777-4979-8387-b6249d801881 | onlyapon/codeforces-solutions | A/A_Permutation_Warm-Up.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while (t--)
{
int n;cin>>n;
int x=n,sum=0;
for (int i = 1; i <= n; i++)
{
sum+=abs(x-i);
x--;
}
cout<<(sum/2)+1<<endl;
}
} | ALGO | 0.999869 | 4.176348 |
bcb72fe8-230b-45af-83e6-c5ddd5acc488 | hkumariitr/dsalgo | 1762-furthest-building-you-can-reach/1762-furthest-building-you-can-reach.cpp | class Solution {
public:
int furthestBuilding(vector<int>& heights, int bricks, int ladders) {
priority_queue<int> pq;
int n = heights.size();
for(int i = 0;i<n;i++){
if(i==n-1){
return n-1;
}
int diff = heights[i+1]-heights[i];
... | ALGO | 0.999978 | 6.118227 |
ccd5a9e2-86c3-4da3-8c75-73c4a767194a | Masoudas/educational_material | CPPMaterial/ATourOfC++11/Iterators_33/WritingAWrapperIterator_0/8_parting_thoughts.cpp | /**
* Note that if we wanted the iterator wrapper to jump to each n-th element, we need to increment by multiples of
* five. Moreover, for the operator- working on the distance between the operators, we needed to divide by n,
* because each increment by one means n for the underlying element.
*
* A reminder is that ... | TOOL | 0.934131 | 6.838356 |
b685b9da-45d3-4753-9296-0e036e0fdaeb | fandesfyf/PX4-Autopilot | src/modules/flight_mode_manager/tasks/AutoFollowMe/FlightTaskAutoFollowMe.cpp | /**
* @file FlightTaskAutoFollowMe.cpp
*/
#include "FlightTaskAutoFollowMe.hpp"
#include <mathlib/mathlib.h>
using namespace matrix;
bool FlightTaskAutoFollowMe::update()
{
_position_setpoint = _target;
matrix::Vector2f vel_sp = _getTargetVelocityXY();
_velocity_setpoint = matrix::Vector3f(vel_sp(0), vel_sp(1),... | ALGO | 0.951154 | 5.489836 |
8eb812d7-1d47-471e-9a83-21bfdb201726 | siva0410/atcoder | abc198/c.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
double r, x, y;
cin >> r >> x >> y;
int ans = 0;
double distance;
distance = sqrt(x*x + y*y);
if(distance == r){
cout << 1 << endl;
return 0;
}
while(true){
if(r*2-distance >= 0){
ans += 2;
cout << ans <<endl;
... | ALGO | 0.999814 | 3.336943 |
e82c7dca-6353-4253-9e28-e5b04c413a78 | manolio2001/DOAestimation- | DOAestimation/run_DRACOSS_1D_Blockbased_v4.cpp | #include "DOA.hpp"
#include <numeric>
#include <fstream>
int framesize = 2048;
double time_step = framesize * 0.5;
int fftsize = 2048;
int Fs = 44100;
int UpCutOff = 4000;
int freqzonewidth = 344;
int freqzonebins = round(freqzonewidth * ((double)fftsize / Fs));
double zoneoverlap = 0.5;
double zone_step = freqzonebin... | ALGO | 0.99734 | 5.750604 |
90d0281c-4056-4e3f-b27b-83382b46a541 | trunghai95/MyCPCodes | Codeforces/387B.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, a[3010], b[3010];
int main()
{
scanf("%d %d", &n, &m);
for (int i = 1; i <= n; ++i)
scanf("%d", a+i);
for (int i = 1; i <= m; ++i)
scanf("%d", b+i);
int in = 1;
for (int im = 1; im <= m && in <= n; ++im)
if (b[im] >= a[in])
++in;
printf("%d", n... | ALGO | 0.999883 | 3.834359 |
6b780264-5c45-412d-9bb1-f8d2b10fdb71 | zezehz/ccc | opencv-3.4.1/samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp | /**
* @file HoughLines_Demo.cpp
* @brief Demo code for Hough Transform
* @author OpenCV team
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
/// Global variables
/** General variables */
Mat src, edges... | ALGO | 0.976473 | 6.402082 |
1a2e9f17-14de-4a7a-984f-e7cbbf5bdfe4 | ksblock/algo | Data Structure/10828.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
int main()
{
int N, data, top;
string command;
stack<int> st;
cin >> N;
for(int i=0;i<N;i++)
{
cin >> command;
if(command == "push")
{
cin >> data;
st.push(data);
... | ALGO | 0.998771 | 4.454744 |
fc317819-8a04-425e-8ea3-120af7ab3ebf | DataWhisperer10/FlutterWeatherApp | weather/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.998662 | 6.76073 |
dff7f195-efb8-4f6d-a299-81b8e3ea6900 | Olil-byte/coc_unofficial_patch | src/editors/ECore/Editor/GeometryCollector.cpp | //---------------------------------------------------------------------------
#include "stdafx.h"
#pragma hdrstop
#include "GeometryCollector.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
//-----------------------------------------------------------------... | TOOL | 0.945401 | 3.145003 |
43fb0e24-83f2-4075-8fb7-b48c75584d36 | nirbar/boost | libs/graph/test/bellman-test.cpp | // From Louis Lavery <<EMAIL>>
/*Expected Output:-
A: 0 A
B: 11 A
Actual Output:-
A: 0 A
B: 2147483647 B
*/
#include <iostream>
#include <iomanip>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/bellman_ford_shortest_paths.hpp>
#include <boost/cstdlib.hpp>
#include <boost/test/minimal.hpp>
int t... | ALGO | 0.998911 | 5.497384 |
a4465ba7-5442-4865-b5ff-5f06bf89ca14 | alexfmsu/QComputations | src/hamiltonian.cpp | #include <vector>
#include <functional>
#include <complex>
#include <iostream>
#include <iomanip>
#include "hamiltonian.hpp"
#include "config.hpp"
#include "graph.hpp"
#include "functions.hpp"
#include "quantum_operators.hpp"
#ifdef ENABLE_MPI
#include "mpi_functions.hpp"
#endif
namespace QComputations {
namespace {... | ALGO | 0.999247 | 4.440508 |
ce9ace76-d1a4-4f90-8a64-85b580980e79 | dmkz/competitive-programming | acmp.ru/0776.cpp | /*
Задача: 776. Юпитер
Решение: графы, поиск в ширину, O(k*n*m*(n+m))
Автор: Дмитрий Козырев, github: dmkz, e-mail: <EMAIL>
*/
#include <bits/stdc++.h>
typedef std::vector<int> vi;
typedef std::vector<vi> vvi;
typedef std::vector<vvi> vvvi;
typedef const int cint;
template<typename T>
std::istrea... | ALGO | 0.999686 | 4.760251 |
d64278f4-779c-47f6-88bd-baaff4aed995 | mrgonzatto/TreinamentoCPP | 75_RandomNumbers/Programa.cpp | #include <cstdlib>
#include <ctime>
#include <iostream>
#include <tchar.h>
using namespace std;
int main()
{
_tsetlocale(LC_ALL, _T("portuguese"));
srand((unsigned)time(0));
int randomNumber = rand();
cout << "Nmero aleatrio: " << randomNumber << endl;
system("PAUSE");
// Aleatrio dentro de um intervalo
sran... | TOOL | 0.954175 | 4.073805 |
736027c2-cc9a-4dac-9388-b7170122468a | chandrashekarAlpula/DataStructures | Others/EvenOddSorting.cpp | /*
* EvenOddSorting.cpp
*
* Created on: Dec 14, 2016
* Author: chandra.shekhar
*/
#include<iostream>
#include<cstdio>
//#include<cstdlib>
using namespace std;
void EventOddSort(int *A, int n){
int l = 0, h = n-1;
while(l < h){
while(A[l]%2 == 0 && l < h)
l++;
while(A[h]%2 == 1 && l < h)
h--;
... | ALGO | 0.999777 | 4.420901 |
6ad1c26a-a171-4021-8db6-bd5029fa519d | RyanAlexanderSingh/L-System | octet/octet/open_source/bullet/BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp | #include "btCompoundCompoundCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btCompoundShape.h"
#include "BulletCollision/BroadphaseCollision/btDbvt.h"
#include "LinearMath/btIDebugDraw.h"
#include "LinearMath/btAabbUtil2.h"
#include "Bulle... | ALGO | 0.99968 | 6.290576 |
4eb02b3f-88e5-432e-8108-326f978325ec | darkwuta/-CSC417-Assignment | Assignment4/extern/libigl/include/igl/sort_angles.cpp | template <typename DerivedM, typename DerivedR>
IGL_INLINE void igl::sort_angles(
const Eigen::PlainObjectBase<DerivedM>& M,
Eigen::PlainObjectBase<DerivedR>& R) {
const size_t num_rows = M.rows();
const size_t num_cols = M.cols();
assert(num_cols >= 2);
R.resize(num_rows);
// Have ... | ALGO | 0.999707 | 7.031815 |
7036e5ea-8e44-438b-a14e-e7b80311b48d | deepakdashcode/Coding | babbar/L10/find_unique.cpp | #include<bits/stdc++.h>
using namespace std;
int findUnique(int *arr, int size){
int s = 0;
for(int i = 0; i < size; i ++){
s = s ^ arr[i];
}
return s;
}
int findDuplicate(vector<int> &arr, int n){
int s = 0;
for(int i = 1; i < n; i ++){
s = s ^ i;
}
for(int i = 0; i < n; i ++){
s = s ^ ... | ALGO | 0.999815 | 4.412145 |
b34d9bd9-4a01-4ca4-89cc-f6814e14cd63 | anshgupta6031/Cpp | 02_practice/practice_22.cpp | // sort array of 0s, 1s, and 2s.
// Method 1.
// By two pass method.
#include <bits/stdc++.h>
using namespace std;
void display(vector <int> &v){
int n = v.size();
... | ALGO | 0.999958 | 4.58076 |
54c06983-ac55-4380-86b2-2ed6877b0b7c | thegamer1907/Code_Analysis | CodesNew/416.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int a[100100];
int main() {
int n , t ;
cin>>n>>t ;
for(int i=0 ; i< n ; i++){
cin>>a[i];
}
int l =0 , r =0 , sum =0 , ans =0 ;
while( r < n){
sum += a[r] ;
if(sum <= t){
... | ALGO | 0.99996 | 4.274925 |
b9d04a66-75d3-451d-ae34-efbc19f80de7 | ayush-kumar774/Competitive-Programming | Codeforces/Omkar and Last Class of Math.cpp | #include <bits/stdc++.h>
using namespace std ;
#define int long long
void solve()
{
int n ;
cin >> n ;
int ans = 0 ;
for(int i = 2 ; i < n ; i++)
{
if(n % i == 0)
{
ans = i ;
break ;
}
}
if(ans == 0) ans = n ;
cout << (n / ans) << " " << n... | ALGO | 0.999345 | 4.790338 |
ba669032-97c1-4253-8a21-3c1fa8408328 | Ankur800/New-Coding-Repo | CPP/Fenwick Tree/fenwickTree.cpp | #include<iostream>
using namespace std;
void update(int index, int value, int *BIT, int n) {
for(;index <= n;index += index & (-index)) { // log(n) times looping
BIT[index] += value;
}
}
int query(int index, int *BIT) {
int sum = 0;
for(;index > 0;index -= index & (-index)) {
sum += BIT[index];
}
return sum... | ALGO | 0.9999 | 3.675966 |
3ca60648-f0cf-4550-8d1e-365bec089992 | Shanboy5566/myleetcode | 155.min-stack.cpp | /*
* @lc app=leetcode id=155 lang=cpp
*
* [155] Min Stack
*/
// @lc code=start
class MinStack {
public:
/** initialize your data structure here. */
stack<int> stack_;
stack<int> min_stack;
MinStack() {
}
void push(int x) {
if (min_stack.empty() || x <= min_stack.top()){
... | ALGO | 0.999829 | 6.920417 |
226a073c-f7ae-4402-ba92-459a8158fcf4 | taejuk/algorithm | chapter28/SCC.cpp | #include <vector>
#include <stack>
#include <iostream>
using namespace std;
vector<vector<int>> adj;
vector<int> sccId;
vector<int> discovered;
stack<int> st;
int sccCounter, vertexCounter;
// 정점 중 최소 발견 순서를 반환한다?
int scc(int here) {
int ret = discovered[here] = vertexCounter++;
st.push(here);
for(int i ... | ALGO | 0.999853 | 4.658463 |
42ed4e3e-7e79-4722-b02a-9367467cf81f | GrootTheDeveloper/OLP-ICPC | 800+BAI_CODE_HAY/Code/paleta.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int mode = 998244353;
int a[1000006], f[1000006];
int n, k;
void check(int &ans)
{
for (int i = 1; i <= n; i++)
if (f[i] != i && a[f[i]] == a[i]) return;
ans++;
}
void Try(int i, int &ans)
{
if (i > n) return check(ans), void... | ALGO | 0.999949 | 4.140552 |
d6db47d3-058f-42e4-997d-6f8bff78de38 | kalex1994/UVA | 11218.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 9;
int v[N * N][4];
int n, answer ;
void solve(int mask, int pos, int score)
{
if (mask == (1 << N) - 1)
{
answer = max(answer, score);
return;
}
if (pos == n)
return;
if (!(mask & ((1 << v[pos][0]) | (1 << v[pos][1... | ALGO | 0.999801 | 4.782732 |
b0dd29b5-6810-47d2-a80b-41136b23a884 | DamianMorales1437/Programacion | Bloque 5 - Arreglos o Vectores/Ejercicio 6 - Determinar si un numero en un arreglo equivale a la suma de los demas.cpp | /*6. Escribe un programa que defina un vector de nmeros y calcule si existe
algn nmero en el vector cuyo valor equivale a la suma del resto de nmeros
del vector.*/
#include<iostream>
#include<conio.h>
using namespace std;
int main(){
int numeros[5] = {1,2,3,4,10}; //Definimos un arreglo
int suma=0,mayor=0;
fo... | ALGO | 0.999188 | 3.744147 |
afeddde1-7936-4d4e-92ad-da1e33d2dcaa | adityasrathore/Codes | LeetCode/1920. Build Array from Permutation.cpp | class Solution {
public:
vector<int> buildArray(vector<int>& nums) {
int n=nums.size();
for(int i=0;i<n;i++)
nums[i]=nums[i]+n*(nums[nums[i]]%n);
for(int i=0;i<n;i++)
nums[i]=nums[i]/n;
return nums;
}
};
| ALGO | 0.999979 | 5.154671 |
8b4771f9-de45-4d4a-bd18-9a23e93601ce | GitHCoRradO/myCppPrimerExercises | C++PrimerExercises/ExOfCh9/Ex9.20.cpp | #include <iostream>
#include <list>
#include <deque>
using std::list;
using std::deque;
using std::cout;
using std::endl;
int main() {
list<int> li{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
deque<int> deque_even, deque_odd;
for(auto i : li) {
if(i % 2 == 0)
deque_even.push_back(i);
else
deque_odd.push_back(i);
... | ALGO | 0.996153 | 4.98876 |
991d41bb-1b47-4cae-b091-a0945b6b6aca | Ravi-Khatri/code | CAKE wALK/fact.cpp | #include<iostream>
using namespace std;
// A NON-tail-recursive function. The function is not tail
// recursive because the value returned by fact(n-1) is used in
// fact(n) and call to fact(n-1) is not the last thing done by fact(n)
unsigned int fact(unsigned int n)
{
if (n == 0) return 1;
cout<<n<<" ";
return n*... | ALGO | 0.998976 | 5.224915 |
b5fb6e57-1c3d-45a7-99b2-b504666dfc84 | dem42/exp_tran | qt_gl/model/modelimageerror.cpp | #include "modelimageerror.h"
#include <limits>
using namespace std;
using namespace cv;
ModelImageError::ModelImageError()
{
model = FaceModel::getInstance();
u_id = model->getUIdentity();
u_ex = model->getUExpression();
}
ModelImageError::ModelImageError(Mat P,Mat R,Mat t) : P(P), R(R), t(t)
{
... | ALGO | 0.950183 | 4.697561 |
4f1beef9-98d4-44a4-b8b6-f2fce86f505e | strategist614/ACM-Code | 刷题比赛/CF/CodeForces731/D.cpp | // Tarjan算法求有向图强连通分量并缩点
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
const int N = 100010, M = 1000010;
int ver[M], Next[M], head[N], dfn[N], low[N];
int stack[N], ins[N], c[N];
int vc[M], nc[M], hc[N], tc;
vector<int> scc[N];
int n, m, ... | ALGO | 0.999992 | 4.373642 |
8ac3b72d-4d7c-402a-932b-1081eb0e4455 | zxysnow/leetcode | 203-remove-linked-list-elements.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* removeElements(ListNode* head, int val) {
ListNode *h = new ListNode(0);
h->next = head;
ListNode ... | ALGO | 0.999904 | 5.77882 |
c0231096-9e30-4f91-8b28-14322e9ba502 | Aryan-Gupta2003/Leetcode-solutions | count_submatrix.cpp | // Leetcode problem statement link
// https://leetcode.com/problems/count-submatrices-with-top-left-element-and-sum-less-than-k/
// You are given a 0-indexed integer matrix
// grid and an integer k.
// Return the number of submatrices that
// contain the top-left element of the grid,
// and have a sum less than or eq... | ALGO | 0.999684 | 6.10935 |
d146407b-5b68-495e-a44b-70e72a911f72 | Harsh1820/dsa-love-babbar | 0031-next-permutation/0031-next-permutation.cpp | class Solution {
public:
void nextPermutation(vector<int>& nums) {
int n = nums.size(), index = -1;
for(int i=n-2; i>=0; i--){
if(nums[i] < nums[i+1]){
index = i;
break;
}
}
for(int i=n-1; i>=index && index != -1; i--){
... | ALGO | 0.999995 | 5.886629 |
1f7721e7-b62c-4e9d-b149-debe745e035c | ampl/coin | Couenne/Clp/examples/rowColumn.cpp | /* $Id: rowColumn.cpp 2278 2017-10-02 09:51:14Z forrest $ */
#include "ClpSimplex.hpp"
#include <cstdio>
#include <cassert>
int main(int argc, const char *argv[])
{
ClpSimplex modelByRow, modelByColumn;
// This very simple example shows how to create a model by row and by column
int numberRows = 3;
... | ALGO | 0.990402 | 6.370581 |
007c22f2-6057-4e22-8db5-2cd4201b870c | ChuiXue-Lan/PC-Code-Study | TASeg-main/pcseg/model/segmentor/fusion/rpvnet/range_lib/range_utils/src/denselize.cpp | #include <torch/torch.h>
#include <vector>
#include "denselize_gpu.h"
at::Tensor denselize_forward(
const at::Tensor feat,
const at::Tensor count_map,
const at::Tensor pxpy
)
{
int B = count_map.size(0);
int W = count_map.size(2);
int H = count_map.size(1);
int C = feat.size(1);
int N =... | DATA | 0.932711 | 6.445688 |
65720015-4bb0-4894-8e34-6a9a143d4b5b | Cselfy1/hw28 | hw28.cpp | #include <iostream>
#include <cmath>
using namespace std;
class Engine {
private:
float power; // horsepower
public:
Engine(float power) : power(power) {}
float getPower() const {
return power;
}
};
class Wheel {
private:
int radius; // inches
public:
Wheel() : radius(0) {}
Wheel... | ALGO | 0.993755 | 6.547166 |
f16aa28c-9cfb-4262-a547-52250c0e0b64 | ishandutta2007/codeforces | pupii/normal/995/F.cpp | #include<bits/stdc++.h>
typedef long long ll;
#define mod 1000000007
ll gi(){
ll x=0,f=1;
char ch=getchar();
while(!isdigit(ch))f^=ch=='-',ch=getchar();
while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
return f?x:-x;
}
int pow(int x,int y){
int ret=1;
while(y){
if(y&1)ret=1ll*ret*x%mod;
x=1ll*x*x%mod;y>>=1;
}
... | ALGO | 0.999972 | 4.113872 |
7384f346-a71c-4171-850a-213763a0d723 | innova-foundation/innova | src/sync.cpp | #include "sync.h"
#include "util.h"
#include <boost/foreach.hpp>
#ifdef DEBUG_LOCKCONTENTION
void PrintLockContention(const char* pszName, const char* pszFile, int nLine)
{
printf("LOCKCONTENTION: %s\n", pszName);
printf("Locker: %s:%d\n", pszFile, nLine);
}
#endif /* DEBUG_LOCKCONTENTION */
#ifdef DEBUG_LO... | TOOL | 0.967789 | 5.895225 |
95784641-ff6c-4f47-a05d-3aacc2f78842 | asteroid5566/ZeroJudge | a410-解方程.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float a, b, c, d, e, f, delta, deltaX, deltaY;
cin >> a >> b >> c >> d >> e >> f;
delta = a * e - b * d;
deltaX = c * e - f * b;
deltaY = a * f - d * c;
if (delta == 0) {
if (deltaX == 0 && deltaY == 0)
cout << "Too many" << endl;
el... | ALGO | 0.999892 | 3.722187 |
85b8cbe4-e2f9-4078-a46e-60e2272eb6c4 | Siprj/ACH-exercise-1 | matvec/step2/main.cpp | /*
* Architektura procesoru (ACH 2015)
* Projekt c. 1 (matvec)
* Login: xsiprj01
*/
#include <cstdio>
#include <cmath>
#include "matvec.h"
#include "papi_cntr.h"
#define COLWIDTH (COLS + PADDING)
void mat_init(int row, int col, float off, float a[][COLWIDTH])
{
int i, j;
for (i = 0; i < row; i++)
... | TOOL | 0.912185 | 3.908533 |
1a5bbb03-d40a-4992-878b-dce55ee8b416 | CFatnassi/travelling_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.998733 | 6.76775 |
d996cf4f-f44f-436e-9c78-d5a64a7f0c7f | divyanshchawla23/daily-code | 84-largest-rectangle-in-histogram/largest-rectangle-in-histogram.cpp | class Solution {
private:
vector<int> findLeft (vector<int>& nums){
stack<pair<int,int>> st;
vector<int> ans;
int psuedo = -1;
for(int i =0;i<nums.size();i++){
if(st.empty()) ans.push_back(psuedo);
else if(!st.empty() && st.top().first < nums[i]) ans.push_ba... | ALGO | 0.999991 | 6.387252 |
50845cb6-d2e2-4b60-b67f-254111f55462 | SAMRIDHISAINII/DP | 14 Longest Common Subsequence.cpp | #include <bits/stdc++.h>
using namespace std;
int LCS(string X, string Y, int n, int m) {
// base case
if (n == 0 || m == 0)
return 0;
// choice diagram
// when both string X and Y is having same last char
if (X[n - 1] == Y[m - 1])
return 1 + LCS(X, Y, n - 1, m - 1); // count the number and decreament the b... | ALGO | 0.999936 | 4.719917 |
4a45a938-66f3-46e0-a4b0-7b85a8002773 | deepraj16/DSA | 3-stack and queue /sort_a_stack.cpp | #include<bits/stdc++.h>
using namespace std ;
void sorted(stack<int>&s,int element){
if(s.empty()){
s.push(element);
return ;
}
if(s.top()<element){
s.push(element);
return;
}
int data=s.top();
s.pop();
sorted(s,element);
s.push(data);
}
void sort_a... | ALGO | 0.9993 | 4.427594 |
8238d9ab-34cf-44f3-8367-c944198d826a | RohanDSkaria/CodeForces | B_Tape.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
#define endl '\n'
#define int long long
#define v vector
#define vi v<int>
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define deb(...) _print(#__VA_ARGS__,... | ALGO | 0.999935 | 3.534633 |
9351e597-ef3f-4d19-bf89-11874cc0102c | ishandutta2007/codeforces | wng/normal/1535/E.cpp | #include <bits/stdc++.h>
typedef long long LL;
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define RALL(X) (X).rbegin(), (X).rend()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define R(X) cin>>(X)
#define RII(X, Y) cin>>(X)>>(Y)
#defin... | ALGO | 0.999634 | 3.622411 |
71c8e43d-fa3b-420b-af3f-184e5665a439 | BehroozZare/Parth | demo/FullRemeshDemo.cpp | //
// Created by behrooz zare on 2024-04-28.
//
//
// Created by behrooz zare on 2024-04-06.
//
//igl include
#include <igl/opengl/glfw/Viewer.h>
#include <igl/read_triangle_mesh.h>
#include <igl/unique.h>
#include <igl/setdiff.h>
#include <igl/cotmatrix.h>
#include <igl/avg_edge_length.h>
#include "LinSysSolver.hpp"
... | ALGO | 0.93946 | 4.976247 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.