uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
51bb0780-979c-4fa4-a3ab-e84744df7460 | ElNefro/paraaaa | para_4/para_4.cpp | #include <iostream>
int Sum(int a, int b)
{
return a + b;
}
int Razn(int a, int b)
{
return a + b;
}
int Proiz(int a, int b)
{
return a * b;
}
int Chast(int a, int b)
{
return a / b;
}
int main()
{
setlocale(LC_ALL, "ru");
int a, b, znak;
std::cout << "Введите первое число: ";
st... | ALGO | 0.973106 | 3.3934 |
bbfd51d3-d03b-4810-9d38-7950863de2f3 | gaurlakshya/Leetcode_Submissions | Introduction to Trees - GFG/introduction-to-trees.cpp | //{ Driver Code Starts
// Initial Template for C++
//{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int countNodes(int i) {
// your code here
int n=i-1;
return pow(... | ALGO | 0.999778 | 6.090487 |
e1648781-2d75-45fc-a59c-0e2c24f9db92 | cpvrlab/SLProject | externals/libigl/include/igl/repmat.cpp | template <typename DerivedA, typename DerivedB>
IGL_INLINE void igl::repmat(
const Eigen::MatrixBase<DerivedA> & A,
const int r,
const int c,
Eigen::PlainObjectBase<DerivedB> & B)
{
assert(r>0);
assert(c>0);
// Make room for output
B.resize(r*A.rows(),c*A.cols());
// copy tiled blocks
for(int i = 0... | ALGO | 0.988459 | 4.193852 |
61aef28b-8d32-4823-9e03-2ca7fa6826b3 | yzzupgo/MFTCG | Data/abc206_a/mare/ac/23580058.cpp | #include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
int s = N * 1.08;
if(s < 206.0) {
cout << "Yay!" << endl;
return 0;
}
if(s == 206) {
cout << "so-so" << endl;
return 0;
}
cout << ":(" << endl;
return 0;
}
| ALGO | 0.99796 | 3.459715 |
484d8862-3f7a-4ec3-b1bf-fac4da58fb5a | ishandutta2007/codeforces | cirno_9baka/normal/1416/F.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=100005,E=2000005;
#define id(i,j) (i-1)*m+j
int dis[N],head[N],Next[E],adj[E],cap[E],tot=1,S,T;
int que[N],now[N];
void addedge(int u,int v,int w)
{
Next[++tot]=head[u],head[u]=tot,adj[tot]=v,cap[tot]=w;
Next[++tot]=head[v],head[v]=tot,adj[tot]=u,cap[tot]=0;
}
... | ALGO | 0.999938 | 4.917105 |
5e09dab3-a952-460e-a35c-330e93fb8b21 | efeslab/lapidary | custom_gem5/tests/test-progs/pthread/src/test_std_mutex.cpp | #include <cstdlib>
#include <iostream>
#include <mutex>
#include <thread>
#include <vector>
//------------------------------------------------------------------------
// Create n threads, run them in parallel and wait for them in the master
// thread.
// Each child thread increments a shared variable m times
//-------... | ALGO | 0.984333 | 5.461789 |
55420910-e425-4350-a29f-fbc5d06f234f | Anup050/DSA | 1944-truncate-sentence/1944-truncate-sentence.cpp | class Solution {
public:
string truncateSentence(string s, int k) {
string str = "";
int sp = 0;
for(char c : s){
if(c == ' ')sp++;
if(sp == k) break;
str += c;
}
return str;
}
}; | ALGO | 0.999917 | 5.726812 |
bfde4efc-997e-4c36-a073-8d4f3cfe1dff | ishandutta2007/codeforces | icecuber/normal/1672/F2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0); cin.tie(0);
int T;
cin >> T;
while (T--) {
int n;
cin >> n;
vector<int> a(n), b(n), cnt(n);
for (int&v : a) cin >> v, cnt[--v]++;
for (int&v : b) cin >> v, v--;
int s = 0;
for ... | ALGO | 0.99994 | 3.90697 |
51027f82-0b10-4a0e-a9a8-c808202842b3 | ishandutta2007/codeforces | penguinhacker/normal/1365/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
int n;
ll a[500], ans=0;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i=0; i<n; ++i)
cin >> a[i];
if (n<=3) {
for (int i=0; i<n; ++i)
ans|=a[i];
cout << ans << '\n';
return 0;
}
for (int i=0... | ALGO | 0.99999 | 4.734134 |
b0dfe0d0-b4a1-472d-846d-3b6324d5a166 | CLBRITTON2/CppTinyWebSearchEngine | SearchEngine/SearchEngine.cpp | #include "SearchEngine.h"
SearchEngine::SearchEngine()
{
_lemmatizer.LoadBinary("english.bin");
_queryParser.SetLemmatizer(&_lemmatizer);
}
void SearchEngine::LoadRepositoryFromBinaryFile(const std::string& fileName)
{
_webPageRepository.LoadFromBinaryFile(fileName + ".repository");
_index.LoadFromBinaryFile(file... | TOOL | 0.980831 | 5.615273 |
31276dc2-1f38-4a7f-9ef0-08b612f458b6 | LeeHan20/Beakjoon | Sort/2180 소방서의 고민/solution.cpp | #include <iostream>
#include <queue>
#define endl "\n"
using namespace std;
const int MOD = 40000;
struct Fire {
int first;
int second;
};
bool compare(const Fire& a, const Fire& b) {
if (b.first == 0 && b.second == 0) {
return false;
}
if (a.first == 0 && a.second == 0) {
return ... | ALGO | 0.999968 | 5.31541 |
ba6b2b57-8e4c-4bc9-a1a0-d9e7f18427c6 | ishandutta2007/codeforces | tdpencil/normal/959/B.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define all(x) x.begin(),x.end()
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)
#define f first
#define s second
#define ar array
#define vt vector
#define ub upper... | ALGO | 0.999857 | 4.076416 |
cf412e37-d8e9-411d-b421-d025854602dd | ishandutta2007/codeforces | kmjp/normal/1526/B.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.999604 | 4.305808 |
da3bfb7c-bc89-4a13-9862-59d4a8d8ae27 | helloworldwangziyi/weather_data_center | project/tools/c/fileserver1.cpp | /*
* 程序名:fileserver.cpp,文件传输的服务端。
* 作者:吴从周
*/
#include "_public.h"
// 程序运行的参数结构体。
struct st_arg
{
int clienttype; // 客户端类型,1-上传文件;2-下载文件。
char ip[31]; // 服务端的IP地址。
int port; // 服务端的端口。
int ptype; // 文件上传成功后文件的处理方式:1-删除文件;2-移动到备份目录。
char clientpath[301];... | WEB | 0.867788 | 3.911528 |
397084cb-e9ee-4df5-8034-91880e295764 | Sowmik23/CompetitiveProgramming | LeetCode/String/791. Custom Sort String.cpp | // 791. Custom Sort String
class Solution {
public:
string customSortString(string order, string s) {
unordered_map<char, int> ordermap;
for(int i=0;i<order.size();i++){
ordermap[order[i]] = i;
}
sort(s.begin(), s.end(), [&ordermap](auto& a, auto& b){
... | ALGO | 0.999983 | 6.274438 |
6f4096cd-9dd1-430a-a880-7936d6bd153e | sahil-chekhaliya/recursion | saydigits.cpp | #include <iostream>
using namespace std;
void saydigits(int n, string a[])
{
if (n == 0)
return;
int digit = n % 10;
n /= 10;
saydigits(n, a);
cout << a[digit] << " ";
}
int main()
{
string a[10] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
... | ALGO | 0.997649 | 5.235388 |
7a10513f-ef23-4372-8980-da4fe63da09d | eMir-server/eMir | 3rd_party/android-input/android_pristine/frameworks/base/services/input/InputDispatcher.cpp | #define LOG_TAG "InputDispatcher"
#define ATRACE_TAG ATRACE_TAG_INPUT
//#define LOG_NDEBUG 0
// Log detailed debug messages about each inbound event notification to the dispatcher.
#define DEBUG_INBOUND_EVENT_DETAILS 0
// Log detailed debug messages about each outbound event processed by the dispatcher.
#define DEBU... | TOOL | 0.882029 | 3.718552 |
85183827-5608-4049-bae7-cb6a712ab56c | ibhandarikrishna/100daychallengewithc | day_531/Palindrome Linked List.cpp | class Solution {
public:
bool isPalindrome(ListNode* head) {
vector<int> listVals;
while (head) {
listVals.push_back(head->val);
head = head->next;
}
int left = 0, right = listVals.size() - 1;
while (left < right && listVals[left] == listVals[... | ALGO | 0.999468 | 6.283036 |
e3d3f0d7-c109-499f-a3a7-ba4912c7e1db | racolin/physics_simulation | 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.998859 | 6.785645 |
8d3602a0-7841-444d-bfbf-cd4366908529 | abhi0ekka/LeetCode | isPalindrome.cpp | //
// Created by ABHISHEK EKKA on 09/06/24.
//
#include <iostream>
#include <climits>
using namespace std;
bool isPalindrome(int);
int main()
{
int num;
cout<<"Enter a number to check weather it is a Palindrome or not"<<endl;
cin>>num;
if(isPalindrome(num))
cout<<"true";
else
cout<... | ALGO | 0.999246 | 5.008164 |
ca783d11-f05e-461d-9117-a80815168433 | banyudu/leetcode | implement-strstr/test.cpp | #define CATCH_CONFIG_MAIN
#define CATCH_CONFIG_COLOUR_NONE
#include "../catch.hpp"
#include "solution.cpp"
Solution sln;
TEST_CASE("normal values", "[Solution]")
{
REQUIRE(sln.strStr("abc", "") == 0);
REQUIRE(sln.strStr("abc", "b") == 1);
REQUIRE(sln.strStr("abbcbb", "bb") == 1);
REQUIRE(sln.strStr("a... | TEST | 0.994648 | 6.089268 |
4900b832-56dc-4bb0-b700-72323e41ae68 | metahashorg/v8_vm | buildtools/third_party/libc++/trunk/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound_comp.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T, Predicate<auto, T, Iter::value_type> Compare>
// constexpr Iter // constexpr after c++17
// upper_bound(Iter first, Iter last, const T& value, Compare comp);
#include <algorithm>
#include <functional>
#include <vector>
#include <cassert>
#include <cstdd... | TEST | 0.979554 | 7.057357 |
5bf85d86-695d-48f4-bd18-c8424fe89498 | nawngs/CompetitiveProgramming | Exercises/numbers.cpp | #pragma GCC optimize ("O2")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pll pair < ll, ll >
#define pii pair < int, int >
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const string NAME = "numbers";
const string ... | ALGO | 0.999825 | 4.479944 |
74a2b639-a841-490d-948e-3737d8b18211 | wjddlsy/Algorithm | Baekjoon/baek_1658_돼지잡기/main.cpp | #include <vector>
#include <queue>
#include <iostream>
using namespace std;
struct Edge{
int target, capacity, flow;
Edge* reverse;
Edge(int target, int capacity): target(target), capacity(capacity){
flow=0;
reverse=nullptr;
}
int residualCapacity() const {
return capacity... | ALGO | 0.999936 | 4.192737 |
9467f3cc-fbf7-414a-b12e-1e877d9d2137 | kmjp/procon | leetcode/biweekly/001-040/002/1086.cpp | typedef signed long long ll;
#undef _P
#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 ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) me... | ALGO | 0.999894 | 4.818567 |
2920e168-f848-43e4-b81f-ca3fe025b852 | bab-git/dist-LMNN | gbrt/buildlayer_sqrimpurity_multif.cpp | /*This program chooses the best splits, finds the predictions, and computes the loss for the tree.
*/
#include "mex.h"
#include "math.h"
#include <iostream>
#include <string>
#include "matrix.h"
class StaticNode {
public:
double split;
double label, loss;
int m_infty, m_s;
double pxs;
double... | ALGO | 0.999301 | 5.763451 |
7d2a5d91-ff59-4825-9a2b-722058ae2fcd | erhant/parallel-programming | projects/noise-remover/src/noise-remover.cpp | #include "noise-remover.hpp"
void driver_function() {
// (HOST) Part I: Allocate and initialize variables
double time_0, time_1, time_2, time_3, time_4, time_5, time_6, time_7, time_8; // time variables
time_0 = get_time();
const char* filename = "input.pgm";
const char* outputname = "output.png";
int wid... | ALGO | 0.997178 | 5.714964 |
bea4416b-6ae8-4cc5-9d87-5da6a85b1013 | hceng123/VisionLibrary | libzxing/core/src/zxing/qrcode/decoder/BitMatrixParser.cpp | #include <zxing/qrcode/decoder/BitMatrixParser.h>
#include <zxing/qrcode/decoder/DataMask.h>
namespace zxing {
namespace qrcode {
int BitMatrixParser::copyBit(size_t x, size_t y, int versionBits) {
return bitMatrix_->get(x, y) ? (versionBits << 1) | 0x1 : versionBits << 1;
}
BitMatrixParser::BitMatrixParser(Ref<Bi... | ALGO | 0.963073 | 5.189961 |
d48ab8c9-c761-486c-9dad-4c698da30795 | Aelhfnawi/tech-interview-practice-medium | Minimize Maximum of Array/Minimize Maximum of Array/Minimize Maximum of Array.cpp | #include <vector>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
int min_max_pain_1(vector<int>& arr)
{
int result, total = arr[0];
for (int i = 0; i < arr.size(); i++)
{
total += arr[i];
result = max(result, int(ceil(double(total) / (i + 1))));
}
return result;
}
int main(... | ALGO | 0.99949 | 3.98871 |
114c648c-40c6-4105-a29a-548018eb7864 | davidsilvamota/github_flutter | 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.998859 | 6.785645 |
06188176-bf5b-4e1a-8bb1-a8f02f22b830 | redhead520/kaggle-avazu-AI3 | Reference_Projects/kaggle-avazu-4 Idiots/bag/mark/src/common.cpp | #include <stdexcept>
#include <cstring>
#include <omp.h>
#include "common.h"
namespace {
int const kMaxLineSize = 1000000;
} //unamed namespace
Problem read_problem(std::string const path)
{
if(path.empty())
return Problem();
Problem prob;
FILE *f = open_c_file(path.c_str(), "r");
char lin... | ALGO | 0.997921 | 5.789521 |
31cffa22-955d-48d1-9388-b4a63105716f | SkyLoaderr/xray-short-story | SDK/sources/MagicSoftware/FreeMagic/Source/Distance3D/MgcDist3DTriTri.cpp | #include "MgcDist3DLinTri.h"
#include "MgcDist3DTriTri.h"
using namespace Mgc;
//----------------------------------------------------------------------------
Real Mgc::SqrDistance (const Triangle3& rkTri0, const Triangle3& rkTri1,
Real* pfTri0P0, Real* pfTri0P1, Real* pfTri1P0, Real* pfTri1P1)
{
Real fS, fT, f... | ALGO | 0.998894 | 6.594707 |
4527caa6-fd88-4b78-b83e-a6f187ebd2cf | Shivam2501/MSI-GEM5 | src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage1.cpp | /*****************************************************************************
stage1.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************... | ALGO | 0.953363 | 5.858161 |
62c034dd-8597-4b39-ab98-c9e0a47e9fc1 | shreyas-mante/Codeforces | CCDECLONG1.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ll d1 , v1 , d2 , v2 , p;
cin>>d1>>v1>>d2>>v2>>p;
ll cnt = 0;
while(1)
{
cnt++;
if(cnt>=d1)//first vaccine
{
p = p - v1;
}
if(cnt>=d2)//second vaccine
{
p = p - v2;
}
if(p<=0)
{
break;
}
}... | ALGO | 0.999665 | 3.355081 |
5309ee63-3329-4329-8a9f-0890d6013701 | 9-to/AtCoder | ABC2XX/ABC208/ABC208b.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
/* alias */
using ull = unsigned long long;
using ll = long long;
/* define short */
#define all(obj) (obj).begin(), (obj).end()
#define YESNO(bool) if(bool){cout<<"YES"<<endl;}else{... | ALGO | 0.991281 | 3.349407 |
c74a0a1b-f42f-44ed-a36d-e694df8a6386 | sourav819/Practice-Questions-LeetCode | 0101-symmetric-tree/0101-symmetric-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.999981 | 6.546666 |
c52099b3-b3b6-43bd-86ad-3581487ae765 | XinXin9527/nori | nori/src/direct.cpp | NORI_NAMESPACE_BEGIN
class DirectIntegrator : public Integrator {
public:
DirectIntegrator(const PropertyList &props) {}
Color3f Li(const Scene *scene, Sampler *sampler, const Ray3f &ray) const override {
Intersection its;
Color3f color = 0;
if (!scene->rayIntersect(ray, its))
... | ALGO | 0.860961 | 6.230278 |
324a876c-798a-4d41-a92e-10d618a4eba2 | Abhiram-Sharma/DSA-Projects | Sudoku Solver/main.cpp | #include <iostream>
using namespace std;
class Sudoku {
public:
static bool isSafe(int sudoku[][9], int row, int col, int digit) {
// for column
for (int i = 0; i < 9; i++) {
if (sudoku[i][col] == digit) {
return false;
}
}
// for row
for (in... | ALGO | 0.999779 | 6.745281 |
708d9f7d-c184-4805-82a3-405abdd74ec4 | YochevedOfstein/CPP_EX2 | Graph.cpp |
#include "Graph.hpp"
using namespace std;
using namespace ariel;
Graph::Graph(){
this->numOfVertices = 0;
this->isDirected = false;
this->isWeighted = false;
this->hasNegativeWeights = false;
}
void Graph::loadGraph(vector<vector<int>> &matrix){
this->numOfVertices = matrix.size();
this->a... | ALGO | 0.887241 | 5.455739 |
48662fec-a284-47e3-8363-e1ebae99f401 | PrivateFGP/ophelib | src/paillier_fast.cpp | #include "ophelib/paillier_fast.h"
#include "ophelib/random.h"
#include "ophelib/omp_wrap.h"
namespace ophelib {
PaillierFast::PaillierFast(const size_t key_size_bits_, const size_t a_bits_, const size_t r_bits_)
: PaillierBase(key_size_bits_),
a_bits(a_bits_),
r_bits(r_bits... | TOOL | 0.864543 | 6.656976 |
5721500e-f993-4e63-af4e-de479ce2143b | RexSkz/Walker | src/Tackler.cpp | #include "Tackler.h"
#include "WorldState.h"
/**
* Constructor.
*/
Tackler::Tackler()
{
}
/**
* Destructor.
*/
Tackler::~Tackler()
{
}
/**
* instance.
*/
Tackler & Tackler::instance()
{
static Tackler tackler;
return tackler;
}
/**
* Update data used by tackle.
* \param agent.
*/
void Tackler::Upda... | ALGO | 0.973219 | 5.672218 |
4b9d8777-31ba-46b5-be3f-da874d49627a | imvskalhans/DSA-Codes | Easy/Level order traversal in spiral form/level-order-traversal-in-spiral-form.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
r... | ALGO | 0.999973 | 6.796311 |
95354618-3e88-4ef7-96bb-e9873d11d452 | nikhil-chourase/medidoc | 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 |
836f1c73-7061-4f0c-9730-046aaa8e46ea | raincross7/code-similarity | codes/train_code/problem148/problem148_82.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <u... | ALGO | 0.999827 | 3.700521 |
6a21ee6e-c09f-4910-b0a8-1ce594958d88 | stdcyanout/special-studies | rectangle_cutting/result/r4.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 60
int n, m, ret, cnt = 0;
int a[N];
void solve (int h, int k, int c) {
if (c >= ret)
return;
int l = 0;
while (h + l < m && k + l < n && a[h] >= a[h + l]) {
l = l + 1;
for (int i = 0; i < l; i++)
a[h + i] += l;
... | ALGO | 0.999946 | 3.850854 |
bade1ca6-e040-435b-896a-628cfb9fe39e | rajab1691/LeetCode-Interview | BinaryTree/heightbt.cpp | /*
->calculate left height and right height and return maximum b/w them
T.C and S.C= O(n)
*/
int heightOfBt(Node* root){
if(root==NULL)
return 0;
int lheight=heightOfBt(root->left);
int rheight=heightOfBt(root->right);
int resultHeight=1+max(lheight,rheight);
return resultHeight... | ALGO | 0.999872 | 3.423723 |
51ab9f1f-727d-494a-be8a-98a84b97b2cb | donggoolosori/programmers-solve | Level3/단속카메라/1.cpp | #include <algorithm>
#include <string>
#include <vector>
using namespace std;
int solution(vector<vector<int>> routes) {
int answer = 0;
sort(routes.begin(), routes.end());
for (int i = 0; i < routes.size(); i++) {
answer++;
int s = routes[i][0], e = routes[i][1];
int j;
for (j = i + 1; j < rou... | ALGO | 0.999742 | 5.430756 |
36904c90-4e36-4394-90ac-05dda0e9b506 | Aditya16102002/deode-DSA-assignment | Input&OperatorsAssignment/DifferenceBetweenASCII.cpp | #include <iostream>
using namespace std;
int main()
{
char ch1, ch2;
cout << "Enter first Character: ";
cin >> ch1;
cout << "Enter second Character: ";
cin >> ch2;
int diff=int(ch1)-int(ch2);
cout<<"Difference between entered characters = "<<diff;
} | ALGO | 0.99615 | 3.497186 |
aef5f77c-dbf5-4df0-b4f3-f1580e423cd5 | oshinoooo/leet_code | problems0238/main.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> productExceptSelf(vector<int>& nums) {
int n = nums.size();
vector<int> left(n, 1);
for (int i = 0; i < n - 1; ++i)
left[i + 1] = left[i] * nums[i];
vector<int> right(n, 1)... | ALGO | 0.999976 | 5.499307 |
58fdd7ec-e6d2-4a7b-a83a-da98b5303b97 | DQIX/dqix-decomp | src/Combat/Main/CritRateCalculation.cpp | #include <globaldefs.h>
ARM float CalculateCritRate(int deftness, float accessoryBonus, float bookBonus, float skillBonus, unsigned char hitCount) {
float baseChanceFloat;
float critChance;
float hitCountFloat;
float minimumChance = 2.0f;
int baseChance = (deftness - 150) * 0x10000 >> 0x10;
if (... | ALGO | 0.993012 | 5.161282 |
144d174a-9b3e-40c4-987e-522e4e7994a9 | xiangtian/alogorithm | leetCode/80_remove-duplicates-from-sorted-array-ii.cpp | #include<vector>
class Solution {
//从左向右遍历、如果下一个元素等于当前元素&&hasDup==false,
//左指针和i同时后移,否则只移动i。
public:
int removeDuplicates(std::vector<int>& nums) {
if(nums.size() <= 2){
return nums.size();
}
bool hasDup = false;
int left = 0;
int right = 0;
while(right < ... | ALGO | 0.99981 | 5.46072 |
883faff2-5ae0-40b4-ba65-66c4f75446bb | hello-habibi/Problem-solving | A_Required_Remainder.cpp | #include <bits/stdc++.h>
using namespace std;
#define no cout<<"NO"<<endl;
#define yes cout<<"YES"<<endl;
#define vl vector<long long>
#define vi vector<int>
#define vs vector<string>
#define iip pair<int,int>
#define lip pair<long long , int>
#define isp pair<int,string>
#define ss stack<string>
#define is stack<int>... | ALGO | 0.999885 | 3.691711 |
7232a47d-74b1-4beb-9e29-22ffa7e60e02 | kkt219a/OnlineJudge | BOJ/2805.cpp | //백준 - 나무 자르기 - 2805
#include<iostream>
#include<algorithm>
using namespace std;
int n, m, a[1000000], i, s, e, t;
long long an, h;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
for (cin >> n >> m; i < n; cin >> a[i++], e = max(e, a[i - 1]));
for (; s <= e;) {
t = (s + e) / 2;
for (h=0, i = 0; i < n; i... | ALGO | 0.999986 | 4.038312 |
a670fd2b-a35b-4ccc-9493-0548d5d23b68 | bytor13/codeforces | 236a_boyOrGirl.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int x = 97, r = 0;
int v[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
string s;
cin >> s;
for(int i = 0; i < (int) s.length(); i++){
v[(int) s[i] -97] += 1;
}
for(int i = 0; i < 26; i++){
if(v[i]... | ALGO | 0.999754 | 3.937284 |
e297a4e5-3583-483d-90c4-af9aa6cbad5a | Leonel011/alamboy_mj | Labs C++/promedioLluvia.cpp | //Desarrolle un programa que determine el promedio de 12 temperaturas recogidas
//durante los meses de un año. Las temperaturas entre cada mes pueden variar.
#include<iostream>
using namespace std;
int main()
{
int meses = 12;
double temperatura,promedio;
double sumaTemperatura = 0;
//Solicitar las t... | ALGO | 0.960341 | 3.110539 |
247bc8f2-cc86-424d-9b88-ee704c9f3c89 | mihauvuong2008/GA_NEURAL | GA2/src/RouletteWheelSelection.cpp | /*
* RouletteWheelSelection.cpp
*
* Created on: Feb 21, 2017
* Author: NgocDong
*/
#include "RouletteWheelSelection.h"
#include <stdio.h>
#include <climits>
#include <string>
#include "GENE.h"
#include "EvaluatedCandidate.h"
#include <cstdlib>//random
namespace std {
RouletteWheelSelection::RouletteWheelS... | ALGO | 0.99983 | 5.155893 |
69da30b9-6874-48a6-858e-609ee8b1de0f | ishandutta2007/codeforces | unused/normal/848/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int k;
scanf("%d", &k);
if (k == 0)
{
printf("z\n");
return 0;
}
char last = 'a';
for (int i = 100000; k;)
{
if (i * 1ll * (i - 1) / 2 <= k)
{
printf("%s", string(i, last++).c_str());
k -= i * (i - 1) / 2;
}
else --i;
}
printf("\... | ALGO | 0.999551 | 3.438874 |
4b66d47f-ce80-44a0-b861-6f865ee507ff | naru-19/procon | tenkei90/52.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, j, n) for (ll i = j; i < n; ++i)
#define Sort(a) sort(a.begin(), a.end())
#define Sortr(a) sort(a.rbegin(), a.rend())
using ll = long long;
#define tobit(x, i) (((x) >> (i)) & 1)
#define IN... | ALGO | 0.999758 | 4.574039 |
d3dbae44-6779-4a3c-a1cc-772baff823fd | fmills89/cosc-1437-assignments | chapter-08/main.cpp | // Forrest Mills
// Assignment #1
// 08/11
// Write a program that uses two identical arrays of at least 20 integers. It should call a function that uses the bubble sort algorithm to sort one of the arrays in ascending order. The function should keep a count of the number of exchanges it makes. The program then shou... | ALGO | 0.998765 | 5.114079 |
88d1e399-8b59-4f9f-8a64-320321165118 | pingchungchang/CP | ABC218E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
const int mxn = 2e5+10;
tuple<int,int,int> arr[mxn];
int dsu[mxn],sz[mxn];
int n,m;
int root(int k){
return k == dsu[k]?k:dsu[k] = root(dsu[k]);
}
vo... | ALGO | 0.999945 | 4.081503 |
4ef74774-021c-4629-8b9f-59348f53f450 | wazenmai/Leetcode | Medium/1514_path_with_maximum_probability/solution2.cpp | /**
* Title: Path with Maximum Probability (Leetcode Medium 1514)
* Author: Bronwin Chen <<EMAIL>>
* Date: 27, August, 2024
* Method: Use maxProb to record the maximum probability of each node, so we can avoid the duplicate nodes in the priority queue.
* Result: Time complexity is O(m + nlogn) when using Fibona... | ALGO | 0.999975 | 6.636612 |
5201ac06-f161-4bd1-bbee-7195046d60dc | BitsBob/aoc24 | d5/main.cpp | #include <vector>
#include <iostream>
#include <unordered_map>
#include <string>
#include "../utils/utils.h"
std::unordered_map<int, std::vector<int>> parse_rules(const std::vector<std::string>& rlines) {
std::unordered_map<int, std::vector<int>> graph;
for (const auto& line : rlines) {
auto parts = s... | ALGO | 0.997641 | 6.211902 |
b6a3278d-0fbf-45b0-a1b2-d83cdf4871fa | Adii-Khandelwal/LeetCode-Solutions | 0154-find-minimum-in-rotated-sorted-array-ii/0154-find-minimum-in-rotated-sorted-array-ii.cpp | class Solution {
public:
int findMin(vector<int>& nums) {
int low=0;
int high=nums.size()-1;
int ans=min(nums[0],nums[nums.size()-1]);
while(low<=high)
{
int mid=(low+high)/2;
if(nums[low]==nums[mid] and nums[mid]==nums[high])
... | ALGO | 0.999974 | 5.737691 |
f29d33d5-3ef2-43c3-881e-86d5c3a14ed7 | saumayyyy/CC | CC/Brokentelephone.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> arr(n);
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int cnt = 0;
vector<bool> vis(n, false);
for (int i =... | ALGO | 0.999938 | 4.893062 |
f7f41d68-2e80-4c4d-8f65-54c744916978 | Heiuhoccode/CODE_CPP | TH6.cpp | #include<bits/stdc++.h>
using namespace std;
struct thisinh{
int mats;
char ename[100];
float dim;
string dantoc;
int khuvuc;
char do_truot[100];
};p
void nhap(thisinh ds[], int n){
// cin.ignore();
for(int i=0; i<n; i++){
cin.ignore();
ds[i].mats = i+1;
cin.getline(ds[i].name,100);
cin >> ds[i].diem;
... | ALGO | 0.994492 | 3.713552 |
3e9abe07-d57e-4dd4-993c-2866602bdddb | eggBOY91/Arctic-Core | dep/src/g3dlite/filter.cpp | /**
@file filter.cpp
@author Morgan McGuire, http://graphics.cs.williams.edu
@created 2007-03-01
@edited 2007-03-01
Copyright 2000-2007, Morgan McGuire.
All rights reserved.
*/
#include "G3D/filter.h"
namespace G3D {
void gaussian1D(Array<float>& coeff, int N, float std) {
coeff.resize(N);
flo... | ALGO | 0.998076 | 4.061213 |
909a061c-72a1-4ef1-a60b-71d252fa8081 | KatsuyaKikuchi/ProgrammingContest | AtCoder/企業コンテスト/日立製作所 社会システム事業部 プログラミングコンテスト/2020/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)
const ll MOD = 1000000007;
const ll INF = (ll) 1e15;
ll A[100005];
ll B[100005];
int main() {
cin... | ALGO | 0.999975 | 4.899099 |
fcbeb3d3-c8da-4efd-9aa6-777aa263e540 | jain-arham-hsr/strivers-a2z-dsa-course | 01. Learn the basics/02. Build-up Logical Thinking/pattern-15.cpp | // Problem Statement:
// https://www.naukri.com/code360/problems/reverse-letter-triangle_6581906
#include <iostream>
class Solution {
public:
void nLetterTriangle(int n) {
for (int i = n; i > 0; i--) {
std::string row;
for (int j = 1; j <= i; j++) {
if (!row.empty()) {
row += " ";
... | ALGO | 0.998943 | 6.021261 |
927d80ee-ebe2-49f6-b14f-15d7883e0da9 | jaisat/CP_Codes | DP/Dp_codes/min_pathsum.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ff first
#define ss second
#define int long long
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#de... | ALGO | 0.999951 | 3.794943 |
813ea16e-47c5-4453-9cfb-f3a3d1df4701 | ssharma1991/autonomous-car-highway-driving | src/Eigen-3.3/doc/examples/Tutorial_BlockOperations_block_assignment.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
Array22f m;
m << 1,2,
3,4;
Array44f a = Array44f::Constant(0.6);
cout << "Here is the array a:" << endl << a << endl << endl;
a.block<2,2>(1,1) = m;
cout << "Here is now a with m copied into its cent... | ALGO | 0.953164 | 3.331377 |
fcefa1ca-a15d-4821-80dd-718cd303e6e1 | hadeer-r/LeetCode | 0724-find-pivot-index/0724-find-pivot-index.cpp | class Solution {
public:
int pivotIndex(vector<int>& nums) {
int sz = nums.size();
vector<int> prefix(sz);
vector<int> postfix(sz);
prefix[0]=nums[0];
postfix[sz-1]=nums[sz-1];
// get prefix sum
for(int i=1;i<nums.size();i++){
prefix[i]= prefix[i-... | ALGO | 0.999991 | 6.215742 |
721f73fe-4cf8-427f-ba54-1ee4dcd6d03c | sahildando/CP-Tourist | 1284-four-divisors/1284-four-divisors.cpp | class Solution {
public:
int sumFourDivisors(vector<int>& nums) {
int maxNum = *max_element(nums.begin(), nums.end());
// Sieve to get all primes up to maxNum
vector<bool> isPrime(maxNum + 1, true);
isPrime[0] = isPrime[1] = false;
for (int i = 2; i * i <= maxNum; +... | ALGO | 0.999928 | 6.759273 |
bd238e55-7c70-4464-9960-04222173dd27 | JamidIsrael39/repo-uno | Cpp_deitel/Capitulo_1/ejercicios/ej2_19.cpp | #include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main() {
int numero_1{0}, numero_2{0}, numero_3{0};
cout << "Ingrese tres numeros enteros diferentes: ";
cin >> numero_1 >> numero_2 >> numero_3;
cout << "La suma es: " << numero_1 + numero_2 + numero_3 << "\n" << endl;
cout << "El pro... | ALGO | 0.971848 | 3.66671 |
e9f5bfae-f697-49ff-90f0-4b5fb5fd35b6 | Tuannt2004/CTDL_GT3 | CON4_32.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll cnt;
void Merger(ll *a, int l, int m, int r){
vector<ll> x(a+l, a+m +1);
vector<ll> y(a+m+1, a+r+1);
int i=0,j=0;
int k =l;
while(i < x.size() && j < y.size()){
if(x[i] <= y[j]){
a[k]=x[i];k++;i++;
... | ALGO | 0.999924 | 4.6703 |
1f921c2b-983c-466b-b094-b7231dcf1d89 | shentoumengxin/2024Autumn | Data Structure and Algorithm Anlysis/CS203 DSAA Code/.history/lab7/E_20241207140208.cpp | // 找出最小的,左和右都试一次,选最大的合并。
// 链表,小顶堆.
// 和他爸比较,决定上浮或者下沉
// 删除这个表,幽灵节点。打标记.
// 删除时检查堆顶,如果是幽灵,就删除幽灵
#include<iostream>
#include<vector>
using namespace std;
class node{
node* next=nullptr;
node* prev=nullptr;
int num;
};
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
int N;
cin>>N;
long lo... | ALGO | 0.999975 | 3.586968 |
84fefef3-20da-423c-b25c-0988f543410c | ZSM-SKow/DziadowskieCPP | SmietnikLekcje/nwd.cpp | #include <iostream>
using namespace std;
int main()
{
int a,b,w1,w2;
cout << "daj a: ";
cin >> a;
cout << "daj b: ";
cin >> b;
// NWD z odejmowaniem
// NWD z modulo
if(a<=0 || b<=0) {
cout << "kys" << endl;
}
else {
... | ALGO | 0.999805 | 3.627934 |
77b39c8e-d516-4601-aa76-b7b9f023d163 | parksandrecs/cvfd | opencv/3rdparty/carotene/src/gaussian_blur.cpp | #include "common.hpp"
#include "saturate_cast.hpp"
#include "separable_filter.hpp"
namespace CAROTENE_NS {
bool isGaussianBlur3x3Supported(const Size2D &size, BORDER_MODE border)
{
return isSupportedConfiguration() && size.width >= 8 &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_... | ALGO | 0.993403 | 6.777441 |
04cdc4cc-e11a-4fa0-b734-4b38202eaf7e | sjtao98/Leetcode_backup_2 | 1580-put-boxes-into-the-warehouse-ii/1580-put-boxes-into-the-warehouse-ii.cpp | class Solution {
public:
int maxBoxesInWarehouse(vector<int>& boxes, vector<int>& warehouse) {
int m = warehouse.size();
vector<int> copy_ware(m);
int mn = INT_MAX;
for(int i = 0; i < m; i++){
mn = min(mn, warehouse[i]);
copy_ware[i] = mn;
... | ALGO | 0.999979 | 5.922782 |
092b7903-5339-4074-b8fd-233228ef860d | LnwZaZaToon/Algorithm | dp22.cpp | #include<bits/stdc++.h>
using namespace std;
int TopDown(vector<int>vec,int k ,vector<int>&memo){
if( k == 0) return 0 ;
if( k < 0) return INT_MAX;
if(memo[k] != -1 )return memo[k];
int count = INT_MAX;
for(int i = 0 ; i < vec.size() ; i++){
if(k >= vec[i]){
int res = TopDown(vec,k-vec[i],memo);
if(re... | ALGO | 0.999996 | 3.785802 |
1606e656-3aac-405d-ad00-cd530fbfcaab | eavpsp/cbr_decomp | ChibiRobo_Dol_Inject/ext/src/JSystem/JMath/JMATrigonometric.cpp | #include "math.h"
#include "JSystem/JMath.h"
#include "types.h"
/**
* @note Address: N/A
* @note Size: 0xD4
*/
// void atan___Q25JMath18TAtanTable<1024, f32> CFf()
f32 JMath::TAtanTable<1024, f32>::atan_(f32) const
{
// UNUSED FUNCTION
}
f32 orderfloats(f32 x)
{ // needed to get the right order for the floats and... | ALGO | 0.921506 | 5.689036 |
f2598dd9-738c-4415-9df7-df2699778fb0 | irlac/random | timetest.cpp | #include <iostream>
#include <chrono>
#include <ctime>
using namespace std;
int main() {
auto start = chrono::system_clock::now();
// Some computation here
auto end = chrono::system_clock::now();
chrono::duration<double> elapsed_seconds = end-start;
time_t end_time = chrono::system_clock::to_t... | ALGO | 0.91356 | 4.662261 |
2db12eb4-7da6-4918-aac6-9773c0e4678c | Zela2520/cpp-park-vk-education-ASD | module2/chainHashTable.cpp | #include <iostream>
#include <vector>
#include <string>
const size_t DEFAULT_CAPACITY = 8;
const size_t MAX_ALPHA = 2;
class StringHasher {
public:
StringHasher(unsigned int prime = 71) : m_prime(prime) {}
// Метод Горнера
size_t operator()(const std::string &str) {
si... | ALGO | 0.999676 | 5.39388 |
6260c48d-d4a1-4573-8ece-40ab92dd5c9b | MaruokaHaruki/GE3 | externals/DirectXTex/DirectXTexNormalMaps.cpp | #include "DirectXTexP.h"
using namespace DirectX;
using namespace DirectX::Internal;
namespace
{
#pragma prefast(suppress : 25000, "FXMVECTOR is 16 bytes")
inline float EvaluateColor(_In_ FXMVECTOR val, _In_ CNMAP_FLAGS flags) noexcept
{
XMFLOAT4A f;
static XMVECTORF32 lScale = { { { 0.2125f... | ALGO | 0.991711 | 7.582268 |
20007658-d0f9-4ff2-bdcf-af68259f862e | WeiZhang1988/YDORBSLAM | thirdParty/eigen/bench/benchVecAdd.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace Eigen;
#ifndef SIZE
#define SIZE 50
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef float Scalar;
__attribute__ ((noinline)) void benchVec(Scalar* a, Scalar* b, Scalar* c, int size);
__attribute__ ((noinline)) void be... | TOOL | 0.917394 | 5.111393 |
95891b28-e279-480b-b9c7-4d181d759ebf | nguoitamamo/thuattoan_codeC- | Source8.cpp | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
/*string chuyen(int n) {
string tmp = "";
while (n > 0) {
tmp += to_string(n % 2);
n /= 2;
}
return reverse(tmp.begin(), tmp.end());
}*/
int main()
{
string s; cin >> s;
reverse(s.begin(), s.end());
cout << s;
return 0;
} | ALGO | 0.999916 | 4.098696 |
f882053b-80d9-4dad-bc26-0e5cc6df691d | jluissandovalm/lammps_smd | lib/gpu/lal_yukawa_ext.cpp | /***************************************************************************
yukawa_ext.cpp
-------------------
Trung Dac Nguyen (ORNL)
Functions for LAMMPS access to yukawa acceleration routines.
_______________________________... | TOOL | 0.866301 | 5.671866 |
0ba299f2-4418-43db-b21e-82a0ed6732bf | onera/Cassiopee | Cassiopee/Generator/Generator/Netgen/gprim/adtree.cpp | #include <mystdlib.h>
#include <myadt.hpp>
// class DenseMatrix;
#include <gprim.hpp>
namespace netgen
{
/* ******************************* ADTree ******************************* */
ADTreeNode :: ADTreeNode(int adim)
{
pi = -1;
left = NULL;
right = NULL;
father = NULL;
nchilds = 0;
di... | ALGO | 0.996528 | 3.465459 |
abbea671-2174-402a-89ad-007ed007475b | voldigoad-7/leetcode-gfg-solutions | 238-product-of-array-except-self/238-product-of-array-except-self.cpp | class Solution {
public:
vector<int> productExceptSelf(vector<int>& nums) {
int n=nums.size();
vector<int> result;
result.push_back(1);
int i=1;
while(i<n) {
int temp=result[i-1]*nums[i-1];
result.push_back(temp);
... | ALGO | 0.999968 | 6.278033 |
7c80f2d0-8dce-4781-a726-f5bdc25a26b8 | sl1296/acm-code | hdu-4819-1 TimeLimitExceed.cpp |
#include<cstdio>
#include<cstring>
#include<algorithm>
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;
int tree[2100][2100];
int treemin[2100][2100];
int n;
int a[810][810];
int maxrt;
int INF=2147483640;
void pushup2(int prt,int rt){
tree[prt][rt]=max(tree[prt][rt<<1],tree[prt][rt<<1|1]... | ALGO | 0.999902 | 3.704538 |
d0ff97e2-c709-4075-8e00-6fb33121dd3c | Ren-YamadaRY/projects | c++/kyopro/ACLPractice/sat.cpp | #include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vll>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using vvs = vector<vs... | ALGO | 0.999988 | 4.883976 |
b39cde50-96c4-45d2-9e02-bc5aaec78450 | Alvi847/Ejercicios_FAL | Vuelta atrás/Adornos_navidad_sin_estimacion/main.cpp | // Nombre del alumno Álvaro Cepeda
// Usuario del Juez FAL-J03
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
struct objeto_t
{
int coste;
int superficie;
int indice;
};
struct datos_t
{
int numObjetos;
vector<objeto_t> obje... | ALGO | 0.999927 | 4.300951 |
b7a47b72-a33a-4d77-8708-afb757a01c88 | Saleh7127/CPP-solution-by-Fellow_junior | Codeforces/cf547A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c=0,d,e,i,j,k,l;
cin>>a>>b;
if(b%a!=0)
{
cout<<"-1\n";
return 0;
}
else
{
b/=a;
while(b%2==0)
{
c++;
b/=2;
}
while(b%3==0)
{
c... | ALGO | 0.999971 | 3.571959 |
cc709222-a133-4a72-b96e-87be0328e070 | Sk1zzerW/Pokaz1 | Pokaz1/Pokaz1.cpp | #include <iostream>
using namespace std;
void copyArray(int* src, int* dest, int size) {
for (int i = 0; i < size; i++) {
*(dest + i) = *(src + i);
}
}
int main() {
int size = 5;
int srcArray[] = { 1, 2, 3, 4, 5 };
int* destArray = new int[size];
copyArray(srcArray, destArray, size);
... | ALGO | 0.878259 | 4.336411 |
f77f2001-959c-4b4d-911e-f4762801c1f2 | yuelinghou/leetcode_code | test_2021_6_17.cpp | #define _CRT_SECURE_NO_WARNINGS 1
// ݶַ
class Solution {
public:
string tree2str(TreeNode* root)
{
string s;
// ͷؿմ
if (!root)
{
return s;
}
// 1ȰѸڵֵӵַ
s += to_string(root->val);
// 2ӵַ
if (root->left)
{
s += '(';
s += tree2str(root->left);
s += ')';
}
else if (root->right)// עΪΪգ... | ALGO | 0.999896 | 5.548432 |
f4ddea44-b7be-439b-ba54-fca9865efc9c | abhishekrsingh/GFGProblems | Difficulty: Hard/LRU Cache/lru-cache.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// design the class in the most optimal way
class LRUCache {
private:
int capacity;
std::list<std::pair<int, int>> cacheList; // Stores key-value pairs in order of use
std::unordered_map<int, std::list<std::pair<int... | ALGO | 0.997767 | 6.405819 |
603e9da4-3d19-4609-b760-c6e4a19689db | someideal/smartshoot | Neural Network/src/retinex.cpp | #include "../include/retinex.h"
#include <math.h>
using namespace cv;
//#define USE_EXACT_SIGMA
#define pc(image, x, y, c) image->imageData[(image->widthStep * y) + (image->nChannels * x) + c]
#define INT_PREC 1024.0
#define INT_PREC_BITS 10
inline double int2double(int x) { return (double)x / INT_PREC; }
inline in... | ALGO | 0.997129 | 5.207083 |
70a128f6-815b-4877-a3dd-086986f0ab00 | wwtcecommunity/wwtccoin | src/zerocoin/SerialNumberSignatureOfKnowledge.cpp | /**
* @file SerialNumberSignatureOfKnowledge.cpp
*
* @brief SerialNumberSignatureOfKnowledge class for the Zerocoin library.
*
* @author Ian Miers, Christina Garman and Matthew Green
* @date June 2013
*
* @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green
* @license This pr... | ALGO | 0.967513 | 7.097405 |
17852038-d186-49b7-b1b2-b086751173c4 | thegamer1907/Code_Analysis | contest/1542558603.cpp | #include <bits/stdc++.h>
using namespace std;
class fast_iostream
{
protected:
static size_t constexpr buffer_size = 4096;
char buffer[ buffer_size ]; bool external_file; FILE *file; size_t position;
public:
fast_iostream( const string &file_name, const string default_file_name,
... | ALGO | 0.999666 | 3.713904 |
85479dd8-5fb1-45fd-8d2b-86e7972d5936 | brennangw/Sudoku-Solver | Sudoku Solver/main.cpp | //Inclusions
#include <iostream>
#include <fstream>
#include <string>
//Namespaces
using namespace std;
//Definations
#define WIDTH 9
#define HEIGHT 9
#define BOXSIZE 9
//Globals
//To save myself from having to pass this around I decided to just make it one variable.
int puzzle [WIDTH][HEIGHT];
//Funtion Declaratio... | ALGO | 0.999182 | 3.625231 |
28ab8559-33a3-46cb-a17c-95d8038197dc | keywet06/code | UOJ/UOJ2.cpp | #include <bits/stdc++.h>
const int C = 30;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr), std::cout.tie(nullptr);
int n, m;
std::cin >> n >> m;
int Ans = 0, Flag = true, m0 = 0, m1 = (1 << C) - 1;
for (int i = 0, x; i < n; ++i) {
std::string Oper;
std::ci... | ALGO | 0.999955 | 4.652452 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.