uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
93d2bb32-9929-4572-9b55-d51cf2476a80 | Milap70/Cpp-Program | Matrix(public,private,protected).cpp | #include<iostream>
using namespace std;
class Calculator{
public:
int input1,input2;
void setInput(int a,int b){
input1=a;
input2=b; }
int add(Calculator,Calculator);
Calculator mul(Calculator,Calculator);
private:
int sub(){
return input1-input2;
}
};
int Calculator :: add(Calculator obj1,Calcul... | ALGO | 0.969104 | 4.312816 |
869403ab-24ff-48a6-a8e6-0bf50775a43c | abubakaristiak/Leetcode-Problems | Easy/_13_Roman to Integer.cpp | //https://leetcode.com/problems/roman-to-integer/description/?envType=study-plan-v2&envId=programming-skills
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int romanToInt(string s) {
int n=s.size();
unordered_map<char, int> sym={
{'I',1},{'V',5},{'X',10},{'L',50},... | ALGO | 0.999049 | 6.191715 |
51338434-9b38-4e5a-b8d3-ab65bb32b58c | Pouya-Ta/Basic-Programming-Homework-and-Projects | HW4_1B.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <time.h>
#include <math.h>
void equation(float a, float b, float c, float a2, float b2, float c2);
int main(void)
{
float a, b, c, a2, b2, c2;
a = rand() % 97;
a += 3;
b = rand() % 97;
b += 3;
c = rand() % 97;
c += 3;... | ALGO | 0.993939 | 3.188081 |
6f0660bd-d61c-4468-b519-33702cfd1df6 | Duonghbtt/CODEPTIT | file DSA/Duyet do thi/TN05009_CHU_TRINH_THEO_DFS.cpp | #include <bits/stdc++.h>
#pragma gcc optimize("Ofast")
#define endl '\n'
using namespace std;
using ll = long long;
int v, e, x, y, st, fi;
bool check[2003];
int parent[2003];
vector<int> adj[2003];
void init() {
memset(adj, 0, sizeof(adj));
memset(parent, 0, sizeof(parent));
memset(check, 0, sizeof(check));
cin... | ALGO | 0.99998 | 5.478465 |
3056fde0-27a7-4429-90db-74e6ec7c9640 | sohardforaname/ACM_ICPC_practice | codeforces/1304/1304D.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int mx[N], mi[N];
char s[N];
void solve()
{
int n;
scanf("%d%s", &n, s + 1);
for (int i = 1; i <= n; ++i)
mx[i] = i, mi[i] = n - i + 1;
for (int i = 1; i < n;)
{
char ch = s[i];
int k = i + 1;
while (k < n && s[k] == s[i])
++k;
if (c... | ALGO | 0.999947 | 3.74865 |
2f129e2b-1b25-45bd-9179-0c216dcef9d4 | joshuadeguzman/flutter_dialogs | example/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.998905 | 6.785645 |
8a96b830-c6d9-42f4-b26d-4ce45f554e78 | eremidio/ALGEBRA-FACILITIES | sturm_polynomial_algorithm.cpp | //VAMOS CRIAR UM PROGRAMA QUE TESTA AS ROTINAS CRIADAS NO ARQUIVO sturm_polynomial_algorithm.h
//COMPILAR ESTE PROGRAMA COM O COMANDO: g++ -o sturm_polynomial_algorithm sturm_polynomial_algorithm.cpp
//Cabeçalho
#include"sturm_polynomial_algorithm.h"
using namespace std;
//Função principal
int main(){
//Variáveis... | ALGO | 0.999228 | 4.792754 |
c4a9bdb0-722a-4e8b-8a1e-b1933eb38cda | subhash3008/cpp_love_babbar | data_structure/queue/deque_arr.cpp | #include <iostream>
using namespace std;
/////////////////////////////////
// Double ended queue implementation
/**
* @brief Although there is a stl implementation
* exist for deque in header queue, it is better
* to implement it to learn it
*/
class Deque
{
private:
int *m_arr;
int m_rear;
int m_front;
... | ALGO | 0.996699 | 5.337183 |
e3224191-0fed-4ac5-b881-d91fc966d00d | dk-17/LeetCode-Contest | Weekly_Contest/206/1583. Count Unhappy Friends.cpp | class Solution {
public:
vector<vector<int>> position;
unordered_set<int> ans;//set tc -->o(log n) while unordered_set tc is ----> o(1);
void CheckHappines(int x, int y, int u, int v){
if(position[x][u] < position[x][y] && position[u][x] < position[u][v]){
ans.insert(x);
... | ALGO | 0.999905 | 5.42814 |
bc45286c-c5bb-461c-a29f-a27542a82f69 | dejisacc/Tugas-Project-Alpro | bab 12/Latihan7.cpp | #include <iostream>
#include <cmath>
using namespace std;
void simpanganBaku (int A[], int n, double &simpangan){
double total = 0;
double rata = 0;
for (int i = 0; i < n; i++){
total += A[i];
}
rata = total / n;
double totalSelisihKuadrat = 0;
for (int i = 0; i < n; i++){
... | ALGO | 0.997595 | 4.242326 |
acafa5d0-b701-40c2-a45c-a17230211d48 | revng/ui-adaptagrams | cola/libdialect/tests/chainconfig01.cpp | #include <vector>
#include <deque>
#include <iostream>
#include "libvpsc/assertions.h"
#include "libvpsc/rectangle.h"
#include "libdialect/commontypes.h"
#include "libdialect/io.h"
#include "libdialect/util.h"
#include "libdialect/graphs.h"
#include "libdialect/ortho.h"
#include "libdialect/constraints.h"
#include "l... | TOOL | 0.873305 | 4.448182 |
817fe0e4-520e-4c13-ba46-1964c3f3e1f9 | HarshBamotra/My_personal_files | Semester-III/DS/SelectionSort.cpp | //Harsh Bamotra AC-1216
//Program to sort an array using selection sort
#include <iostream>
using namespace std;
void swap(int *x , int *y)
{
int temp=*x;
*x=*y;
*y=temp;
}
void SelectionSort(int arr[] , int n)
{
int temp , min;
for(int i=0 ; i<n-1 ; i++)
{
min=i;
for(int j=i+1 ; j<n ; j+... | ALGO | 0.999884 | 4.540018 |
b9ec5986-1094-4f0e-84d6-147a65b2ee01 | victorswan/LeetCode17 | src/0031.cpp | class Solution {
public:
void nextPermutation(vector<int>& nums) {
if (size(nums) <= 1) {
return;
}
for (int i = size(nums) - 1; i > 0; --i) {
if (nums[i - 1] < nums[i]) {
sort(begin(nums) + i, end(nums));
for (int j = i; j < size(nums); ++j) {
if (nums[j] > nums[i -... | ALGO | 0.999976 | 6.445946 |
4c15573f-1b85-47db-82b6-5ac33d2874f9 | min-ia/URI-Cpp | 1012.cpp | #include <iostream>
using namespace std;
double areaTriangle(double base, double height){
return base*height/2;
}
double areaCircle(double radius){
double pi = 3.14159;
return pi*radius*radius;
}
double areaTrapeze(double largerBase, double smallerBase, double height){
return (largerBase + smallerBase) * height... | ALGO | 0.996881 | 3.622669 |
3d82c1b1-9101-4441-a2d7-99b43f398527 | khan1203/basic-data-structure | Singly-Linked-List/Equal_linked_list.cpp | // by Khan Muhammad Rifat (CSE, BUBT)
#include <bits/stdc++.h>
#define ll long long
#define nl endl
#define PI 2 * acos(0.0)
using namespace std;
// Class -----------------------
class Node
{
public:
int value;
Node *next;
Node(int val) : value(val), next(NULL) {}
};
// Functions ------------------------
... | ALGO | 0.999899 | 3.572604 |
bda61768-fdc6-46f1-b366-fca824794846 | yogeshvishnole/love-babbar-dsa | love-babbar-dsa-2.0/functions/max-of-3.cpp | #include <iostream>
using namespace std;
int maxOf3(int a, int b, int c)
{
if (a > b)
{
if (a > c)
{
return a;
}
else
{
return c;
}
}
else if (b > c)
{
return b;
}
else
{
return c;
}
}
int main(... | ALGO | 0.99926 | 4.568805 |
875ac5dd-0a46-4360-8260-7940161958ff | LucasM127/CaveSystem | OutlineTest.cpp | #include <SFML/Graphics.hpp>
#include "OutlineGraph.hpp"
#include "NodeGenerator.hpp"
#include "Kruskal.hpp"
#include <iostream>
int main()
{
srand(time(nullptr));
Bounds2D bounds(0.f, 200.f, 0.f, 200.f);
NodeGenerator NG;
unsigned int numNodes = 15;
NG.generate(bounds, numNodes, 2.f, 10.f);
K... | ALGO | 0.897802 | 4.595733 |
63a5b26d-5075-43bb-8567-2324ad1902a3 | oFem1m/TP_ALG_CPP | dz2/2.1.cpp | #include <iostream>
#include <stack>
#include <functional>
using namespace std;
/*Дано число N < 10^6 и последовательность целых чисел из [-2^31..2^31] длиной N.
Требуется построить бинарное дерево, заданное наивным порядком вставки.
Т.е., при добавлении очередного числа K в дерево с корнем root, если root→Key ≤ K,
... | ALGO | 0.999977 | 5.130969 |
06e50572-fb56-45b2-a1db-4d2ab3e3ac65 | NyaanNyaan/library | verify/verify-yuki/yuki-2883.test.cpp | #define PROBLEM "https://yukicoder.me/problems/no/2883"
//
#include "../../template/template.hpp"
//
#include "../../modint/adjunction-modint.hpp"
//
#include "../../modint/montgomery-modint.hpp"
#include "../../modulo/binomial.hpp"
//
using namespace Nyaan;
using mint = LazyMontgomeryModInt<998244353>;
// using mint =... | ALGO | 0.999796 | 5.190118 |
4b1b9201-b64f-4a9e-be02-5a34008eaea0 | mertonmeng/leetcode | Binary Search/FindMinimuminRotatedSortedArray.cpp | #include "stdafx.h"
#include "BinaryTree.cpp"
#include <stack>
#include <vector>
class FindMinimuminRotatedSortedArray {
public:
static int findMin(vector<int> &num) {
if(num.empty())
return 0;
if(num.size() == 1)
return num[0];
int start = 0, end = num.size() - 1;
int mid = 0;
while(start + 1 <... | ALGO | 0.999989 | 5.621198 |
0ed3c5bd-d442-40aa-9a7a-b3a9e9b699b5 | hackybacky/my-leet | 2040-kth-smallest-product-of-two-sorted-arrays/2040-kth-smallest-product-of-two-sorted-arrays.cpp | class Solution {
public:
const long long high=pow(10ll , 10 );
long long kthSmallestProduct(vector<int>& nums1, vector<int>& nums2, long long k) {
auto fn = [&](double val) {
long long ans = 0;
for (auto& x : nums1) {
if (x < 0) ans += nums2.end() - lowe... | ALGO | 0.999917 | 5.356228 |
d94749b6-7c2a-455a-97c1-907e7004706b | manassinghdewari/dsa | 06Sorting/25ChoiceOfPivot.cpp | // if array is sorted then both Lomuto and Hoare partition
// both are going to be in worst case.
| ALGO | 0.999619 | 4.710182 |
8929abff-1459-4c38-8328-4ac7447d7b77 | Jaygaur99/DS-Algo-Practice | Tree/3_levelWiseInput.cpp | #include<bits/stdc++.h>
#include "TreeNode.h"
using namespace std;
void printTree(TreeNode<int> *root);
TreeNode<int>* takeInputLevelWise() {
int rootData;
cout << "Enter Root Data" << endl;
cin >> rootData;
TreeNode<int>* root = new TreeNode<int>(rootData);
queue<TreeNode<int>*> pendingNodes;
pendingNodes.push... | ALGO | 0.988894 | 4.821526 |
e816206f-5189-4c1d-a8b1-5c8cfb50d8c5 | h3136514/Algorithm | baekjoon/2042.cpp | #include<cstdio>
long long A,B,C;
int n,m,k,i;
long long input[1000001],tree[4000004];
long long init(int node,int s, int e){
if(s==e)
return tree[node]=input[s];
else
return tree[node]=init(node*2, s, (s+e)/2) + init(node*2+1, (s+e)/2+1, e);
}
void update(int p,int s, int e, long long target, long long v){... | ALGO | 0.999969 | 3.430147 |
c936acc8-4765-4a29-a4ec-f3553c405da2 | helomair/NCTU-PCCA-2019 | day3/A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
double t,h;
float ans;
cin>>n>>h;
for(int i=1;i<n;i++)
{
t = h*h*i/n;
t = sqrt(t);
ans = t;
cout<<fixed<<setprecision(10)<<ans;
if(i != n-1) cout<<" ";
}
return 0;
}
| ALGO | 0.999884 | 3.063653 |
cd726413-43a3-4341-bcd2-13afd61ec2a0 | gperdrizet/llm_detector | api/bitsandbytes-0.42.0/csrc/cpu_ops.cpp | #include <BinSearch.h>
#include <pthread.h>
#include <common.h>
using namespace BinSearch;
void dequantize_cpu(float *code, unsigned char *A, float *absmax, float *out, long long blocksize, long long n) {
for (long long block_idx = 0; block_idx < n; block_idx += blocksize) {
long long valid_items = n - bl... | ALGO | 0.999577 | 4.684214 |
895697bc-f4a0-4f88-8100-d9fb11147da3 | ishandutta2007/codeforces | xuanquang1999/normal/383/C.cpp | //84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i, r, l) for(int i = (r); i >= (l); --i)
#define fto... | ALGO | 0.99992 | 4.475024 |
40111ee4-68c7-429a-aed7-5668440ee28e | godely/Problems | Spoj/QTREE2.cpp | #include <bits/stdc++.h>
using namespace std;
#define fr(a,b,c) for(int a = b; a < c; a++)
#define rp(a,b) fr(a,0,b)
#define MAXM 21111
#define add(a,b,c) to[z] = b, cost[z] = c, ant[z] = adj[a], adj[a] = z++
int to[MAXM], cost[MAXM], ant[MAXM], adj[MAXM], z;
int N, P[MAXM][16], D[MAXM][16], L[MAXM];
void dfset(int no... | ALGO | 0.999749 | 4.229841 |
2059d2be-8cf8-4860-929b-bc02c628c870 | leezg/matrix3 | Newton.cpp | //
// Created by lee on 2021/11/28.
//
#include "Newton.h"
Newton::Newton() {
}
//获得F的值的向量
void Newton::getFValue(vector<double>& b, vector<double> offset, vector<double> x) {
b[1] = -(0.5 * cos(x[1]) + x[2] + x[3] + x[4] - offset[1]);
b[2] = -(x[1] + 0.5 * sin(x[2]) + x[3] + x[4] - offset[2]);
b[3] = -... | ALGO | 0.999895 | 3.271627 |
0d79b2e9-9fa1-415d-b0fd-76f5aee4156a | TechLead-War/Algos_C | palindrome_check.cpp | //
// C/C++ program to check whether the given string is a palindrome
//
// The All ▲lgorithms Project
//
// https://allalgorithms.com/strings
// https://github.com/allalgorithms/cpp
//
// Contributed by: Sankalp Godghate
// Github: @sankalp24
//
#include<bits/stdc++.h>
using namespace std;
// A function to check if a ... | ALGO | 0.983098 | 3.896188 |
659e4463-170b-4313-aa55-b155554b8ba8 | hzfsls/leetcode-supercrawl | data/2592.maximize-greatness-of-an-array/code_snippets/sol.cpp | class Solution {
public:
int maximizeGreatness(vector<int>& nums) {
}
}; | ALGO | 0.999678 | 5.504192 |
b49a5f00-bd4d-4871-8a84-b1cc15735e5d | henyau/SDC_MPC_Sim | src/Eigen-3.3/doc/special_examples/Tutorial_sparse_example.cpp | #include <Eigen/Sparse>
#include <vector>
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
typedef Eigen::Triplet<double> T;
void buildProblem(std::vector<T>& coefficients, Eigen::VectorXd& b, int n);
void saveAsBitmap(const Eigen::VectorXd& x, int n, const char* file... | ALGO | 0.993504 | 5.429372 |
bd7617a9-dc33-4823-9e3f-8537c5792aaf | by-Bajrang/DSA-in-Cpp | Arayy/stocks/Buytimeforstock.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int arr[]={7,1,5,3,6,4};
int mini=arr[0],profit=0;
for(int i=1;i<6;i++)
{
int cost=arr[i]-mini;
profit=max(profit,cost);
mini=min(mini,arr[i]);
}
cout<<mini<<endl<<profit;
return 0;
} | ALGO | 0.999731 | 3.521111 |
a95e49c5-5e4d-4455-b264-96c87464b62c | ishandutta2007/codeforces | hank55663/normal/1487/A.cpp | #include<bits/stdc++.h>
#define pb push_back
#define x first
#define y second
#define pdd pair<double,double>
#define pii pair<int,int>
#define pll pair<LL,LL>
#define mp make_pair
#define LL long long
#define ULL unsigned long long
#define sqr(x) ((x)*(x))
#define pi acosl(-1)
#define MEM(x) memset(x,0,sizeof(x))
#def... | ALGO | 0.998693 | 3.472026 |
2f769d02-2240-4a0e-bfb7-b8f0d6002141 | NAgrawal1798/Competitive-coding | 3367-find-the-sum-of-encrypted-integers/find-the-sum-of-encrypted-integers.cpp | class Solution {
public:
int sumOfEncryptedInt(vector<int>& nums) {
int ans = 0;
int n = nums.size();
for(int i=0; i<n; i++) {
string num = to_string(nums[i]);
int maxi = INT_MIN;
for(int j=0; j<num.size(); j++) {
maxi = max(num[j] - '0', m... | ALGO | 0.999956 | 6.624527 |
1ad99c11-faeb-4b81-870b-1836bc4c5feb | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/CodeLlama/top0-100/maximum-non-negative-product-in-a-matrix-Solution.maxProductPath/177848_nan.cpp | static NTSTATUS do_connect(TALLOC_CTX *ctx,
const char *server,
const char *share,
const struct user_auth_info *auth_info,
bool show_sessetup,
bool force_encrypt,
int max_protocol,
int port,
int name_type,
struct cli_state **pcli)
{
struct cli_state *c = NULL;
char *servic... | ALGO | 0.897187 | 4.011895 |
c3d1792c-25c7-4c7a-a7c4-65feafe709b1 | tkmr0904/Numerical-Computation | july_01/A課題/euler3.cpp | #include <stdio.h>
#include <math.h>
#include <thread>
double I(double x, double y)
{
return -y;
}
double Q(double x, double y)
{
return (1 - y);
}
double euler(double x0, double y0, double xf, long n, double(*df)(double, double))
{
double h = (xf - x0)/n;
double x = x0;
double y = y0;
for(... | ALGO | 0.999738 | 3.894378 |
9990c5b8-2a76-4bd8-9ddf-4dfc99f3f074 | Houssem-Jarray/c-ProgrammingLanguage | PointerIncrease/main.cpp | //
// Created by houssem on 30/04/24.
//
#include <bits/stdc++.h>
using namespace std;
void increase(void* data, int ptrSize){
if(ptrSize == sizeof(char)){
char* ptrChar;
// typecase data to ptrchar
ptrChar = (char*) data;
(*ptrChar)++;
cout << "*data pointes to an char" <... | ALGO | 0.904512 | 3.037387 |
ba96b475-93ed-4a43-9fd3-6d9556aa7f52 | almusfuad/problem_solving | Cpp/C_Replacement.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> v(n);
for(int i=0; i<n; ++i) {
cin>>v[i];
}
for(int a: v) {
if(a<0) {
a=2;
} else if(a>0){
a=1;
}
cout<<a<<" ";
}
return 0;
} | ALGO | 0.999902 | 3.818798 |
d16dd0f1-abdd-4595-9da4-0f9b38ebb3d0 | HarshSarsodiya1180/Leetcode2-Solutions | Reverse words in a given string - GFG/reverse-words-in-a-given-string.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to reverse words in a given string.
string reverseWords(string S)
{
string ans="", temp="";
int i=0;
while(i<S.length()){
if(S[i]=='.'){
... | ALGO | 0.999725 | 5.749882 |
02c21112-7ec7-43bd-b4a6-2d1139c6ec1e | alcohololismm/alcoholism | 2-bfs/[2187]forbid403.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
int n, m, ans;
int map_[101][101];
queue <pair<int, int>> q;
int dx[4] = {0, 0, -1, 1};
int dy[4] = {-1, 1, 0, 0};
int check[101][101];
void bfs(){
while(!q.empty()){
int top_x = q.front().first;
int t... | ALGO | 0.999689 | 4.053841 |
736be96c-7269-46e1-94ac-aba670abeaef | masoudbehzadinasab/Trilinos_12_11 | packages/rol/example/PDE-OPT/helmholtz/example_01.cpp | /*! \file example_01.cpp
\brief Shows how to solve the optimal control of Helmholtz problem.
*/
#include "Teuchos_Comm.hpp"
#include "Teuchos_Time.hpp"
#include "Teuchos_oblackholestream.hpp"
#include "Teuchos_GlobalMPISession.hpp"
#include "Teuchos_XMLParameterListHelpers.hpp"
#include "Tpetra_DefaultPlatform.h... | ALGO | 0.998448 | 5.839571 |
37efac83-bd52-4a78-992a-5cd05eb35c83 | ashutosh-kumar-dev/DSA-The-Odyssey | leetcode/remove consecutive character.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
string s;
cin>>s;
string s2;
for(int i=0;i<s.length();i++){
if(s[i]!=s[i+1]){
s2.push_back(s[i]);
}
}
cout<<s2;
}
| ALGO | 0.999913 | 3.37616 |
310258fd-5694-487e-93c1-5cc072b7cd65 | manann2811/Cpp-Basics1 | practicepattern2.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=0; i<n; i++)
{
int k=0;
while(k != (2*i))
{
cout<<" ";
k++;
}
for(int j = i; j<=n; j++)
{
cout<<"*";
}
cout<<endl;
}
return 0;
} | ALGO | 0.999938 | 3.147347 |
6cc897db-37be-41b8-b49e-b8622bb98709 | JorgeIba/Competitive-Programming-Problems | CodeForces/1165 - D.cpp | #include <bits/stdc++.h>
#define lli long long int
using namespace std;
lli primes[10000100];
map<lli,lli> arriba;
map<lli,lli> abajo;
void lowestPrimes()
{
for(int i=1; i<=10000000; i++)
{
if (i&1)
{
primes[i] = i;
}
else
{
primes[i] = 2;
... | ALGO | 0.999989 | 3.456261 |
f4bfedc9-ad01-4310-a198-d10b936829ad | DuyBa/ALGORITHM-AND-DATA-STRUCTURE | uocsochunglonnhat.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t; cin>> t;
while(t--)
{
int n, m;
for(int i=0;i<n;i++)
{
cin>> a[i];
b[i]=a[i];
if(a[i]%m==0) a[i]/=m;
}
int flag=0, dem=0, ans= INT_MAX;
if(a[0]!=b[0]) flag=1;
for(int i=1;i<n;i++)
{
if(a[i]!=b[i])
{
flag=1;
}
i... | ALGO | 0.999869 | 3.775991 |
7a25a7f8-a166-4dff-a022-cc1993599e40 | cicerocipriano/Programming-1 | extra_exercises/extras21-40/exercise33.cpp | #include <iostream>
using namespace std;
unsigned long long int calc_factorial (unsigned long long int n) {
unsigned long long int fac = 1;
for (int i = n; i > 1; i--) {
fac *= i;
}
return fac;
}
int main (int argc, char **argv) {
unsigned long long int n, fac;
cout << "Write a natural number: "... | ALGO | 0.999726 | 4.779533 |
d5f62772-d38d-43f3-b2dc-75c540705e53 | ImaduddinKhan/My-Flutter-Best-Practices | google_signin_firestore/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.998567 | 6.797273 |
43614e95-8196-46e7-8f10-fd2d849c44be | SSAFY-BLUE/BOJ | week9/승록/2342.cpp | // dp[n][lf][rf] = n 번쨰 지시에서 왼발이 lf, 오른발이 rf 에 있을 때 최소의 힘
// dp로 탐색이 가능하다.
#include <bits/stdc++.h>
using namespace std;
int N, dp[100001][5][5];
vector<int> v;
// from 에서 to로 발을 옮기는데 필요한 힘을 반환
int get_power(int from, int to) {
if (!from) return 2;
if (from == to) return 1;
if (abs(from - to) == 2) return ... | ALGO | 0.999944 | 4.219054 |
17673e1a-a23f-4e50-a0b3-85a206926f48 | iains/LLVM-7-branch | libcxx/test/std/containers/sequences/vector.bool/push_back.pass.cpp | // <vector>
// vector<bool>
// void push_back(const value_type& x);
#include <vector>
#include <cassert>
#include <cstddef>
#include "min_allocator.h"
int main()
{
{
bool a[] = {0, 1, 1, 0, 1, 0, 0};
const unsigned N = sizeof(a)/sizeof(a[0]);
std::vector<bool> c;
for (unsigned i ... | TEST | 0.92755 | 4.405472 |
c100039a-9065-48ef-8ccd-6d1cdbd25689 | 3dv-casia/VecIM | math/linear_program_solver_SCIP.cpp | #include "linear_program_solver.h"
#include "../3rd_scip/scip/scip.h"
#include "../3rd_scip/scip/scipdefplugins.h"
#include "../basic/logger.h"
#include <iostream>
bool LinearProgramSolver::_solve_SCIP(const LinearProgram* program) {
try {
if (!check_program(program))
return false;
Scip* scip = 0;
SCIP_CAL... | ALGO | 0.894755 | 6.151637 |
e287c1ef-e67e-4702-b526-42e7e5478978 | StartAt24/leetcode | basic_data_structure/list/ReversiveN.cpp | struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(nullptr) {}
};
class Solution {
public:
ListNode* getKthFromEnd(ListNode* head, int k) {
if (!head)
return nullptr;
ListNode* slow = head;
ListNode* fast = head;
while(k--){
... | ALGO | 0.999853 | 5.487236 |
faef05a8-31c6-4c72-b379-77a62f6887f8 | itsabhijeet/Leetcode-ChallengeSols | HappyNumber.cpp | class Solution {
public:
bool isHappy(int n) {
int h[1300]={0};
h[1]=1; h[7]=1; h[10]=1;
for(int i=11;i<1300;i++){
int sumofsquares=i; //initially
do{
int j=sumofsquares;
int newSs = 0;
... | ALGO | 0.999879 | 5.965182 |
72464c3f-155b-4d3c-a8aa-2f85a9921db8 | ishandutta2007/codeforces | rivalq/normal/1148/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<vl> vvl;
double EPS = 1e-9;
int... | ALGO | 0.999945 | 3.097954 |
55db6855-7377-450d-bac0-4ed8f9bd09dd | USC-NSL/SPA | examples/chromium/src/third_party/WebKit/Source/core/rendering/svg/SVGRootInlineBox.cpp | #include "config.h"
#include "core/rendering/svg/SVGRootInlineBox.h"
#if ENABLE(SVG)
#include "SVGNames.h"
#include "core/platform/graphics/GraphicsContext.h"
#include "core/rendering/svg/RenderSVGInlineText.h"
#include "core/rendering/svg/RenderSVGText.h"
#include "core/rendering/svg/SVGInlineFlowBox.h"
#include "cor... | TOOL | 0.856705 | 7.859818 |
c2944a7c-5b06-40ea-86ac-47d943340fa8 | how3v3r/study | navigation-noetic-devel/base_local_planner/src/twirling_cost_function.cpp | /*
* twirling_cost_function.cpp
*
* Created on: Apr 20, 2016
* Author: Morgan Quigley
*/
#include <base_local_planner/twirling_cost_function.h>
#include <math.h>
namespace base_local_planner {
double TwirlingCostFunction::scoreTrajectory(Trajectory &traj) {
return fabs(traj.thetav_); // add cost for m... | ALGO | 0.995096 | 5.978807 |
08516cb8-ce05-46a2-983c-054f41ec4da4 | kahowang/sensor-fusion-for-localization-and-mapping | 第一章 概述/lidar_localization/third_part/gtsam-4.0.2/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/OSGB.cpp | #include "stdafx.h"
#include "GeographicLib/OSGB.hpp"
#include "OSGB.h"
#include "NETGeographicLib.h"
using namespace NETGeographicLib;
//*****************************************************************************
void OSGB::Forward(double lat, double lon,
[System::Runtime::InteropServices::Out]... | TOOL | 0.897408 | 7.099869 |
9d9e638d-eb1e-4930-9515-31ada9cd6e80 | KentoNishi/AlphaStar-CC41B-Spring20 | exam-2/cowjog/main.cpp | /*
Cow Jog
=======
The cows are out exercising their hooves again! There are N cows
jogging on an infinitely-long single-lane track (1 <= N <= 100,000).
Each cow starts at a distinct position on the track, and some cows jog
at different speeds.
With only one lane in the track, cows cannot pass each other. When a
fa... | ALGO | 0.999924 | 5.187635 |
5c2b3f80-baea-40cf-965e-3f74d4d1af9a | ducyb2001/CbyTrungDuc | Code full house/buoi6-nguyen dinh trung duc-sofibo-pascal/ngto cung nhau/bai3 so loc phat.cpp | #include<stdio.h>
int pt(long n){
long r;
int ok=0;
while(n){
r=n%10;
n/=10;
if(r!=0 && r!= 6 && r!=8) return 0;
return 1;
}
}
void check(long n){
if(pt(n)==1) printf("Yes");
else printf("No");
}
int main(){
int t;
scanf("%d ", &t);
for(int i=1;i<=t;i++){
long n;
scanf("%ld", &n);
printf("Test... | ALGO | 0.949177 | 3.58334 |
5aba90bd-a538-4a6b-8350-9df198e43d57 | KDE/kolf | src/3rdparty/Box2D/Dynamics/Joints/b2DistanceJoint.cpp | #include <Box2D/Dynamics/Joints/b2DistanceJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// 1-D constrained system
// m (v2 - v1) = lambda
// v2 + (beta/h) * x1 + gamma * lambda = 0, gamma has units of inverse mass.
// x2 = x1 + h * v2
// 1-D mass-damper-spring system
// m (v2 - v1... | ALGO | 0.998907 | 6.886431 |
3b9148ba-67a4-488e-89bc-3030fff10823 | StarknetCongo/solo_wallet | 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 |
44fc2384-3e6e-4c88-a1fb-dce6cafb2b2e | TimWu1256/leetcode-ans | easy/83.remove-duplicates-from-sorted-list.cpp | #include "struct/singly-linked-list.h"
class Solution {
public:
ListNode *deleteDuplicates(ListNode *head) {
if (head == nullptr) {
return head;
}
ListNode *tmp = head;
ListNode *out = tmp;
ListNode *outHead = tmp;
tmp = tmp->next;
while (tmp !... | ALGO | 0.999785 | 5.748975 |
4970ebd7-73a9-4674-9979-2c075ca3a24c | ishandutta2007/codeforces | rubikun/normal/1680/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define ... | ALGO | 0.999864 | 4.522357 |
e7e663ba-bb09-48f7-a8cc-d63c9ed89869 | mun9769/CodingTest | SWEA/Unrated/2383. [모의 SW 역량테스트] 점심 식사시간/[모의 SW 역량테스트] 점심 식사시간.cpp | #ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
int n;
int board[14][14];
int dist[10][2];
vector<ii> pos;
vector<ii> door;
int costTime[2];
int moveSimulation(vector<int>& zero, vector<int>& one) {
... | ALGO | 0.999739 | 4.925193 |
9a9109cd-439f-4b9c-bf1f-b669336fb946 | rurain7763/codetree-TILs | 240922/별 n개 출력하기/print-n-stars.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
while(n--) {
cout << "*" << '\n';
}
return 0;
} | ALGO | 0.997092 | 3.225109 |
65692d9d-50d4-4a44-b8ca-b99cce7759f7 | kedonaghey/QuantLibAdjoint | ql/pricingengines/asian/analytic_cont_geom_av_price.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <ql/pricingengines/asian/analytic_cont_geom_av_price.hpp>
#include <ql/pricingengines/blackcalculator.hpp>
#include <ql/processes/blackscholesprocess.hpp>
#include <ql/exercise.hpp>
namespace QuantLib {
AnalyticContinuousGeo... | ALGO | 0.998366 | 7.702407 |
706bcaf6-af88-42aa-a1b7-b2428a649a05 | AreteQin/rgbd-direct-method-g2o | direct_method_with_mapping.cpp | #include <opencv2/opencv.hpp>
#include <sophus/se3.hpp>
#include <boost/format.hpp>
#include <pangolin/pangolin.h>
#include <fstream>
using namespace std;
using namespace Eigen;
typedef vector<Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d>> VecVector2d;
typedef vector<Sophus::SE3d, Eigen::aligned_allocato... | ALGO | 0.995931 | 4.713992 |
4f1aa925-6485-4b81-8b83-28c40427bf60 | seongmin-wxnr/intc_homeworkd_space | drink_awdwabk/drink_awdwabk/second.cpp | #include <iostream>
#include <Windows.h>
#include <vector>
struct vpVar {
std::vector<unsigned long> drink_;
unsigned long input_a, input_b;
unsigned long amount;
}; struct vpVar v;
unsigned long daily_stock = 100;
int main_screen() {
std::cout << "1. 커피 : 1,500원\n2. 주스 : 1,000원\n티 : 500원" << std::endl;
std... | TOOL | 0.901189 | 3.642947 |
2ab9a08b-3946-4e16-be36-1191beafaae7 | adityarathore063/striver-dsa | Recursion/reverse_array.cpp | #include<bits/stdc++.h>
using namespace std;
void func(int i, int n, int arr[]){
if(i>=n/2){
return;
}
swap(arr[i],arr[n-i-1]);
func(i+1,n,arr);
}
int main(){
int arr[] = {1, 2, 3, 4, 5};
func(0,5,arr);
for(int i = 0; i<5; i++){
cout<<arr[i]<<" ";
}
return 0;
} | ALGO | 0.999958 | 4.496208 |
c76b29b0-d501-455d-be68-a3211b1ad5d1 | Harleen365/100_Days_Coding_Challenge | DAY 32/candy.cpp | class Solution {
public:
int candy(vector<int>& ratings) {
int n=ratings.size();
vector<int>candies(n,1);
//edge case
if(n==1){
return 1;
}
//left to right
for(int i=1;i<n;i++){
if(ratings[i]>ratings[i-1] && candies[i]<=candies[i-1]){
... | ALGO | 0.999999 | 6.321246 |
aeed2d8f-5f96-4f7b-95ec-28f3b0b92325 | tariqul-dev/DSA | LeetCode/mixed/best_time_to_buy_and_sell_stock.cpp | #include <bits/stdc++.h>
using namespace std;
int maxProfit(vector<int> &prices)
{
int profit = 0;
int j = 0;
for (int i = 1; i < prices.size(); i++)
{
if (prices[j] < prices[i])
{
profit = max(profit, prices[i] - prices[j]);
}
else
{
j ... | ALGO | 0.999462 | 5.766303 |
6d0b8a51-2285-407c-86a6-334bbcd813f5 | AlienceGG/LeetCode-3 | problems/070.Climbing_Stairs/solution.cpp | #include <iostream> //包含头文件iostream
using namespace std; //使用命名空间std
class Solution {
public:
int climbStairs(int n) {
int f1 = 2;
int f2 = 1;
if(n == 1) {
return f2;
} else if(n == 2) {
return f1;
}
int fn;
for(int i... | ALGO | 0.998876 | 3.487827 |
572baaee-8fa4-4a54-9ff0-d51af2d479d8 | ishandutta2007/codeforces | aestas16/normal/1538/E.cpp | /*
I will never forget it.
*/
// 392699
#include <bits/stdc++.h>
#define int long long
using namespace std;
template <class T> void fr(T &a, bool f = 0, char ch = getchar()) {
for (a = 0; ch < '0' || ch > '9'; ch = getchar()) ch == '-' ? f = 1 : 0;
for (; ch >= '0' && ch <= '9'; ch = getchar()) a = a *... | ALGO | 0.994494 | 3.919485 |
d872a991-551f-42cf-888b-2245797431aa | sureyeaah/Competitive | codechef/COOK84/CHNGSUM.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define FOR0(i,n) for(int i=0, _##i=(n); i<_##i; ++i)
#define FOR(i,l,r) for(int i=(l), _##i=(r); i<_##i; ++i)
#define FORD(i,l,r) for(int i=(r), _##i=(l); --i>=_##i; )
#define repi(i,a)... | ALGO | 0.999995 | 3.389881 |
ec7819ee-0a57-4d0d-839f-527092bbfbab | anomalou/demo-scene | resultwork.cpp | #define _USE_MATH_DEFINES
#include <iostream>
#include <GL/glut.h>
#include <math.h>
#include "models.h"
#include "utility.h"
#define W_WIDTH 800
#define W_HEIGHT W_WIDTH
#define VP_WIDTH W_WIDTH
#define VP_HEIGHT W_HEIGHT
//видимый объем
#define PROJ_SPACE 10.0
//скорость поворота камеры
#define ROTATION_SPEED 1.0
... | TOOL | 0.90349 | 4.157339 |
af38f034-ce4b-46bf-bfe0-44d3cc1ac2eb | piyushraj1/30-Day-code | Day 4/f_to_c.cpp | #include<iostream>
using namespace std;
int main(){
float fahren, celsius;
cout<<"Enter the temp in fahren height:"<<endl;;
cin>>fahren;
celsius = 5*(fahren -32)/9;
cout<<fahren<<"Fahrenheight is equal to "<<celsius<<"centigrade"<<endl;
return 0;
} | TOOL | 0.946658 | 3.564749 |
2345fe22-2740-4e89-aae1-42c362311b6f | yzzupgo/MFTCG | Data/abc170_b/HasanMostafa/ac/14398261.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll big=2e6+5;
#define endl "\n";
ll a[106];
int main()
{ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll x,y,a,b;
cin>>x>>y;
for(a=0;a<=x;a++){
b=abs(x-a);
ll k=a*2+b*4;
if(k==y){cout<<"Yes\n";return 0;}
}
cout<<"No\n";
return 0;
}
| ALGO | 0.999984 | 3.263597 |
df0944d0-88a5-4c37-a552-715ede1d7861 | HanochZhu/vts-browser-unity-plugin | externals/browser/externals/eigen/eigen/bench/bench_reverse.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchUtil.h>
using namespace Eigen;
#ifndef REPEAT
#define REPEAT 100000
#endif
#ifndef TRIES
#define TRIES 20
#endif
typedef double Scalar;
template <typename MatrixType>
__attribute__ ((noinline)) void bench_reverse(const MatrixType& m)
{
int rows = m.r... | TEST | 0.906207 | 5.595998 |
6743edb8-9270-4a41-8d86-062a59643ae6 | 23520168/OnTap.Mang1Chieu | 082/082.cpp | #include <iostream>
#include <iomanip>
using namespace std;
void Nhap(int[], int&);
void Xuat(int[], int);
int Tim(int[], int);
int main()
{
int b[500];
int k;
Nhap(b, k);
cout << "Mang ban dau: ";
Xuat(b, k);
cout << endl << "Gia tri chan dau tien trong mang: " << Tim(b, k);
return 0;
}
void Nhap(int a[], in... | ALGO | 0.998926 | 4.34431 |
692351be-36e6-4b5c-9fdf-bbda4dac5083 | boseongkang/leetcode | Graph_Problems_for_practice/Q684_Redundant_Connection/Redundant_Connection.cpp | class Solution {
private:
vector<int> parent;
vector<int> rank;
int find(int node)
{
if(parent[node] != node) // if node is not parent node, make that node as a parent;
parent[node] = find(parent[node]);
return parent[node]; // if node is parent node, just return it.
}... | ALGO | 0.999858 | 5.799743 |
c0934149-d917-4458-a86a-5c277badbcfe | zoomkoding/Baekjoon | Codeforces/EducationalRound#73/ProblemC/solution.cpp | #include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
using namespace std;
int t, c, m, x;
int main(){
scanf("%d", &t);
while(t--){
scanf("%d %d %d", &c, &m, &x);
int l = 0, r = 100000000, ans = 0;
while(l <= r){
int mid = (l + r) / 2, v... | ALGO | 0.999924 | 3.523105 |
ff7d0135-9a49-4f87-8371-1f2fbbd0d825 | Glasspham/DSA-28Tech | 1D_Array/lesson_23.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n; cin >> n;
int a[n];
for(int i = 0; i < n; ++i) {
cin >> a[i];
if(i == 0) continue;
a[i] += a[i - 1];
}
for(int x : a) cout << x << ' ';
... | ALGO | 0.999764 | 3.428981 |
5e7b9011-fc34-453e-935b-7a485f719e37 | ishandutta2007/codeforces | xay5421/normal/1368/G.cpp | // author: xay5421
// created: Mon Jan 11 18:37:04 2021
#ifdef xay5421
#define D(...) fprintf(stderr,__VA_ARGS__)
#else
#define D(...) ((void)0)
//#define NDEBUG
#endif
#include<bits/stdc++.h>
#define X first
#define Y second
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
using namespace std;
typedef long long LL;
const ... | ALGO | 0.999189 | 3.195911 |
d823f0d9-95ba-49f2-875a-4d408cf87330 | lh9171338/SLAM-Book | ch11/pose_graph_ceres_quaternion/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <opencv2/opencv.hpp>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <ceres/ceres.h>
#include <ceres/rotation.h>
using namespace std;
using namespace cv;
/************************************************
* 本程序演示如何用ceres进行位姿图优化
* sphere.g2o... | ALGO | 0.979702 | 3.736035 |
ecc00585-5c00-4d25-895d-4f588cb10c57 | JamboPE/physics-modelling-matter | vampire/src/spintorque/spinaccumulation.cpp | // C++ standard library headers
#include <algorithm>
#include <fstream>
#include <iostream>
// Vampire headers
#include "spintorque.hpp"
#include "vmpi.hpp"
#include "material.hpp"
#include "create.hpp"
#include <complex>
// Spin Torque headers
#include "internal.hpp"
namespace st{
namespace internal{
//--... | ALGO | 0.999702 | 5.669738 |
60b87d83-3704-4fd8-9658-84e4b93ac63d | LukasZaw/Studies | Semestr-5/Programowanie-wspolbiezne-i-rozproszone/Lab06/zad1.cpp | #include <iostream>
#include <mpi.h>
#include <unistd.h>
#include <cstdlib>
#include <time.h>
#include <iomanip>
using namespace std;
int main (int argc, char *argv[])
{
MPI_Init(&argc, &argv);
int rank, size;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
int n;
... | ALGO | 0.998413 | 4.069438 |
f62b16ea-fb12-4efa-9fa9-931d0ccac5be | aman-akv0/Owl-coder | Bits_Manipulation/Binary Gap.cpp | class Solution {
public:
int binaryGap(int n) {
int ans = 0;
int first = -1;
int second = -1;
if ((n & (n - 1)) == 0) {
return 0;
} else {
for (int i = 0; i < 32; i++) {
if (n & (1 << i)) {
first = i;
... | ALGO | 0.99996 | 6.301106 |
1f49513f-d621-46ad-be46-6540266f37fc | TshSophie/SomeAlgorithm | 04Tree/06_Largest_BST_Sbutree/main.cpp | #include<iostream>
#include"BinaryTree.h"
using namespace std;
/*
ijظĸڵ㡣
涨
+ ijӵиĽڵ㣬
+ һָijڵΪнڵ㡣
*/
int main()
{
int pre[] = {27,81,5,47,92,23,21,45};
int mid[] = {5,47,81,92,27,21,23,45};
//
BinaryTree bt;
bt.Insert(bt.get(), pre, sizeof(pre) / sizeof(int), mid, sizeof(mid) / sizeof(int));
bt.... | ALGO | 0.999914 | 3.658904 |
202de4a7-437d-4d7c-8e34-cd45b0bcf749 | nataliacolm/concurrent_bst | Concurrent_BST_C++/ConcurrentBST.cpp | #include <iostream>
#include <atomic>
#include <vector>
#include <pthread.h>
#include <cstdint>
struct Node
{
Node* left;
Node* right;
int key;
};
// This portion is from VasuAgrawal on Github to ensure last two bits can be used for flagging and tagging
// and address is maintained: pack in a single wo... | ALGO | 0.999344 | 5.37327 |
484af90d-d0e8-4983-a828-7b1b3d91498a | ishandutta2007/codeforces | bhaskartm/normal/1534/C.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma optimize("-O3")
#define int long long int
#define f first
#define s second
#define pb push_back
#define endl '\n'
const int N=4e5+5;
const int MOD=1e9+7;
int arr[N];
int po[N];
int n;
int parent[N];
int sz[N];
int tot=0;
void make_set(int v) {
parent[v] = v;
... | ALGO | 0.999948 | 3.99288 |
71989ab6-ec25-4d7f-9f23-839f74ced4ab | ishandutta2007/codeforces | deemo/normal/628/E.cpp | #include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<utility>
#include<cstring>
#include<set>
using namespace std;
typedef long long ll;
const int MAXN = 3e3 + 20;
int n, m;
int c[MAXN][MAXN], fen[MAXN][MAXN], ri[MAXN][MAXN], up[MAXN][MAXN];
char ch[MAXN];
ll ans;
vecto... | ALGO | 0.999813 | 3.176223 |
3f0c1646-f8eb-443a-84ec-8376b43baa4a | shuiyiming/POJ | 3150 Cellular Automaton.cpp | #include<cstdio>
#include<cstring>
const int MAXN = 500 + 5;
typedef long long LL;
struct Matrix {
int n, m;
int A[MAXN][MAXN];
Matrix(int n, int m):n(n), m(m) { memset(A, 0, sizeof A); }
};
int MOD;
Matrix operator*(Matrix A, Matrix B) {
int n = A.n, m = A.m, p = B.m;
Matrix ans(n, p);
if(n == m && n == p) {
... | ALGO | 0.999974 | 3.180866 |
dd7f9e73-b7bb-490e-b6ef-c5e23abfce9c | geecrane/cp3 | graph/graphtraversal/bipartite/UVA-10004/fast.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
int N,L,U,V;
while(cin>>N&&N){
cin>>L;
for(int i=0;i<L;++i)cin>>U>>V;
if(N>L||(N==L&&N%2==0)) cout<<"BICOLORABLE.\n";
else cout<<"NOT BICOLORABLE.\n";}
return 0;
} | ALGO | 0.998137 | 3.953446 |
f66a959d-2f41-4389-84ea-8a08a70d2351 | trapier21/MouseMN | src/instantx.cpp | #include "uint256.h"
#include "sync.h"
#include "net.h"
#include "key.h"
#include "util.h"
#include "base58.h"
#include "main.h"
#include "protocol.h"
#include "instantx.h"
#include "activemasternode.h"
#include "masternodeman.h"
#include "darksend.h"
#include "spork.h"
#include "txdb.h"
#include <boost/lexical_cast.hp... | TOOL | 0.990698 | 5.0859 |
06c10733-3d78-4373-8e31-33431909313e | a2415824/compitative-coding | hi.cpp | #include<bits/stdc++.h>
//#define S ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//#define pb push_back
#define f(x,n) for(int i=x;i<n;i++)
using namespace std;
int main(){
int t;
cin>>t;
while (t--)
{
int n,k,l;
cin>>n>>k>>l;
int s[n];
int maxi=INT_MIN;
in... | ALGO | 0.999932 | 3.219971 |
7c99a38a-ccfe-4fdb-be6e-e154b61882d6 | jrrlucenafilho/Data-Structures-Workspace | bin_trees/expression_bin_tree/expression_bin_tree.cpp | #include <iostream>
#include <string>
#include <queue>
using std::cin;
using std::cout;
using std::string;
using std::queue;
class node
{
public:
node();
virtual ~node();
char get_content();
node* get_left_node();
node* get_right_node();
void set_content(int new_c... | ALGO | 0.9992 | 4.251688 |
64401ea7-fb31-4277-a43d-cb2e588cb529 | Holit/DataStructureHomework | stat/Exam.cpp | /*
考试日程安排与成绩统计
问题描述
* 现要安排考试的考表(即考试日程表),假设共有10 个班的学生,要安排10 门必修课程的考试,必修课程是
以班级来确定的,每个班各有3门必修课,因此各班的考试科目是不相同的;安排考表的原则是:相同课程采用统
一的试卷,因此同一门课程的考试必须在相同时间进行,同一个班所修的科目必须安排在不同的时间进行考试,以
避免考试时间的冲突。并要求全部考试的日程尽可能短。
* 要求对考试结果做统计和排序。假设分别以编号0,1,2,3,4,5,6,7,8,9 代表10 门要考试的课程,
以B1,B2,B3,B4,B5,B6,B7,B8,B9,B10 代表10 个班,每个人的信息包括学号、姓名、班级、各门考试... | TOOL | 0.944851 | 3.372306 |
e1b54608-0923-452f-bdfc-cf3003d1f409 | ThanhToan2111/1000-b-i-t-p-code-c-a-th-y-Khang | bai49.cpp | #include<bits/stdc++.h>
using namespace std;
int chusodautien(int n)
{
if(n<10) return n;
else return chusodautien(n/10);
}
int main()
{
int n;
cin>>n;
cout<<chusodautien(n);
return 0;
} | ALGO | 0.999526 | 3.699317 |
5190e360-21f4-4aa1-9bed-c0cfe1fa9138 | JiaheZhi/oceanbase-2023 | src/share/config/ob_config_manager.cpp | #define USING_LOG_PREFIX SHARE
#include "share/config/ob_config_manager.h"
#include "lib/file/file_directory_utils.h"
#include "lib/profile/ob_trace_id.h"
#include "lib/thread/thread_mgr.h"
#include "share/ob_cluster_version.h"
#include "lib/worker.h"
#include "observer/ob_sql_client_decorator.h"
#include "observer/o... | TOOL | 0.901557 | 3.744412 |
ac2f319f-d49d-4176-a685-9a3c28773df9 | Donglidishu/Cpp_Beginner_Tutorial | Part3_C++提高编程/260.算数生成算法fill.cpp | #include <iostream>
using namespace std;
#include <algorithm>
#include <vector>
class myPrint
{
public:
void operator()(int val)
{
cout << val << " ";
}
};
void test01()
{
vector<int> v;
v.resize(10);
// 填充
// 一般用于后期重新填充
fill(v.begin(), v.end(), 100);
for_each(v.begin()... | TOOL | 0.916874 | 3.636605 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.