uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b6c2ed4c-592b-4fe4-a452-ee86c4917059 | Adhmkty99/Vayu | libcxx/test/libcxx/fuzzing/make_heap.pass.cpp | // UNSUPPORTED: c++03, c++11
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <vector>
#include "fuzz.h"
extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) {
std::vector<std::uint8_t> working(data, data + size);
std::make_heap(working.begin(), working.end());... | TEST | 0.958748 | 5.490818 |
cc7dcfc8-5f7a-4c34-8580-e2e9b967ae30 | Rarn1k/C_plus_plus | Proga lekcii/1 семестр/Proga_lek_30_10/Source.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int mult(int**x,int**y, int n)
{
int** z = new int* [n];
int i, j, k;
for (i = 0; i < n; i++)
z[i] = new int[n];
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
{
z[i][j] = 0;
for(k=0; k<n;k++)
z[i][j] = x[i][j] * y[i][j];
}
return **z;... | ALGO | 0.998258 | 3.685036 |
89a4ce4f-13df-4535-911a-07213120aea2 | TeogopK/Data_Structures_and_Algorithms_FMI | Week_00/Seminar/GT/Solutions/TwoSum.cpp | #include <iostream>
#include <chrono>
// we know that the array is sorted
size_t countPairs(int* arr, size_t count, int target) {
size_t result = 0;
for (size_t i = 0; i < count - 1; i++) {
for (size_t j = i + 1; j < count; j++) {
if (arr[i] + arr[j] == target) {
result++;
}
}
}
return result;
}
//... | ALGO | 0.999831 | 6.188167 |
a5355e65-5134-4e33-9fe8-e25a80e2ed9a | zhming0/Mingorithm | ACM/BOJ1039.cpp | #include<cstring>
#include<cstdio>
#include <iostream>
using namespace std;
char grid[110][110];
bool vst[110][110];
int main (int argc, const char * argv[])
{
int n,m;
while (~scanf("%d %d",&n, &m)) {
int ret=0;
for (int i=0; i<n; i++)
for (int j=0; j<m; j++)
scanf... | ALGO | 0.999806 | 3.848925 |
17630a4f-217f-4744-852c-e7ec9b27a87a | Shantanu9799/LeetCode-Problems | ShuffleString.cpp | class Solution {
public:
string convertToString(const vector<char>& chars) {
return string(chars.begin(), chars.end());
}
string restoreString(string s, vector<int>& indices) {
vector<char> charVector(s.size(), ' '); // Initialize to a default character
for (int i = 0; i < indices... | ALGO | 0.996774 | 6.595697 |
70bea411-d8b5-4a4e-b30e-ed07a14d6885 | AykhanMirzayev/IATC-Full-stack | task-01/fibonacci-master/fibonacci.cpp | // Online C++ compiler to run C++ program online
#include <iostream>
using namespace std;
int main() {
int x,first,next,sum;
first=0;
next=1;
cin >>x;
while(next<=x){
cout<<sum<<" ";
sum=first+next;
first=next;
next=sum;
}
return 0;
}
| ALGO | 0.999868 | 3.569501 |
6336fc19-2c93-4efe-89c4-333a68da7ae0 | Prince-in-the-wood/2022-01-2110211_Intro-Data-Struct_Grader | ex00e2_Min-Max/main.cpp | #include <iostream>
using namespace std;
int main()
{
int arr[110][110];
int n, m;
int r;
cin >> n >> m;
cin >> r;
for( int i = 0 ; i < n ; i++ ){
for( int j = 0 ; j < m ; j++ )
cin >> arr[i][j];
}
int r1, c1, r2, c2;
for( int k = 0 ; k < r ; k++ ){
... | ALGO | 0.993874 | 4.098764 |
09b60157-117b-4d87-b3a2-27cfa90dc16a | ajusa/ArduCopter | heli.cpp | #include "Copter.h"
// Traditional helicopter variables and functions
#if FRAME_CONFIG == HELI_FRAME
#ifndef HELI_DYNAMIC_FLIGHT_SPEED_MIN
#define HELI_DYNAMIC_FLIGHT_SPEED_MIN 500 // we are in "dynamic flight" when the speed is over 1m/s for 2 seconds
#endif
// counter to control dynamic flight profile
s... | TOOL | 0.894139 | 6.538283 |
99c79a3e-466e-46b9-b14e-19afd56e52e2 | karan-kap00r/DSA-ALGO | Check If Two Trees are Identical.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int x){
data = x;
left = NULL;
right = NULL;
}
};
bool helper(Node* r1,Node* r2)
{
if(r1==NULL && r2==NULL)return true;
if(r1=... | ALGO | 0.999823 | 7.307196 |
afff0c8b-921f-4e45-9625-3f25e5b3026b | ishandutta2007/codeforces | alireza_kaviani/normal/1627/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define all(x) (x).begin(),(x).end()
#define X first
#define Y second
#define sep ' '
#define endl '\n'
#define SZ(x) ll(x.size())
const ll MAXN = 1e... | ALGO | 0.999702 | 4.215885 |
24fb0484-789c-44ed-b2ab-42c5c612b5d4 | ir-rafio/iut-algorithms-lab-2a-summer-23-24 | Lab 2/Task A/submission/220041203_lab2_taskA.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
using LL = long long;
void pre()
{
fastio;
}
void solve(int tc)
{
int n,x;
cin>>n>>x;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
sort(arr,arr+n);
int c=0;
for(int i=0;i<... | ALGO | 0.99987 | 4.499164 |
2f16882a-1d67-458a-beb8-db10e477a794 | Rexx0801/codeptit_c_cpp | chiahetcho11.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
string s;
cin>>s;
int tongchan=0,tongle=0;
for(int i=0;i<s.size();i++){
if(i%2==0){
tongchan=tongchan+s[i]-'0';
}else{
tongle=tongle+s[i]-'0';
}
}
int hieu=tongle-tongchan;
if(hieu%11==0) cout<<"1"<<en... | ALGO | 0.999893 | 4.171209 |
6a545295-15c0-4ddd-8091-51d258236926 | Atharvatonape/Cpp | Linkedlist.cpp | #include<iostream>
#include<stdio.h>
#include<string.h>
#include<vector>
using namespace std;
class node{
public:
int data;
node * next ;
node(int val){
data = val;
next = NULL;
}
};
void insertail(node* &head, int val){
node * n = new node(val);
//check for the null ... | ALGO | 0.999768 | 4.261071 |
35437b3f-964c-4107-96e3-eb09cf404a73 | siolag161/competitive-programming | classic/primegene.cpp |
#include <queue>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <stdio.h>
using namespace std;
char primes[1000000002];
int main()
{
int N;
scanf("%d\n", &N);
for (int i = 0; i < N; i++)
{
unsigned long l,r;
scanf("%lu %lu", &l,&r);
printf("%c\n", primes[i]);
}
retu... | ALGO | 0.999538 | 3.297056 |
895dec13-0a31-4bd4-a33a-310d0d425960 | tzchuen/cs221 | lab_avl/avltree.cpp | /**
* @file avltree.cpp
* Definitions of the binary tree functions you'll be writing for this lab.
* You'll need to modify this file.
*/
template <class K, class V>
V AVLTree<K, V>::find(const K& key) const
{
return find(root, key);
}
template <class K, class V>
V AVLTree<K, V>::find(Node* subtree, const K& k... | ALGO | 0.999008 | 6.307448 |
57c2f8d2-c2f6-415d-bcd8-9da9b1def4fc | MarioChao/CPP_Class | CodeSkipping_Mar21/Q9.cpp | #include <iostream>
using namespace std;
void findFirstEven(int (&arr)[10]) { // 9)
// Accepts an array reference in order to use sizeof()
for (int i = 0; i < sizeof(arr) / sizeof(arr[0]); i++) {
// Check if number is even
if (arr[i] % 2 == 0) {
cout << "The first even number is " <... | ALGO | 0.963672 | 5.145563 |
0c84b273-4615-4016-8243-f92d1c9ef954 | Riahovsky/sem3 | week01/trig_lib/src/my_math.cpp | #include <iostream>
#include "my_math.hpp"
using namespace std;
AnswerHandler my_sin(double x) {
double a = x-(x*x*x)/6 + (x*x*x*x*x)/120 - (x*x*x*x*x*x*x)/5040;
cout << "sin " << x << " = " << a << endl;
AnswerHandler result;
result.x = x;
result.fun = a;
}
void my_cos(double x){
doubl... | ALGO | 0.98733 | 4.605594 |
df7123e8-e99b-4c63-ba1d-616f1ef84273 | Nakib-Arman/CSE318---ArtificialIntelligence | 4.DecisionTree/.history/a_20250710110112.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
int column_num;
string label;
unordered_map<string,Node*> children;
float threshold;
public:
Node(int column_num){
this->column_num = column_num;
this->label = "";
this->threshold = 0;
}
Node(string labe... | ALGO | 0.999349 | 4.346977 |
b9d3a9be-8842-4403-822b-2c782d6da02f | Takatakatake/Cafemol_jigakuyou | utility/RESPAC/surface/src/util.cpp | #include <iostream>
#include <fstream>
#include <map>
#include <cmath>
#include <limits.h>
#include "util.hpp"
using namespace std;
void decide_surface(Pqr& pqr, Grid& grid, Input& input) {
vector<int> surface_flag( grid.size(), 1 );
int ipoint = 0;
for (int ix = 0; ix < grid.get_nx(); ++ix) {
for (int iy =... | ALGO | 0.995908 | 3.925788 |
31677455-c27c-4fd7-8ddf-74a9d1d7d59b | intjarmansuri/gfg_potd | Delete Alternate Nodes.cpp | /*
Structure of the node of the binary tree
struct Node
{
int data;
struct Node *next;
Node(int x){
int data = x;
next = NULL;
}
};
*/
// Complete this function
class Solution {
public:
void deleteAlt(struct Node *head) {
if(head == NULL || head->next == NULL) {
... | ALGO | 0.999501 | 5.598919 |
1c526005-867c-45d0-9703-b44ad178917e | cloudcalvin/Algorithms-CPP | C++ program to implement optimal binary search tree.cpp | /********************************************************************
This Program is to implement optimal binary search tree
********************************************************************/
# include<stdio.h>
# include<conio.h>
# define SIZE 10
int p[SIZE]; //Probabilities with which we search for an element... | ALGO | 0.999984 | 4.32056 |
76c6c022-c0e5-4b9d-a40d-3ad98ef9c439 | Gurubalan-GIT/CCC | C++/Data-Structures/Tree/Trie.cpp | #include<bits/stdc++.h>
#include<string.h>
#include<tuple>
#define all(c) c.begin(),c.end()
#define tr(x,n) for(int i=x;x<n?i<n:i>=n;x<n?i++:i--)
#define ll long long int
#define pb push_back
#define em emplace_back
#define mt make_tuple
#define mp make_pair
#define debug(c) cout<<c<<endl;
#define find(v,x) find(all(v... | ALGO | 0.999591 | 4.360937 |
dcb68367-6ab4-4b3b-92c5-ee59eb1b0dc1 | lttthedev/SPOJ-VNOI-VNOJ-Solution | P145PROI-src.cpp | #include <iostream>
#include <string>
using namespace std;
string s;
long hoa, thuong, so;
long long res = 0;
long ok()
{
if (hoa * thuong * so == 0) return 0;
if (hoa + thuong + so >= 6) return 1;
return 0;
}
main()
{
cin >> s;
long n = s.length();
s = "@" + s;
long l = 1, r = 0;
hoa = 0;
thuong = 0;
so = 0... | ALGO | 0.994256 | 3.329096 |
7407b035-603a-4eed-b996-0f2f1335924e | mattboy64/LeetCodeSolutions | C++/88. Merge Sorted Array.cpp | /*
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively.
Merge nums1 and nums2 into a single array sorted in non-decreasing order.
The final sorted array should not be returned by the function, b... | ALGO | 0.999995 | 6.628188 |
0ef3eb62-47e6-445d-953d-3ef9bcda3bb7 | ghostincircuit/leetcode | maximum_product_subarray.cpp | #define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))
class Solution {
public:
int maxProduct(int A[], int n) {
int max = A[0];
int sn = 1;
int sp = 1;
for (int i = 0; i < n; i++) {
int cur = A[i];
int nsn = min(sn*cur, sp*cur... | ALGO | 0.999969 | 5.389647 |
6eb2fcf7-594d-452d-9e82-8a43da84aacc | CakeIturbe/ED.ACT1.2 | main.cpp | // =================================================================
//
// File: main.cpp
// Author:
// Date:
//
// =================================================================
#include <iostream>
#include <vector>
#include "header.h"
#include "search.h"
#include "bubble.h"
#include "selection.h"
#include "inserti... | ALGO | 0.942279 | 3.195331 |
33323e68-fd6f-4aaa-a2f2-3593d7564410 | nishabk910/cpp_projects | classwork/day1/calc/source/sub/sub.cpp | #include "calculator.h"
double sub(double a, double b) {
return a - b;
} | TOOL | 0.932787 | 4.063893 |
16808f07-0d15-4f1e-a63f-ee1510d3eb48 | mlml26/http_2.23_ddl | socket.cpp | #include "socket.hpp"
#include <cstdlib>
int Socket::createSocket(){
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if(sockfd == -1){
perror("can't create a socket.");
//exit(EXIT_FAILURE);
}
return sockfd;
}
int Server::connectListenFromServer() {
//进行... | WEB | 0.916186 | 3.740977 |
256d8343-f268-4503-9101-217c5d363f74 | gomfrien/codetree-TILs | 241008/정수 명령 처리 5/process-numeric-commands-5.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int N = 0;
int n =0;
cin>>N;
vector<int>arr;
for(int i = 0 ; i < N; i++)
{
string str="";
cin>>str;
if(str == "push_back")
{
n =0;
cin>>n;
... | ALGO | 0.982435 | 4.741914 |
98b934d5-b06a-4933-b450-492e49a3193c | HelloWorldZTR/OICodes | P1475 控制公司 Controlling Companies.cpp | #include<bits/stdc++.h>
using namespace std;
struct cp{
//int id;
int own[100];
int per[100];
int cnt;
} c[101];
int n, id, ct;
//set<pair<int, int> > ans;
int tot[101];
void doSolve(int n) {//ۼ n˾˾Ĺɷ tot[] ֻҪtoti>50,nƿi
//init();
if(ct++>3)
return;
if(c[n].cnt>0) {
for(int i=0; i<c[n].cnt; i++) {//... | ALGO | 0.999858 | 3.201008 |
6c5ecd17-055a-4799-b38f-e8a083b60930 | FinalTheory/ACM_Code | CF/CF_239B.cpp | /**
* @file CF_239B.cpp
* @brief 模拟水题,注意边界处理。
* 一开始装逼用string来写,但是不知道为什么迭代器用着会出错,迫不得已改用数组模拟了一遍。
* @author FinalTheory
* @version 0.1
* @date 2013-08-14
*/
#if defined(__GNUC__)
#pragma GCC optimize ("O2")
#endif
#if defined(_MSC_VER)
#pragma comment(linker, "/STACK:36777216")
#endif
#include <iostream>
#include... | ALGO | 0.999945 | 3.362832 |
b9d6adfa-1321-4e10-b787-d5b4df1a8da7 | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/evaluare/recursive/train/78825958-3c96-4f40-9f5f-75f024d1c10f.cpp | #include <fstream>
using namespace std;
ifstream in("evaluare.in");
ofstream out("evaluare.out");
const int N = 100000;
char s[N + 1];
int expresie();
int factor();
int termen();
int p;
int expresie()
{
int sum = termen();
while(s[p] == '+' || s[p] == '-')
{
if(s[p] == '+')
{... | ALGO | 0.999926 | 3.640323 |
05179c95-c206-463d-b719-e4ddc71530aa | Vaiofficial/Love-Babbar-DSA-Sheet-Solution | OOPS/staticpolymorphism.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
// fn overloading
// int add(int a, int b)
// {
// return a + b;
// }
// double add(double a, double b)
// {
// return a + b;
// }
// int add(int a, int b, int c)
// {
// return a + b + c;
// }
// fn overloading
class Vector
{... | TOOL | 0.859836 | 4.520683 |
3cbe5c65-b131-4ebc-84f0-0a9f92d388c4 | Reqzone015688/DsaAssignment | Lab 2/Problem 1.cpp | #include<iostream>
using namespace std;
int srch(int array[], int element){
if(array[0] == element){
return 0;
}
if(array[0] == -10){
return -1;
}
if(srch(array+1, element) == -1){
return -1;
}
else{
return 1+srch(array+1, element);
}
}
int ma... | ALGO | 0.999879 | 4.719701 |
ce1f6c2e-ba0d-47c3-a1d5-0cbd11b0e697 | Lut1n/ImpGears | src/OGLPlugin/ShadowCasting.cpp | #include <OGLPlugin/ShadowCasting.h>
#include <OGLPlugin/GlRenderer.h>
#include <ImpGears/SceneGraph/QuadNode.h>
#include <ImpGears/Descriptors/ImageIO.h>
#define GLSL_CODE( code ) #code
//--------------------------------------------------------------
static std::string glsl_shadowCasting = GLSL_CODE(
uniform sample... | ALGO | 0.981629 | 7.501922 |
4e354d49-6648-4f82-9f5a-cf5044df2f43 | MUHAMMEDSINANCP/CP-Smart-Home | 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.998809 | 6.763549 |
13b74d6a-2235-47ab-bf1d-d23570553112 | NafizEkbal/Codeforces-Solutions | 1883_B_Chemistry.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--) {
int n,k;
cin>>n>>k;
string s;
cin>>s;
unordered_map<char,int>mp;
for(int i=0;i<n;i++){
mp[s[i]]++;... | ALGO | 0.999974 | 4.723253 |
3c2f3183-47b6-441f-af59-0296802514b7 | Pisvyap/start | antlr4-runtime/include/misc/MurmurHash.cpp | #include <cstddef>
#include <cstdint>
#include <cstring>
#include "misc/MurmurHash.h"
using namespace antlr4::misc;
// A variation of the MurmurHash3 implementation (https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp)
// Here we unrolled the loop used there into individual calls to update(), as we ... | TOOL | 0.949281 | 7.468182 |
39a6ea18-c94e-4883-ae84-8ea932aba8b5 | DileepSathya/problem_solving | coding_round/sum_of strings.cpp | //link:https://leetcode.com/problems/calculate-digit-sum-of-a-string/description/
#include <iostream>
using namespace std;
string digitSum(string s, int k) {
while (s.length() > k) {
string new_s = "";
for (size_t i = 0; i < s.length(); i += k) {
int sum = 0;
for (size_t j ... | ALGO | 0.999978 | 6.86527 |
47ce0077-0ba2-4404-b1d4-672ad27b5fad | NCnguyencuong268/onl1 | CTDL>_Binary_Recursion_1.cpp | //Nguon tham khao: https://freetuts.net/de-quy-nhi-phan-binary-recursion-2953.html
#include <iostream>
using namespace std;
int fib(int n){
if(n <= 2)
return 1;
return fib(n - 1) + fib(n - 2);
}
| ALGO | 0.999923 | 4.744594 |
17c1c78b-cc12-4664-a15a-5a77adbf02ae | wanghq0130/savedmodel_client | include/eigen3/unsupported/test/polynomialsolver.cpp | #include "main.h"
#include <unsupported/Eigen/Polynomials>
#include <iostream>
#include <algorithm>
using namespace std;
namespace Eigen {
namespace internal {
template<int Size>
struct increment_if_fixed_size
{
enum {
ret = (Size == Dynamic) ? Dynamic : Size+1
};
};
}
}
template<int Deg, typename POLYNOMIAL... | TEST | 0.875366 | 6.350094 |
057b9af9-e435-49b1-bc99-1696f4396f55 | KnightChan/LeetCode-cpp | Source/p108 Convert Sorted Array to Binary Search Tree.cpp | #include "leetcode.h"
/**
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
cl... | ALGO | 0.999983 | 6.574125 |
4461d565-64e4-49f3-9979-224a1c4b26f5 | Murgowt/CodeBase | Freelancing/Cpp project/Section4_15.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
int n;
int sum=0;
float avg=0;
int max=0;
int number=0 ;
while(true){
cin>>n;
if(n<0){
break;
}
if(max<n){
max=n;
}
sum=sum+n;
number = number+1;
}
avg = sum/number;
cout<<max<<" "<<setprecisio... | ALGO | 0.999718 | 3.956452 |
5eddef62-5f70-4616-b756-a18a45262ca2 | NeoClear/leetcode-archive | ImplementTriePrefixTree/main.cpp | #include <bits/stdc++.h>
using namespace std;
class Trie {
class TrieNode {
public:
bool is_word;
vector<TrieNode *> child;
TrieNode():
is_word(false),
child(26, nullptr) {}
~TrieNode() {
for (TrieNode *c : child)
if (c) delet... | ALGO | 0.998782 | 5.693784 |
e61e719b-4deb-4949-9853-56b304a91e97 | abramcumner/xray16 | SDK/sources/MagicSoftware/FreeMagic/Source/Intersection2D/MgcIntr2DTriTri.cpp | #include "MgcIntervalIntersection.h"
#include "MgcIntr2DTriTri.h"
using namespace Mgc;
//----------------------------------------------------------------------------
// stationary triangles
//----------------------------------------------------------------------------
static int WhichSide (const Vector2 akV[3], const ... | ALGO | 0.998681 | 6.951456 |
a4a7fa6f-8d58-417d-b8d9-a824b093ee28 | ABKGroup/TritonPart | OpenROAD/src/drt/src/io/io_pin.cpp | /* Authors: Lutong Wang and Bangqi Xu */
#include "io.h"
using namespace fr;
void io::Parser::instAnalysis()
{
if (VERBOSE > 0) {
logger_->info(DRT, 162, "Library cell analysis.");
}
trackOffsetMap_.clear();
prefTrackPatterns_.clear();
for (auto& trackPattern : design_->getTopBlock()->getTrackPatterns(... | TOOL | 0.933434 | 4.652997 |
49a45a3b-ec6c-482a-9f78-6988eb5448ab | LEE930923/2023aaib3 | week07/week07-2a.cpp | class Solution {
public:
void myDrawBoard(int board[3][3]){
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout << board[i][j] << ' ';
}
cout<<"\n";
}
cout<<"\n";
}
bool testWin(int board[3][3],int now){
if(board[0][0]==now && ... | ALGO | 0.99995 | 6.016293 |
54feeabf-7ac9-41d4-a098-9535f1e00389 | nawngs/CompetitiveProgramming | hoc anh Vu/2-8/FamiliarDigit.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 = "";
const string NAME2 =... | ALGO | 0.999906 | 4.848737 |
9921499c-05e3-4177-8275-0227c3db3eea | amritessh/LeetCodeSolutions | 167-two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
int front=0,back=numbers.size()-1;
// / vector<int> index;
// for(int i = 1 ; i < numbers.size() ; i++){
while(front<back){
if(numbers[front]+numbers[back]<target) front++;
... | ALGO | 0.999835 | 5.982997 |
61b95e63-98a2-4a9b-a983-ace2c37bd671 | subhamagrawal7/College-Material-And-Assignments | SEM 6/OS_Assign/Ass4_2.cpp | #include<bits/stdc++.h>
using namespace std;
static int nb,np,b[20],p[20];
void best_fit()
{
int fragment[20],i,j,temp,lowest=9999;
int static barray[20],parray[20];
cout<<"\nBest Fit";
for(i=1;i<=np;i++)
{
for(j=1;j<=nb;j++)
{
if(barray[j]!=1)
{
temp=b[j]-p[i];
if(temp>=0)
if(lowest>temp)... | ALGO | 0.999787 | 3.07575 |
6bc25336-c9d2-4ee0-bb0c-f3df99f1188c | muskan300600/DSA | Array/6.search_int.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
cout << "enter length" << endl;
cin >> n;
int arr[n];
int min, max;
for (int i = 0; i < n; i++)
{
cout << "enter element" << endl;
cin >> arr[i];
}
int find,index=-1;
cout << "enter ... | ALGO | 0.987982 | 4.022037 |
dc4ba788-5088-4d17-b04e-c8a3e3f3843e | ul88/problem-solving | Silver IV/1764 듣보잡.cpp | #include<iostream>
#include<string>
#include<set>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
vector<string> v;
set<string> s;
int N,M;
cin>>N>>M;
v.reserve(M);
for(int i=0;i<N;i++){
string str;
cin>>str;
s.insert(str);
}
for(int i=0;i<... | ALGO | 0.999963 | 3.548985 |
3dec9d84-9a53-497f-979b-02df26b00f94 | dn54321/Programming-Challenges | 540A - Combination Lock.cpp | // https://codeforces.com/problemset/problem/540/A
// SOLUTION BY DN54321
#include <iostream>
#include <string.h>
#include <ctype.h>
#include <vector>
#include <functional>
#include <algorithm>
#include <map>
#include <utility>
#define p1 first
#define p2 second
#define pii pair<int,int>
#define vvi vector<vector<int... | ALGO | 0.99993 | 3.953252 |
6228d711-036d-4f65-a276-768248806957 | iamwind-dev/Excpp | output/abc.cpp | #include <bits/stdc++.h>
using namespace std;
// Khai b?o c?u tr?c node
struct node
{
int num;
int coeff;
node *next;
};
// H?m nh?p da th?c
node *nhapDaThuc()
{
node *head = NULL, *tail = NULL;
int n, num, coeff;
cout << "Nhap so luong phan tu cua da thuc: ";
cin >> n;
for (int i = 1;... | ALGO | 0.998836 | 3.795958 |
148bd8f6-6180-4c13-a0fd-1b6cff4f41a9 | AlisherOrozalyev/Peaksoft.Flutter | sabak_5_im_rich/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.997651 | 6.762122 |
e296c7e9-cea6-458f-91f7-7197cbac691f | therahulkumar9/data-structures-and-algorithms | strings/02_findLengthOfString.cpp | #include <iostream>
using namespace std;
int main() {
const char *s = "Welcome"; // Declare as const char* to avoid the warning
int i;
// First method - using a for loop
for(i = 0; s[i] != '\0'; i++) {
// Empty loop body, just incrementing `i` until the end of the string
}
printf("Len... | TOOL | 0.976852 | 4.657652 |
e5f3e877-965f-403d-bde2-cfe348eb0a31 | yyytir777/Codes | C++/Baekjoon/11286.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> v;//ture = + & false = -
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
for(int i = 0; i < n; i++){
int x;
... | ALGO | 0.999982 | 4.197594 |
046174da-0297-4028-8a85-d1394b833f8f | SeongukBaek/DevDevDev | Algorithm/BOJ/[그래프 이론, 최소 스패닝 트리_1922] 네트워크 연결/1922.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
int V, E, cost = 0;
int* visited;
vector <pair<int,int>> graph[100001];
void prim(int s) {
visited[s] = 1;
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
for (int i = 0; i < graph[... | ALGO | 0.999952 | 4.030974 |
673dce6e-0393-46bf-bc64-8c534d16d532 | Johannyjm/c-pro | AtCoder/abc/abc142/d.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
ll gcd(ll m, ll n){
ll tmp;
while(m%n){
tmp = n;
n = m % n;
m = tmp;
}
return n;
}
bool is_prime(ll n){
if(n ... | ALGO | 0.999874 | 4.783333 |
d40e2e00-334e-4023-8617-0a19b4fd2882 | SeonJun-Hwang/PS | Codeforces/1230B.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n, k; cin >> n >> k;
string str; cin >> str;
if (k) {
if (n > 1) {
int cnt = str[0] != '1';
str[0] = '1';
int pos = 1;
while (pos < n && cnt < k) {
cnt += str[pos] != '0';
if (str[pos] != '0')
str[pos] = '0';
... | ALGO | 0.99999 | 4.237369 |
4fab5572-53f7-455e-ad68-2728cb59b78d | dominic-myb/learning-cpp | pyramids/pyramid3.cpp | #include <iostream>
#include <string>
int main() {
int star = 1, rows = 4;
int space = rows - 1;
for (int x = 0; x < rows; x++) {
for (int y = 0; y < space; y++) {
std::cout << " ";
}
space--;
for (int z = 0; z < star; z++) {
std::cout << "*";
}
star += 2;
std::cout << std... | ALGO | 0.996074 | 4.919999 |
68f6e97b-3f45-4637-a02b-4d47e69a7371 | caleb-cramer/AVLtree | binarytree.cpp | /* @file binarytree.cpp
@name caleb cramer
@date 10 April 2019 */
#include "binarytree.h"
BinaryTree::BinaryTree(){
mroot=new Node();
}
BinaryTree::BinaryTree(const ItemType &rootItem){
mroot=new Node(rootItem,NULL,NULL);
}
BinaryTree::BinaryTree(const ItemType &rootItem,BinaryTree &leftTree, BinaryTree &ri... | ALGO | 0.985956 | 4.668251 |
152816fc-fdc1-4f09-9102-ace5ad951509 | Sakamochanq/atcoder-archive | src/APG04B/F.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int a, b;
cin >> a >> b;
cout << a + b << endl;
return 0;
} | ALGO | 0.985383 | 3.631552 |
8ae4ef8b-bc0a-42af-a2f2-1f1f844e8016 | divyanshusharma3031/leetcode | Maximum Number of Toys - GFG/maximum-number-of-toys.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
vector<int> maximumToys(int n,vector<int> arr,int Q,vector<vector<int>> Queries){
// code here
int q=Queries.size();
vector<... | ALGO | 0.999912 | 4.611097 |
0b532841-117b-4629-9c2a-ed79febb098a | kedixa/LeetCode | C++/132.cpp | class Solution {
bool pal(string &s, int a, int b)
{
while(a < b)
{
if(s[a++] != s[--b])
return false;
}
return true;
}
public:
// 动态规划
// dp[i]表示以s[i]结尾的字符串需要的最少切割数
// 则dp[i]为s[k~i]为回文时dp[k-1]+1的最小值
// 为了书写方便,可以在dp[]前面空余出一个位置表示空串
int minCut(st... | ALGO | 0.999976 | 5.819947 |
f4c939df-5776-4dbd-a67a-33497b1ae0b2 | annkit-singh/CodeNCode | Codechef/The_One_Who_Knocks_.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;cin>>t;
while(t--!=0){
int x,y;cin>>x>>y;
if(x>y){
int result=(x-y)%2==0?1:2;
cout<<result;
}
else if(y>x){
int result... | ALGO | 0.999959 | 4.436524 |
46bcab24-d0e3-4634-8df0-e00ffac77237 | coder-devansh/DSA | 3566-find-the-sequence-of-strings-appeared-on-the-screen/find-the-sequence-of-strings-appeared-on-the-screen.cpp | class Solution {
public:
void find(string target){
}
vector<string> stringSequence(string target) {
string ans="a";
vector<string>result;
while(ans!=target){
if(ans==target.substr(0,ans.size()))
{
result.push_back(ans);
ans+='a';
... | ALGO | 0.999944 | 4.968924 |
54ad7d57-c4ee-4ccb-9199-9945c182dd36 | AlexICMT/hacker_rank | src/abstract_classes_polymorphism.cpp | /*
* abstract_classes_polymorphism.cpp
* /hacker_rank/src/abstract_classes_polymorphism.cpp
*
* Created on: 17 янв. 2022 г.
* Author: alexicmt
*/
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <cassert>
using namespace std;
struct... | ALGO | 0.970429 | 5.061162 |
559e1929-11ff-4192-bd7d-9462be160b8c | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/july/ChefAndDragonDens_20200712141005.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#include<unordered_map>
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ... | ALGO | 0.999947 | 3.730697 |
fc081435-fbd3-4610-9f57-a14d5ef14cc0 | dhairya163/Data-Structures-Algo-Practice | Backtracking/Leetcode/N_Queens.cpp | // https://leetcode.com/problems/n-queens/
class Solution {
public:
vector<vector<string>> final;
bool dp[9][9];
bool issafe(int row,int col,int n){
int i=row-1;
int j=col;
while(i>=0){
if(dp[i][j]==false){
return false;
}
i--... | ALGO | 0.999807 | 6.080878 |
1ca0bef8-0ed3-412b-8575-c61dda067d2b | Gourav-Makkar/Data-Structures-and-Algorithms | Geek Jump - GFG/geek-jump.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int minimumEnergy(vector<int>& height, int n) {
vector<int>dp(n);
dp[0]=0;
dp[1]=abs(height[1]-height[0]);
for(int i=2;i<n;i++)
{
dp[i]=... | ALGO | 0.99982 | 6.435923 |
c157e558-fff9-481e-b490-45b7363fcb4e | ishandutta2007/codeforces | idxcalcal/normal/1240/B.cpp | #include<bits/stdc++.h>
#define ri register int
#define pb push_back
#define fi first
#define se second
using namespace std;
const int rlen=1<<18|1;
char buf[rlen],*ib=buf,*ob=buf;
#define gc() (((ib==ob)&&(ob=(ib=buf)+fread(buf,1,rlen,stdin)),ib==ob)?-1:*ib++)
typedef long long ll;
typedef pair<int,int> pii;
inline in... | ALGO | 0.999828 | 4.054418 |
c68ee6a6-6e8c-42d0-9093-2674af8214c6 | KavitaDhaneshBhalerao/C-_programming_basics | DefaultConstruct.cpp | #include<iostream>
using namespace std;
class Demo
{
public:
int A;
int B;
Demo()
{
A = 10;
B = 20;
}
Demo(int i)
{
A = i;
B = 20;
}
Demo(int i, int j)
{
A = i;
B ... | ALGO | 0.928033 | 4.225436 |
09142f0d-f35a-46fd-a1f6-cab914f1e73d | rajneeshkumar146/pepcoding-Batches | 2020/GTBIT/L001_foundation/l005_String/l001Basics.cpp | #include <iostream>
using namespace std;
void test1()
{
string str = "abcdsdfv";
str += 'g';
str.push_back('o');
string str1 = str;
str1 += 'p';
str = str + 'a';
char ch = str[3];
cout << str << " " << str1 << endl;
}
void test2()
{
string str = "";
for (int i = 0; i < (int)1... | ALGO | 0.999922 | 4.294605 |
7a7220f9-720e-4661-807c-d0ea5e02ae5f | jfngsea/VisitAveiroFlutter | 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 |
dd2505df-0bfc-49c5-802d-0d27a798823e | areian13/PS_BOJ | 2. Silver/Silver 1/[S1] 14889 스타트와 링크.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <climits>
#include <algorithm>
#define FastIO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
using namespace std;
int BT(int p, vector<int>& start, vector<int>& link, vector<vector<int>>& s)
{
int n = s.size();
int k = sta... | ALGO | 0.999995 | 4.534332 |
055981d0-c1a8-4ac0-9a83-971c12066b06 | lemonmungchi/programmerss | programmers/p_p89.cpp | #include <string>
#include <vector>
#include <map>
#include <sstream>
using namespace std;
//г ֽȭֱ
// صѰΰ..
//-> 迭 ϴ° ڴ=> state迭 answer id ؼ ߿ ֱ
vector<string> solution(vector<string> record) {
vector<string> answer, state;
map<string, string> m;
stringstream ss;
for (auto reco : record) {
... | ALGO | 0.997332 | 4.798186 |
2db54c2c-741b-45fc-8d03-01a1a4bbe2ba | Jie-wen-x/hello_arithmetic | zh-hant/codes/cpp/chapter_backtracking/subset_sum_ii.cpp | /**
* File: subset_sum_ii.cpp
* Created Time: 2023-06-21
* Author: krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 回溯演算法:子集和 II */
void backtrack(vector<int> &state, int target, vector<int> &choices, int start, vector<vector<int>> &res) {
// 子集和等於 target 時,記錄解
if (target == 0) {
res.push_ba... | ALGO | 0.999988 | 5.782804 |
4bdc531c-4dea-49a5-aca2-2f6a96d1b28d | KausBoss/CP-SubGrouped | GFG/Print Diagonally.cpp | /*
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define pb push_back
#define fi first
#define si second
#define pii pair<int,int>
#define vii vector<pair<int,int>>
#define F(a,n) for(int i=0;i<n;i++){cin>>a[i]... | ALGO | 0.999252 | 3.017344 |
3ed319e4-421b-4747-ad3c-f02ba081c264 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_11790_3.cpp | #include <bits/stdc++.h>
#pragma optimization_level 3
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
const long long N = 2e+5 + 7;
const long long MAXN = 1e+9;
const long long mod = 1e+9 + 7;
const long long INF = 0x7f7f7f7f7f7f7f7f;
const ... | ALGO | 0.999759 | 4.119114 |
2c0a7dd2-b281-4cb7-a9af-d34d9cf4b1cf | Vesion/Misirlou | hihocode/1101-ArithmeticPuzzles.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
string addStrings(string& num1, string& num2) {
string result;
for (int i = num1.size()-1, j = num2.size()-1, carry = 0; i >= 0 || j >= 0 || carry; carry /= 10) {
if (i >= 0) carry += nu... | ALGO | 0.999991 | 5.730219 |
f25022ca-e2b4-47a4-bc04-d2bdd8e88b2d | eshf/NPSI | source/headers/boost/libs/xpressive/tools/perl2xpr.cpp | #include <stack>
#include <string>
#include <iostream>
#include <boost/xpressive/xpressive_static.hpp>
#include <boost/xpressive/regex_actions.hpp>
namespace x = boost::xpressive;
using namespace x;
int main(int argc, char *argv[])
{
int i = 1, j = 1;
bool nocase = false;
char const *dot = " ~_n ";
ch... | TOOL | 0.95897 | 5.001954 |
5cd846c4-93e2-4102-8aae-6027b23a47d1 | yfabc123/TheRoadtoEncoding | 1_c/file/2.cpp | #include <stdio.h>
int main(){
int max=0;
printf("请输入三个数");
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a>=b){
max=a;
}
else {
max=b;
}
if(c>=max){
max=c;
}
printf("最大的数是%d",max);
return 0;
}
| ALGO | 0.999875 | 3.611084 |
0fa4090e-df76-4882-9b40-4940cd709256 | watemus/cp-prog | Losh/Losh6/C.cpp | //
// Created by watemus on 13.06.2020.
//
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ff first
#define ss second
using ll = long long;
using ld = long double;
template<typename T>
using vec... | ALGO | 0.9998 | 4.77317 |
b271ad52-d846-44a4-b654-b071a139f596 | Ddelval/Competitive-programming | CodeForces/1354-A.cpp | // 1354-A.cpp
// Created by David del Val on 03/06/2020
//
//
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define fi first
#define se second
//gcd(0, n) = n
inline long long _gcd(long long a, long long b... | ALGO | 0.999648 | 3.307867 |
bfea975a-1160-459d-a07f-3f805861fce8 | varun-s-amin/DLithe | DAY-3/P-22.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int month;
double rent;
int days;
int cost = 0;
cin >> month >> rent >> days;
... | ALGO | 0.996936 | 3.653522 |
54f237f9-f5d1-4bb5-b730-a9033c6da202 | mwy3055/Algorithm-codes | baekjoon/cpp/c++/8979.cpp | #include <iostream>
#include <algorithm>
using namespace std;
typedef pair<int, pair<int, int>> Medal;
typedef pair<Medal, int> Country; //,
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int n, k;
Medal temp;
cin >> n >> k;
Country* arr = new Country[n];
for (int i = 0; i < n; i++)
{
int t, a, b, ... | ALGO | 0.999955 | 3.884737 |
8dcb4b6e-a73f-4c93-acea-22825b91f483 | neel13062003/LeetCode | 1464-maximum-product-of-two-elements-in-an-array/1464-maximum-product-of-two-elements-in-an-array.cpp | class Solution {
public:
int maxProduct(vector<int>& nums) {
priority_queue<int>pq; //maxHeap
//priority_queue<int,vector<int>,greater<int>>pq; //meanHeap
for(int i=0;i<nums.size();i++){
pq.push(nums[i]);
}
int a = pq.top();
pq.pop();
int b = pq... | ALGO | 0.999935 | 5.026089 |
99e76b76-8450-4c12-a962-af66a67d3ccb | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_10357_43.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 1;
const int SIZE = 1e7 + 5;
const double eps = 1e-7;
const long long mod = 1e9 + 7;
const int mx = 1e5 + 1;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
template <typename XPAX>
void ckmax(XPAX &x, XPAX y) {
x = (x ... | ALGO | 0.998839 | 5.556258 |
64b396e4-ad91-491b-b026-89ffcd5e428a | Jeon-YuSung/Cplusplus-UE | CPP/Forouzan Cpp Bible/F_Chapter5/5-6_Program.cpp | // EOF 제어 While 반복문을 사용해 키보드로 입력한 숫자들의 합을 구하는 프로그램
#include <iostream>
using namespace std;
int main (void){
int sum = 0;
int n;
cout << "첫 번째 숫자를 입력하세요 (종료하려면 eof 입력) : ";
while(cin >> num){
sum = sum + n;
cout << "다음 숫자를 입력 : " << endl;
}
cout << " 합 = " << sum << endl;
return 0;
}
| ALGO | 0.927037 | 3.378857 |
94fb01c1-3989-4bd6-bc86-07000768ff1c | DdingJae418/coding | baekjoon/7576.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int m,n;
bool CheckBoundary(int row, int col)
{
return row >=0 && row < n && col >= 0 && col < m;
}
struct Node
{
int row, col, day;
Node(int row, int col, int day) : row(row), col(col), day(day) {}
};
int ... | ALGO | 0.999854 | 4.462467 |
5a4bbba2-04f1-4f13-966c-96949b7fd38e | Illation/ETEngine | Engine/source/EtRendering/GlobalRenderingSystems/PbrPrefilter.cpp | #include "stdafx.h"
#include "PbrPrefilter.h"
#include <EtCore/Content/ResourceManager.h>
#include <EtRendering/GraphicsTypes/TextureData.h>
#include <EtRendering/GraphicsTypes/EnvironmentMap.h>
#include <EtRendering/GraphicsTypes/Shader.h>
#include <EtRendering/GlobalRenderingSystems/GlobalRenderingSystems.h>
names... | TOOL | 0.860251 | 7.339208 |
cbff6d26-25fc-4329-a101-8859e47f7550 | CoraZhang/Computer-Graphics | a4/libigl/include/igl/is_symmetric.cpp | template <typename T>
IGL_INLINE bool igl::is_symmetric(const Eigen::SparseMatrix<T>& A)
{
if(A.rows() != A.cols())
{
return false;
}
assert(A.size() != 0);
Eigen::SparseMatrix<T> AT = A.transpose();
Eigen::SparseMatrix<T> AmAT = A-AT;
//// Eigen screws up something with LLT if you try to do
//Spars... | ALGO | 0.987585 | 6.466157 |
49f9c743-9a55-4296-876f-e83e592bd3cb | muazhussain/Blind-75-and-Beyond | Binary Tree/binary-tree-inorder-traversal/binary-tree-inorder-traversal-recursive.cpp | // Problem link: https://leetcode.com/problems/binary-tree-inorder-traversal/
// Time; O(n)
// Space: O(n)
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : ... | ALGO | 0.999997 | 6.99268 |
5195c193-5f60-4d50-ad2c-9ed4ade6dfb1 | AvinashMulamudusu/Operating-system | 23RD first fit algorithm .cpp | #include<stdio.h>
void firstFit(int blockSize[], int m, int processSize[], int n)
{
int i, j;
int allocation[n];
for(i = 0; i < n; i++)
{
allocation[i] = -1;
}
for (i = 0; i < n; i++)
{
for (j = 0; j < m; j++)
{
if (blockSize[j] >= processSize[i])
{
allocation[i] = j;
blockSize[j]... | ALGO | 0.999801 | 3.39768 |
8ce08cba-f402-498f-9b9f-4baace093ba7 | chamodsd/EOJ-soluitons | EOJ/2968. 付钱.cpp | #include <iostream>
using namespace std;
void cal(int temp) {
int i = 0;
int a[] = { 100,50,20,10,5,1 };
while (i <= 4) {
cout << temp / a[i] << " ";
temp %= a[i];
i++;
}
cout << temp << endl;
}
int EOJ_solution_2968(void) {
int question_num;
int temp;
cin >> question_num;
for (int i = 0;i < question_n... | ALGO | 0.999152 | 4.613626 |
8743d80c-df09-419e-986f-c814386af21c | Amna-Naeem06/Codes.cpp | leapyear.cpp | #include <iostream>
using namespace std;
void leapyear(int year)
{
if (year % 4 == 0)
{
cout << "It is a leap year." << endl;
}
else
{
cout << "It is not a leap year." << endl;
}
}
int main()
{
int year;
cout << "Enter year: ";
cin >> year;
leapyear(year);
... | ALGO | 0.954288 | 3.635692 |
e2597655-3579-48c3-bacc-c98736dc0aa4 | dexterex-02/Coding | Cpp/DSA/Queue/circular_queue.cpp | #include <bits/stdc++.h>
using namespace std;
class CircularQueue
{
int *arr;
int size;
int front;
int rear;
public:
CircularQueue(int n)
{
this->size = n;
arr = new int[n];
front = -1;
rear = -1;
}
bool enqueue(int value)
{
if ((front == 0 ... | ALGO | 0.999844 | 3.974681 |
cc329cbb-4334-4e8d-ad65-7286a0e6aec9 | Bhawna11agg/Uplift-Project | Projects/SnakeGame.cpp | /* Author: Madhura11-1"*/
#include <bits/stdc++.h>
using namespace std;
int height = 20;
int width = 20;
int finish = false;
int x = 10,y = 10,desx,desy;
int len;
int tailX[100],tailY[100];
void Initiate(){
x = x;
y = y;
desx = rand()%width;
desy = rand()%height;
}
void printOutput(){
for(i... | ALGO | 0.999772 | 3.234718 |
e970dd20-6629-4562-b37f-53912d6da4d2 | a00012025/Online_Judge_Code | CodeForce/556-A.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn=200000+10 ;
char s[maxn] ;
main()
{
int n,a=0,b=0 ; scanf("%d%s",&n,s+1) ;
for(int i=1;i<=n;i++) (s[i]=='0'?a:b)++ ;
printf("%d\n",a>=b?a-b:b-a) ;
}
| ALGO | 0.999711 | 3.517933 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.