uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
10588103-ab43-4901-b3c7-40b5f1038fc3 | roboeireann/RoboEireannCodeRelease | Util/CompiledNN/Src/CompiledNN/CompiledNN.cpp | /**
* Implements a class that compiles neural networks to optimized X86 machine
* code and applies them to input data.
*
* @author Felix Thielke
* @author Arne Hasselbring
*/
#include "CompiledNN.h"
#include "CompiledNN/CompiledNNImpl.h"
#include "Model.h"
#include <numeric>
#include <unordered_map>
namespace N... | TOOL | 0.998733 | 7.057845 |
ec9e49a2-01f3-4bfe-839f-8ed8b428082d | Prithvirajbilla/AlgorithmCoding | codeforces/478B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ll m,n;
cin>>n>>m;
ll k1 = n*n + (m-1)*(m-1);
k1 = k1 - (2*n -1)*(m-1) - n;
k1 = k1/2;
ll k2 = 0;
if(n%m == 0)
{
ll a = n/m;
k2 = a*a*m;
}
else
{
ll a = n/m;
k2 = (m - n%m)*a*a + (n%m)*((n - a*(m- n%m))/(n%m))*((n - a... | ALGO | 0.999942 | 3.631304 |
6f7733e7-624e-43d6-b47f-3899ab8b040a | ravinthiranpartheepan1407/ML-C | tanh.cpp | #include<iostream>
#include<cmath>
#include<vector>
using namespace std;
vector<double> tanh(vector<double> x){
vector<double> tanH;
double expoVal;
for(size_t elements = 0; elements < x.size(); elements++){
double expoElements = 1 + exp(2*(-x[elements]));
double expoDiv = (2 / expoElement... | ALGO | 0.999612 | 5.232322 |
1c622a2c-f889-4630-a3bc-4fb9a38803d1 | renanlim/EDA | Ordenaçao parte 2/fibonacci.cpp | int fibonacci(int n)
{
int cont;
long int x = 0, z = 1;
if(n % 2 == 0)
{
for(cont = 2; cont != n; cont = cont + 2)
{
x = x + z;
z = x + z;
}
return z;
}
else
{
for(cont = 1; cont != n; cont = cont + 2)
{
... | ALGO | 0.999852 | 4.018224 |
51aa69a2-18f8-46ee-97d3-f98eab2b52c9 | yandex/yatool | library/cpp/config/config.cpp | #include "config.h"
#include "markup.h"
#include "ini.h"
#include <library/cpp/archive/yarchive.h>
#include <library/cpp/json/json_reader.h>
#include <library/cpp/json/json_writer.h>
#include <library/cpp/lua/eval.h>
#include <util/string/cast.h>
#include <util/string/strip.h>
#include <util/string/type.h>
#includ... | TOOL | 0.931844 | 6.096883 |
2600cd12-fd6b-429a-9428-ba43267e9341 | lizzy723/scsa | DAY3/6_shape예제2.cpp | // 6_shape1 - 152 page
#include <iostream>
#include <vector>
class Shape
{
};
class Rect : public Shape
{
public:
void draw() { std::cout << "draw rect" << std::endl; }
};
class Circle : public Shape
{
public:
void draw() { std::cout << "draw circle" << std::endl; }
};
int main()
{
std::vector<Shape*> v;
while... | TOOL | 0.94261 | 3.9703 |
0e83643c-1447-4cac-b285-53e812d49931 | nice-nickname/python-2024 | temp/uploads/basic.cpp | #include <iostream>
using namespace std;
int main()
{
int a, b;
a = 5;
b = 4;
if (a > 4) {
cout << a - b;
} else {
cout << a + b;
}
return 0;
} | ALGO | 0.998988 | 3.329892 |
db093cba-3134-45e2-91ff-343438833809 | whlqz9300/leetcode | LeetCode031_Sort Colors.cpp | class Solution {
public:
void sortColors(int A[], int n) {
int ct[3] = {0, 0, 0};
int colors;
for (int i = 0; i < n; ++i){
colors = A[i];
++ct[colors];
}
for (int i = 0, k = 0; i < 3; ++i){
while (ct[i]--){
A[k++] = i;
}
}... | ALGO | 0.999866 | 5.868571 |
b9c5b041-9e6f-47d0-a137-2979d75f1ed5 | Bubbleteapotfacered/USTC_CSkaoyan | USTC/2021/d_to_7.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
int num;
cin >> num;
vector<int> res;
while(num > 0){
res.push_back(num % 7);
num /= 7;
}
for(int i = res.size() - 1; i >= 0; i--){
cout << res[i];
}
return 0;
} | ALGO | 0.999587 | 3.800975 |
e7fc4fa8-fcc3-4104-9388-30136f19c0f0 | dingningpei/LLM_Semantics | serene-python-client-stp/stp/minizinc/chuffed-rel2onto_20170728/boost_1_87_0/libs/math/example/to_continued_fraction.cpp | using boost::math::constants::root_two;
using boost::math::constants::phi;
using boost::math::constants::pi;
using boost::math::constants::e;
using boost::math::constants::zeta_three;
using boost::math::tools::simple_continued_fraction;
int main()
{
using Real = boost::multiprecision::cpp_bin_float_100;
auto p... | ALGO | 0.997179 | 5.003211 |
16d3c0e9-db36-4cf1-aee9-746fc46e6f01 | breaker250611/GFG-LEET-codes | 212-word-search-ii/212-word-search-ii.cpp | struct Node {
vector<Node *> next;
bool is_end;
Node() {
next = vector<Node *>(26, nullptr);
is_end = false;
}
bool contains(char w) {
return next[w - 'a'] != nullptr;
}
Node* get(char w) {
return next[w - 'a'];
}
void put(char w, Node* node) {
... | ALGO | 0.999963 | 6.541128 |
ee447540-275a-4420-9b48-7ad977b2870a | thegamer1907/Code_Analysis | CodesNew/3933.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,q; cin >> n >>q;
vector<int> st(n);
long long int totstr=0;
for(int i=0; i<n; i++)
{
cin >> st[i] ;
totstr+= st[i];
}
vector<long long int> arr(q);
for(int i=0;i<q; i++)
cin >> arr[i];
vector<long long int> cum(n);
cum[0] = st[n-1];
for( int i=n-2; i>=0... | ALGO | 0.999949 | 3.368359 |
977c9734-1713-4669-a035-e96ad790be87 | Karelito00/problems | Usaco/lake.cpp | #include <bits/stdc++.h>
using namespace std;
char mat[100][100];
int posy[]={1,0,-1,0};
int posx[]={0,1,0,-1};
int main()
{
freopen("lake.in","r",stdin);
freopen("lake.out","w",stdout);
int y,x,k;
cin>>y>>x>>k;
for(int n=0;n<k;n++){
int y1,x1;
cin>>y1>>x1;
mat[y1-1][x1-1]='... | ALGO | 0.999788 | 3.617742 |
9647657e-5cdc-45e4-9138-02216cc3d91b | Simon-Fuhaoyuan/LeetCode-100DAY-Challenge | maxRectangle/main.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
class Solution {
public:
int maximalRectangle(vector<vector<char>>& matrix) {
if (matrix.empty() || matrix[0].empty())
return 0;
// resize the binary matrix into format of histogram
int rows = matrix.size();
int cols = matrix[0].si... | ALGO | 0.999831 | 6.332838 |
3605f7db-e070-49c2-9689-b2902430b426 | leefurong/work | oj/jiecheng_ditui.cpp | #include<iostream>
using namespace std;
int a[11];
int main(){
int n;
cin >> n;
a[1]=1; // 设置起点
for(int i=2; i<=n; i++){
a[i] = i*a[i-1]; // 每一步如何从上一步推出来
}
cout << a[n];
} | ALGO | 0.999981 | 3.922665 |
0a418c5a-bdb7-4f1c-b835-fc41f2e10387 | rahulchy960/DSA-Solved-Problems | Trees/18_Binary_Tree_To_DLL.cpp | /* Structure for tree and linked list
struct Node
{
int data;
struct Node* left;
struct Node* right;
Node(int x){
data = x;
left = right = NULL;
}
};
*/
// This function should return head to the DLL
class Solution {
public:
Node* head = NULL;
Node *prev = NULL;
voi... | ALGO | 0.999997 | 6.552345 |
42cbe2b4-49c0-4754-a621-919400d614f6 | js062504/My-Codes | fibonaci.cpp | #include<iostream>
#include<math.h>
#include<bits/stdc++.h>
using namespace std;
void fib(int n){
int a1=0;
int a2=1;
int nextterm;
for(int i=1; i<=n; i++){
cout<<a1<<" ";
nextterm=a1+a2;
a1=a2;
a2=nextterm;
}return;
}
int main(){
int n;
cin>>n;
fib(n);
return 0;
}
| ALGO | 0.999867 | 4.099356 |
f1f6d06e-0985-4ce0-9bb1-138d801eaafc | cakuang1/codeforces | codeforces/combinatorics /1900/newyear.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD2 = 998244353;
const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 1000001; // check the limits, dummy
// (Other functions provided for modular arithmetic and combinatorics are not used in this part.)
// We'll use DFS to co... | ALGO | 0.999966 | 5.575953 |
7808b3d0-1bce-4854-9f83-29ee2fc9d24a | Sazid99246/problem-solving | Codechef/GDTURN.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t, x, y;
cin >> t;
for (int i = 0; i < t; i++)
{
cin >> x >> y;
if (x + y > 6)
{
cout << "YES";
}
else
{
cout << "NO";
}
cout << endl;
}
}
| ALGO | 0.999804 | 4.548014 |
5d17a8f2-500a-4326-861f-6a8042b1190c | XiaohonYe/OOP_hw | hw_01_Sudoku/cpp/src/main.cpp | #include "Sudoku.h"
#include <iostream>
int main() {
std::string sudoku_string = "017903600000080000900000507072010430000402070064370250701000065000030000005601720";
Sudoku sudoku(sudoku_string);
std::cout << "Initial validity: " << std::boolalpha << sudoku.check() << std::endl;
sudoku.printGrid();
... | ALGO | 0.966216 | 6.647694 |
d13172e4-1a6a-4c27-a47a-2d0b9a86de26 | CodeHarshh/DSA-Leetcode | 0355-design-twitter/0355-design-twitter.cpp | class Twitter {
public:
struct tweet {
int tweetid;
int time;
tweet(int id, int t) {
tweetid = id;
time = t;
}
};
int time;
// map userid to twwets
unordered_map<int, vector<tweet>> tweetsMap;
// map user id to follower
unordered_map... | ALGO | 0.999815 | 5.98522 |
681d1f24-11fc-439c-be4a-dde0519e7d94 | raincross7/code-similarity | codes/train_code/problem498/problem498_399.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
typedef long long ll;
int main() {
int n;
cin >> n;
ll sum_a = 0;
ll sum_b = 0;
vector<int> a(n);
vector<int> b(n);
vector<int> mx;
rep(i, n){
cin >> a[i];
sum_a += a[i];
}
... | ALGO | 0.999987 | 3.512871 |
64629735-1239-44bc-ac46-dbc59577596f | raincross7/code-similarity | codes/train_code/problem137/problem137_278.cpp | #include<cstdio>
#include<cstring>
int main() {
char ch1[1001];
int A[1001] = {};
for( int i = 0; i <1001; i++) {
scanf("%s", ch1);
if( ch1[0] == '0') break;
for( int j = 0; 1; j++) {
if( ch1[j] == '\0') break;
A[i] += ch1[j] - '0';
}
}
for( int i = 0; 1; i++) {
if( A[i] ... | ALGO | 0.999319 | 3.032633 |
295d1d1e-3fca-4352-abec-e9b6a3d6ecb6 | lmshin/algo-study | baekjoon/우선순위큐(heap)/12286_절대값 힙.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std;
int main() {
int n;
cin >> n;
priority_queue < pair<long long, int>, vector<pair<long long, int>>, greater<pair<long long, int>>> pq;
long long input;
for (int i = 1; i <= n; i++) {
cin >> input;
if (... | ALGO | 0.999997 | 3.736423 |
04965a66-aa8d-4662-a351-3717817bd81a | franfill1/training.olinfo.it-solutions | src/autogrill.cpp | #include<set>
using namespace std;
set < long long > A;
void inizia() {
return;
}
void apri(long long p) {
A.insert(p);
}
void chiudi(long long p) {
A.erase(p);
}
long long chiedi(long long p) {
if (!A.size())
return -1;
auto it = A.lower_bound(p);
long long ans = 1ll<<62;
if (it != A.end())
ans = *i... | ALGO | 0.99976 | 3.908054 |
6771f1ad-468c-4eed-b2b1-dd7185fa3ca2 | evga7/Algorithm-practice | Programmers/2018_KAKAO_5.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(int cacheSize, vector<string> cities) {
int answer = 0;
vector<string>s;
int size = cities.size();
int i;
for (i = 0; i < size; i++)
{
transform(cities[i].begin(), cities[i].end(), cities[i].begin(), ::tolower);
auto i... | ALGO | 0.999768 | 5.196204 |
c119a087-1e83-4465-ba8a-3e28ea671186 | AHMADALWI09/crud-api-login | 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 |
b741ebac-60de-434d-90a7-61167aa27062 | Faizullah9181/LeetCode-Practice | 413-arithmetic-slices/413-arithmetic-slices.cpp | class Solution {
public:
int numberOfArithmeticSlices(vector<int>& nums) {
int res=0,temp=0;
int n = nums.size();
if(n<=2) return 0;
int diff=nums[1]-nums[0];
for(int i=2;i<n;i++){
temp=0;
while(i<n && nums[i]==num... | ALGO | 0.99987 | 6.223198 |
a0dde568-3f86-4544-8df8-85ff1113beca | abdullxhsalim/cp-archive | contests/Codeforces/1927/1927C.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n, m, k, num;
cin >> n >> m >> k;
int aRem = k/2, bRem = k/2;
unordered_multiset<int> a, b;
for(int i = 0; i < n; ++i)
{
cin >> num;
a.insert(num);
}
for(int i = 0; i < m; ++i)
{
cin >> num;
b.insert(num);
}
vector<int> remaining;
fo... | ALGO | 0.999995 | 3.725727 |
9e265362-1117-4410-bc62-9a09af07c74e | ShawnZL/Cplus | chp7/7.12/atrctfun.cpp | #include <iostream>
#include <cmath>
struct polar {
double distance;
double angle;
};
struct rect {
double x;
double y;
};
polar rect_to_polar(rect xypos);
void show_polar(polar dapos);
int main() {
using namespace std;
rect rplace;
polar pplace;
cout << "Enter the x and y value:\n";
... | TOOL | 0.989966 | 3.761878 |
774d2c3e-fbbc-49d2-8299-0b5b782d5c67 | ishandutta2007/codeforces | unstoppablechillmachine/normal/769/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
int const INF = 1e9 + 10;
ll const BINF = 1e18 + 10;
int const MAXN = 1e6 + 10;
ld const EPS = 1e-6;
#define f first
#define sec second
#define pb push_back
#define pii pair<int, int>
#define ... | ALGO | 0.999991 | 3.964157 |
31cef825-efd5-4ee9-afeb-5e15d7c7712c | rachit-geek/code-daily | 450dsa/linked_list/prog2.cpp | class Solution
{
public:
//Function to check if the linked list has a loop.
bool detectLoop(Node* head)
{
// your code here/
unordered_set<Node*> s;
bool val=false;
while(head!=NULL)
{
if(s.find(head)!=s.end())
{
return true... | ALGO | 0.999912 | 5.135235 |
a2032cc3-e17a-4770-a000-992bf573f33c | yashgupta110/chat_app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
3295ccae-f17f-4f6f-bd7d-ad7eb91ffc61 | komalkvy/LEET_CODE | 31-next-permutation/next-permutation.cpp | class Solution {
public:
void nextPermutation(vector<int>& nums) {
int n = nums.size();
int index = -1;
for(int i = n-2 ; i >= 0;i--){
if(nums[i]<nums[i+1]){
index = i ;
break;
}
}
if(index==-1){
reverse(nums... | ALGO | 0.999996 | 5.684493 |
18959480-5e37-476c-aa8b-4538f34de1d3 | shubham-deshmukh/CP-Contests | CSES Problem Set/DP/Coin Combinations I.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) x.begin(), x.end()
#define endl "\n"
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
const int mod = 1e9+7;
void solve() {
int n,x;
cin >> n >> x;
vector<int> coins(n);
for(auto &... | ALGO | 0.99998 | 4.577418 |
946e7bd3-e05e-4ebb-b7fa-1d06a42b5179 | jiaqiangwjq/Algorithm-learning | leetcode/easy/21.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLis... | ALGO | 0.999925 | 5.77328 |
1f30f3e0-e77e-435d-8e2f-ca8534118674 | kjwwwwww/Design-and-Analysis-of-Algorithms | 矩阵类matrix.cpp | //#include<iostream>
//#include<string>
//#pragma warning(disable:4996)
//using namespace std;
//class Matrix
//{
// int rows,columns;
// int** arr;
//public:
// Matrix(){}
// Matrix(int a,int b):rows(a),columns(b)
// {
// arr = new int*[rows];
// for (int i = 0; i < rows; i++)
// {
... | ALGO | 0.995571 | 3.467965 |
2b762dc7-8eb5-4f81-8099-feeb3e0aa817 | krgss/Online_Review_Rating_Analysis | LDAs/boost/libs/compute/example/monte_carlo.cpp | #include <iostream>
#include <boost/compute/function.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/count_if.hpp>
#include <boost/compute/container/vector.hpp>
#include <boost/compute/iterator/buffer_iterator.hpp>
#include <boost/compute/random/default_random_engine.hpp>
#include <boost/com... | ALGO | 0.996919 | 6.947901 |
badadefa-017c-4c20-b0cc-03e2a0ff9cbf | saquibjawedbit/cp | E_Little_Girl_and_Maximum_XOR.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b; cin >> a >> b;
long long ans = 0;
bool start = false;
for(long long i = 63; i >= 0; i--) {
long long a_bit = a & (1LL << i);
long long b_bit = b & (1LL << i);
//cout << i << " " << a_bit << " " << b_bit... | ALGO | 0.999983 | 3.825907 |
ee9b1236-5851-458f-8fd2-0f784d897409 | FalendraDewangan/leetcode | 106. Construct Binary Tree from Inorder and Postorder Traversal.cpp | // Leetcod problem link
// https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/
// Solution 1
// Time complexity : O(n^2)
// Space complexity : O(n)
class Solution {
int findIndex(vector<int>& inorder, int val)
{
for(int i=0; i<inorder.size(); i++)
... | ALGO | 0.999993 | 6.390228 |
f9403969-a806-4b6b-a328-2fec50c1da98 | hyunS00/algorithm | 백준/Cpp/2721.cpp | #include <iostream>
#include <vector>
#define endl "\n"
using namespace std;
typedef long long ll;
int triangular_number(int n) {
return n * (n + 1) / 2;
}
ll weighted_sum(int n) {
ll sum = 0;
for (int k = 1; k <= n; ++k) {
sum += k * triangular_number(k + 1);
}
return sum;
}
int main() {... | ALGO | 0.999756 | 5.490561 |
c66954cd-7aff-4f5b-af26-b1373e2ae896 | 0owangjingo0/WZU-OJ | shujujiegou (2023-2024)/Test 2/3014 shuchu.cpp | #include <stdio.h>
#include <stdlib.h>
typedef int ElementType;
typedef struct Node{
ElementType data;
struct Node *next;
}Node, *LinkList;
void printList(LinkList L);
int main()
{
/*此处代码由测试程序自动添加,主要为了向顺序表中插入数据
并输出数据,你无需关心此处代码的具体实现细节。
如果有必要,请自己添加代码以测试你的函数是否正确。
*/
return 0;
}
/*你的提交的代码将被添加在此处,请完成题目所... | ALGO | 0.998623 | 3.530581 |
50d4276c-aded-43c3-8ead-0cb8c547eb84 | ompal570/c_programing_questions | pattern.cpp | #include<stdio.h>
int main(){
int n=4;
for(int i=1; i<=n; i++){
for(int j=1; j<=i; j++){
printf("*");
}
printf("\n");
}
}
| ALGO | 0.999901 | 3.695957 |
e70927fd-c32e-4e1c-8cd8-effd9bafc605 | mirinta/leet_code | dynamic_programming/double_sequences/LCS/0583_delete_operations_for_two_strings.cpp | #include <string>
#include <vector>
/**
* Given two strings word1 and word2, return the minimum number of steps required to make word1 and
* word2 the same.
*
* In one step, you can delete exactly one character in either string.
*
* ! 1 <= word1.length, word2.length <= 500
* ! word1 and word2 consist of only lo... | ALGO | 0.999981 | 6.773197 |
54facfb7-ef04-4db8-bb16-0c0c98063d60 | eveningglow/multi-object-tracker | dlib-19.3/dlib/md5/md5_kernel_1.cpp | #include <sstream>
#include <cstring>
namespace dlib
{
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------... | ALGO | 0.973705 | 6.390938 |
46a43e4a-2b6e-4142-bdc9-bf2ea8cf499b | potataahhh/Striver-A-Z-Sheet | Step 1.4 : Know Basic Maths/gcd.cpp | int calcGCD(int n, int m){
// Write your code here.
while(n>0 && m>0){
if(n>m)
n=n%m;
else
m=m%n;
}
if(n==0) return m;
else return n;
}
| ALGO | 0.999882 | 4.748602 |
61a8b735-a79d-437a-bc22-be17b6d4abed | abdabhasan/cppSolutions | cppSolutionsC5/p11-20/p16.cpp | #include <iostream>
using namespace std;
// write a program print all words from AAA to ZZZ
void printFromAAAtoZZZ(){
for(int i = 65; i <= 90 ; i++){
for(int j = 65; j <= 90; j++){
for(int k = 65; k <= 90; k++){
cout << char(i) << char(j) << char(k) << endl;
}
... | ALGO | 0.872757 | 3.459581 |
c1b758de-2a97-4cd5-870e-adeb4c5c5b07 | raincross7/code-similarity | codes/train_code/problem133/problem133_478.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
int main(int argc, char const* argv[])
{
double x1, y1, x2, y2;
std::cin >> x1 >> y1 >> x2 >> y2;
double x = std::abs( x1 - x2 );
double y = std::abs( y1 - y2 );
std::cout << std::setprecision(20) << std::sqrt( x * x + y * y ) << std::endl;
return 0;
} | ALGO | 0.999401 | 4.034708 |
1c91f594-bd71-4590-9271-616f0d0ee26a | Jacker-Li/exposure-fusion | cpp_code/gaussian_pyramid.cpp | #include<opencv2/opencv.hpp>
#include"pyramid_filter.h"
#include"downsample.h"
#include"gaussian_pyramid.h"
using namespace cv;
// 构建高斯金字塔(用于权重)
vector<Mat>gaussian_pyramid(const Mat& img,int levels){
vector<Mat>im_v;//存金字塔每层图像
Mat cur=img.clone(),filter=pyramid_filter();
im_v.push_back(cur);
for(int ... | ALGO | 0.976588 | 3.989287 |
1bcb706d-846c-4c83-bbcb-cd6ba4a16392 | carrtesy/Problem-Solvings | bkj/11404/11404.cpp | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
#define INF 20000001
int n, m, dist[101][101]; // [i][j]
int adj[101][101];
void floyd(){
for (int j = 1; j <= n; j++){ // middle
for(int i = 1; i<= n; i++){ // start
int path1 = dist[i][j];
if(path1 == I... | ALGO | 0.999986 | 4.139616 |
bde54217-219b-4c7a-af9e-bd9a50c91fb5 | rvikunwar/leetcode | 101/Symmetric Tree.cpp | // Leetcode - Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).
// https://leetcode.com/problems/symmetric-tree/description/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* T... | ALGO | 0.999883 | 6.973287 |
942c1341-8669-4ba3-af7c-b3ec2d1c58a3 | Kavin1421/Leetcode-Solution | 0600-0699/0668.Kth Smallest Number in Multiplication Table/Solution.cpp | class Solution {
public:
int findKthNumber(int m, int n, int k) {
int left = 1, right = m * n;
while (left < right) {
int mid = (left + right) >> 1;
int cnt = 0;
for (int i = 1; i <= m; ++i) cnt += min(mid / i, n);
if (cnt >= k)
right =... | ALGO | 0.999982 | 5.585229 |
4a883573-69a8-476d-89f4-c01c20893399 | sitnet1102/AlgorithmQuiz | 프로그래머스/weeklyChallenge/006.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector<int> W;
vector<vector<int>> order;
bool cmp(vector<int> a, vector<int> b){
float A = 0;
float B = 0;
if(a[2] != 0){
A = (float)a[3] / (float)a[2];
}
if(b[2] != 0){
B = (float)b... | ALGO | 0.999982 | 4.374103 |
bbb07533-57f5-42e9-9193-0c641b6d2b5c | lwinminkhant/jfx | modules/javafx.web/src/main/native/Source/JavaScriptCore/bytecode/BytecodeBasicBlock.cpp | #include "config.h"
#include "BytecodeBasicBlock.h"
#include "CodeBlock.h"
#include "InterpreterInlines.h"
#include "JSCInlines.h"
#include "PreciseJumpTargets.h"
namespace JSC {
void BytecodeBasicBlock::shrinkToFit()
{
m_offsets.shrinkToFit();
m_successors.shrinkToFit();
}
static bool isJumpTarget(OpcodeID... | ALGO | 0.944773 | 7.943957 |
c74b274d-b0db-4e24-aa10-d00699fdb9c2 | kyongmen/BOJ_Online_Judge | SAMSUNG_SW_TEST/14889_스타트와링크.cpp | #include <iostream>
#include <cmath>
const int MAX = 20;
int mapAbility[MAX + 1][MAX + 1];
bool bSelected[MAX + 1];
int N, HalfN;
int nAnswer = 1e9;
void Solve();
void DFS(int nCurIdx, int nCnt);
int Calculate();
int main()
{
// IO Setting
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
std::cout.ti... | ALGO | 0.99982 | 4.593042 |
1ce0e33d-f1e7-4fcd-8e69-e8a4be5dd709 | jailsonzarur/Competitive-Programming-Problems | ContestCombinatroia/combina.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
using namespace std;
void comb(vector<string> s1){
int n = s1.size();
for(int i = 0; i < n; i++){
cout << s1[i] << endl;
}
for(int i = 0; i < n; i++){
for(int j = i+1; j < n; j++){
cout << s1[i] << ',' << s1[j]... | ALGO | 0.998145 | 4.20426 |
de96c28e-5e99-4bfa-b7b9-02041751261d | CGAL/cgal | Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp | //! \file examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp
// Adapting the dual of an arrangement to a BGL graph.
#include <CGAL/config.h>
#include <CGAL/boost/graph/breadth_first_search.h>
#include <boost/graph/visitors.hpp>
#include <CGAL/Arr_extended_dcel.h>
#include <CGAL/graph_traits_dual_arrangement_2.h... | ALGO | 0.997622 | 6.763538 |
f50ecfc8-4818-4998-8e41-c2f9da09ed25 | Tasin44/DSA | Binary Search/Find Peak Element.cpp |
///https://leetcode.com/problems/find-peak-element/description/
class Solution {
public:
int findPeakElement(vector<int>& nums) {
int n=nums.size();
int l=0,r=n-1;
while(l<=r)
{
int mid=l+(r-l)/2;
if((mid==0||nums[mid-1]< nums[mid]) and ((mid==n-1)|| nums[mid]... | ALGO | 0.999975 | 5.400913 |
16ed3947-373c-45f5-8675-b640a931175e | Akshaybalte1998/CPP_programs | baisc_programs/reverse.cpp | #include<iostream>
using namespace std;
int main()
{
int number, reverse=0, reminder;
cout<<"enter the number"<<endl;
cin>>number;
cout<<"number before reverse : "<<number<<endl;
while(number!=0)
{
reminder = number%10;
reverse = reverse*10 + reminder;
number = number... | ALGO | 0.999051 | 3.22913 |
9d79973d-98a7-4c63-afec-89ab8e7bc896 | AFMartinezF/mfem_prueba | mfem-4.7/examples/ex10p.cpp | // MFEM Example 10 - Parallel Version
//
// Compile with: make ex10p
//
// Sample runs:
// mpirun -np 4 ex10p -m ../data/beam-quad.mesh -s 3 -rs 2 -dt 3
// mpirun -np 4 ex10p -m ../data/beam-tri.mesh -s 3 -rs 2 -dt 3
// mpirun -np 4 ex10p -m ../data/beam-hex.mesh -s 2 -rs 1 -dt 3
// mp... | ALGO | 0.999697 | 5.277244 |
87403b38-116b-4630-bc11-01773ec13b95 | AutoProving/TreeWidzard-Engine | TreeAutomaton/DecompositionTree.cpp | #include "DecompositionTree.h"
DecompositionNode::DecompositionNode() {
parent = std::shared_ptr<DecompositionNode>(nullptr);
}
std::set<unsigned> DecompositionNode::getVertices() { return this->vertices; }
void DecompositionNode::addVertex(unsigned i) { this->vertices.insert(i); }
void DecompositionNode::setVerti... | ALGO | 0.994989 | 5.186975 |
66205782-e356-4019-be6f-2026db67e4ea | carttman/Backjoon | Backjoon/15650_N과 M 2.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> A;
int N, M;
void BackTracking(int start)
{
if (A.size() == M)
{
for (int n : A)
{
cout << n << " ";
}
cout << "\n";
return;
}
for (int i = start; i<= N; i++)
{
A.push_back(i);
BackTracking(i + 1);
A.pop_back();
}
}
i... | ALGO | 0.999917 | 4.17362 |
f8e89ff9-f5ab-4f8c-9353-06ddcead3ad6 | binarycraft007/libcronet | src/third_party/llvm-libc/src/src/math/generic/fminimum.cpp | #include "src/math/fminimum.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(double, fminimum, (double x, double y)) {
return fputil::fminimum(x, y);
}
} // namespace LIBC_NAMESPACE_DEC... | ALGO | 0.998737 | 5.988354 |
ecb6a1e6-c839-49dc-bc3c-fa7d0fbb361b | Kang-il/TIL | greedy/greedy_ex18.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// M :: 최대 증가하는 부분수열 길이
// K :: 최대 감소하는 부분수열 길이
int N,M,K;
void input(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin>>N>>M>>K;
return;
}
void solution(){
// 적어도 M개의 정수는 증가수열에 포함되어야 하고... | ALGO | 0.999971 | 4.344851 |
fb20d0ef-f158-44e2-b92b-dadfe545ea50 | MonkeyPsw/CodeTree_Psw | 250109/사칙연산 함수/quadratic-operations-function.cpp | #include <iostream>
using namespace std;
int a;
int c;
char o;
int Add(int x, int y)
{
return x + y;
}
int Sub(int x, int y)
{
return x - y;
}
int Mul(int x, int y)
{
return x * y;
}
int Div(int x, int y)
{
return x / y;
}
int main() {
cin >> a >> o >> c;
switch (o)
{
case '+... | ALGO | 0.998788 | 3.793124 |
9dc14cd3-9852-4d7e-8cde-6ead2f315cdd | date3k2/Programming | IT3040/lab02/lab02-bai8-20215343.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
// Nguyen Duy Dat - 20215343
int main()
{
int val1, val2;
cin >> val1 >> val2;
vector<vector<int>> a = {
{1, 3, 7},
{2, 3, 4, val1},
{9, 8, 15},
{10, val2},
};
// # sắ... | ALGO | 0.99916 | 3.317219 |
f4071da7-d001-42ec-95a4-f9955dc69266 | OpenXRay/xray-oxr-merge | 1.0007rc1 with 1.5.06/utils/xrAI/compiler_cover.cpp | #include "stdafx.h"
#include "compiler.h"
#include "cl_intersect.h"
#include "xrThread.h"
#include <mmsystem.h>
#include "quadtree.h"
#include "cover_point.h"
#include "object_broker.h"
Shader_xrLC_LIB* g_shaders_xrlc ;
xr_vector<b_material> g_materials ;
xr_vector<b_shader> g_shader_render ;
xr_vector<b_shader... | ALGO | 0.972758 | 3.750202 |
ea2d8b3e-d116-4222-87d3-76b46759c764 | SinonCute/cpp-playground | darray/DArray.cpp |
#include "DArray.h"
using namespace std;
DArray::DArray()
{
// The default constructor sets the capacity of
// the array to the value given by the constant value.
// Note that this is the only time that the
// global constant will be retrieved. From now on,
// only the member variable capacity sh... | TOOL | 0.863005 | 5.174318 |
6987a797-c845-46c1-86c2-76d24971d025 | alexandraback/datacollection | solutions_5695413893988352_0/C++/Foyaz05/dfsdfj.cpp | #include<bits/stdc++.h>
using namespace std;
string str,str2;
int n,m,pluso,ma,c,j;
vector<char>store,store2,now,now2;
void backtrack2(int i,int sum,int sum2){
if(i==m){
int diff=abs(sum-sum2);
if(diff<ma){
ma=diff;
c=sum;
j=sum2;
store=now;
store2=now2;
pluso=... | ALGO | 0.999878 | 3.500417 |
2adb90e3-7432-44c0-aab8-f721d4b37a4f | pedestrianlove/TCGS_Judge | src/c044.cpp | #include <iostream>
using namespace std;
int min (int x, int y) {
if (x < y)
return x;
return y;
}
int main ()
{
int a1, a2, b1, b2;
while (cin >> a1 >> a2 >> b1 >> b2) {
cout << min (a1 + a2, b1 + b2) << endl;
}
}
| ALGO | 0.978698 | 3.389261 |
f78bb940-765b-45eb-8457-541cca8531da | mrinalmadaria/GeeksForGeeks | POTD/RemoveDuplicatesInArray.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
vector<int> removeDuplicate(vector<int>& arr) {
// code here
set<int> st;
vector<int> ans;
for(int num : arr){
if(st.find(num) == st.end()){
... | ALGO | 0.999289 | 6.679534 |
2c948ee2-adff-4c05-a19e-c56b6d6f507b | KunalJadhao/Assignment-02 | P23.cpp | #include <iostream>
using namespace std;
// Creating a function
void calculateSumAndAverage(int arr[], int size) {
int sum = 0;
// Adding each element to the sum
for (int i = 0; i < size; i++) {
sum += arr[i];
}
// Calculating the average
double average = static_cast<double>(sum) / s... | ALGO | 0.99649 | 6.806643 |
4e018174-5007-443d-a849-bac6a4247228 | 668168/robocup3d | Delta3D2010/src/Agent_Roles/RoleRightDefensive.cpp | #include "RoleRightDefensive.h"
#include "../Behavior/BhvDribble.h"
#include "../Behavior/BhvBasicTurn.h"
#include <iomanip>
using namespace std;
const double nearConst = 1.0 ;///meter
void RoleRightDefensive::execute()
{
WorldModel & wm = WorldModel::instance();
if(wm.getPlayMode()==PM_BeforeKickOff)
wm.s... | TOOL | 0.995218 | 5.078191 |
fb6bed11-c565-4411-a7f5-b51086de86cc | rainmanp7/digitalnote45 | tests/Difficulty/Difficulty.cpp | #include <cstddef>
#include <cstdint>
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include "CryptoNoteConfig.h"
#include "CryptoNoteCore/Difficulty.h"
#include "CryptoNoteCore/Currency.h"
#include "Logging/ConsoleLogger.h"
using namespace std;
int main(int argc, char *argv[]) {
... | TOOL | 0.896223 | 5.363525 |
c8605fab-3f7f-478c-8b14-f46081dc435a | hfkfo/CSES_Solution | Sorting_and_Searching/Missing_Coin_Sum.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long int n,temp,sum = 0;
vector<long long int>x;
cin >> n;
for(int i = 0 ; i < n ; i++)
{
cin >> temp;
x.push_back(temp);
}
sort(x.begin(),x.end());
for(int i = 0; i < n; i++){
if(x[i] > sum + 1){
... | ALGO | 0.999952 | 3.67389 |
56016ed0-d6fc-4067-9eba-8412cdcc58b1 | alexandraback/datacollection | solutions_5634697451274240_1/C++/ZQFMGB12/main.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int T,N;
char S[105];
int main(){
freopen("ldata.in","r",stdin);
freopen("ldata.out","w",stdout);
scanf("%d",&T);
for (int z = 1; z <= T; z++){
scanf(" %100s",S);
int N = strlen(S);
int ans = 0;
... | ALGO | 0.9976 | 3.776982 |
367b9ee6-70b8-428a-8e38-3b7c713b5fdb | CanftIn/leetcode | 2024/107/so.1.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.999972 | 6.410003 |
d2d2ac29-85ee-43b7-9d80-012f999bdce3 | SarthakPatil11/DSA-CP | 001_DSA_Problems/stack_arr.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
struct stack {
int size;
int top;
int *arr;
};
struct stack *create(int size) {
struct stack *s = (struct stack *)malloc(sizeof(struct stack));
s->size = size;
s->top = -1;
s->arr = (int *)malloc(size * sizeof(int));
return s;
... | ALGO | 0.981534 | 4.067819 |
5db45c8f-eeea-4543-bd20-314645a7ea35 | AhJo53589/leetcode-cn | problems_test/46-lcof/SOLUTION.cpp |
//////////////////////////////////////////////////////////////////////////
class Solution {
public:
int translateNum(int num) {
vector<int> dp(3, 1);
int i = 1;
int mod = 0;
while (num >= 10) {
i++;
mod = num % 100;
num /= 10;
if (mod ... | ALGO | 0.999595 | 5.791813 |
675f344a-4372-4f0a-a971-4bc7089131fe | TRAN-THUY-NGOC/UPCODER | ONLINE JUDGE/VNOJ/Other/ Hang động.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
#define inp freopen("file.inp", "r", stdin)
#define out freopen("file.out", "w", stdout)
#define TIME 1.0*clock()/CLOCKS_PER_SEC
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0)
const int MAXN = 2e5 + 5;
const int MOD = 1e9 +... | ALGO | 0.999968 | 4.422142 |
574b98cf-0579-4f78-bec2-1557df0a96fa | rishabh26malik/Leetcode-Solutions | EASY/ARRAY/Duplicate Zeros.cpp | class Solution {
public:
void duplicateZeros(vector<int>& arr) {
int n=arr.size(), m, i;
for(i=0;i<n;i++){
if(arr[i]==0){
arr.insert(arr.begin()+i,0);
i++;
}
}
m=arr.size();
n=m-n;
i=m-1;
while(n--){
... | ALGO | 0.999806 | 6.191946 |
eb901097-a26e-441d-bee8-3e3b5a527ad3 | IntesarEWU/CSE350-Data-communication-LAB | Lab5/sender.cpp | //#include <iostream>
#include <string.h>
#include <bitset>
#include <fstream>
#include <bits/stdc++.h>
//#define MAXRESULT 1000
using namespace std;
void man()
{
int i=0;
string txt,str="";
ifstream temp("temp.txt");
while(getline(temp,txt))
{
//cout << str << '\n';
}
temp.clos... | ALGO | 0.999815 | 3.469147 |
986b8aad-bafd-4df1-a67b-ed142e52d7e7 | Ishwarendra/Contests | ATCODER/abc336/C.cpp | #include "bits/stdc++.h"
#ifdef LOCAL
#include "F:\CPP\Debug\debug.h"
#else
#define print(...) 1;
#endif
using i64 = long long;
int main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
i64 n;
std::cin >> n;
n--;
std::vector<int> ans;
while (n)
{
ans.emplace... | ALGO | 0.999969 | 4.242704 |
99039695-b9a7-4291-a710-d3fd9085f015 | shubhamgyd/mission_TCS | striver_sde_sheet/Arrays/2_Pascal_Triangle.cpp | /*
Given an integer numRows, return the first numRows of Pascal's triangle.
In Pascal's triangle, each number is the sum of the two numbers directly above it as shown:
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<vector<int>>res(n);
for(int i=0;i<n;i++)
{
... | ALGO | 0.999947 | 6.292921 |
dc30eb8f-15cf-48ac-b791-8c6ede2e1ca5 | prince-mali2/LeetCode-Solutions | 0102-binary-tree-level-order-traversal/0102-binary-tree-level-order-traversal.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.999965 | 6.288824 |
41d9f31e-573d-4824-a454-82fe8a78f056 | prasoon0459/DSA | 4.Strings/week2/4.suffix_array/suffix_array.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
using std::cin;
using std::cout;
using std::endl;
using std::make_pair;
using std::pair;
using std::string;
using std::vector;
// Build suffix array of the string text and
// return a vector result of the same length as th... | ALGO | 0.999941 | 5.161247 |
254bc3c4-1d81-4a29-807a-cfbe545717ba | Johniel/contests | codeforces/971div4/B/main.cpp | // github.com/Johniel/contests
// codeforces/971div4/B/main.cpp
#include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
using namespace std;
template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p);
template<typename P, typename Q> istream& operator >... | ALGO | 0.999812 | 4.285289 |
19baf025-a36b-4cc2-911a-e036f4891ddf | LeeKwang-min/Baekjoon-Algorithm | 2021CodingTestClass/기초/그래프/1260.cpp | /*
ۼ : ̻
Ͻ : 2021.03.01
: DFS BFS - 1260
Ǯ : DFS BFS ⺻ ϴ ̴.
ּ ó Լ "" ̿ Ǯ̸
ּ ƴ ڵ "Ʈ" ̿ Ǯ̴.
BFS 湮Ѵ = Լ ȣѴ = Լ chk
DFS 湮Ѵ = ť ִ´ = ť chk
DFS ⼭ ˾ư ʿ䰡 ִ.
*/
#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
int n, m, v;
vector<int> g[1001... | ALGO | 0.99999 | 4.447703 |
63dc7bc4-5f86-4ad8-9db2-73a684a08609 | tad315/TRR2-PTIT | TRR1013 - 1.13 Đồ thị.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl '\n'
#define ll long long
int main()
{
fast;
freopen("DT.INP", "r", stdin);
freopen("DT.OUT", "w", stdout);
int t, n;
cin >> t >> n;
vector<vector<int>> a(n + 1, vector... | ALGO | 0.999803 | 4.103997 |
e2dae9f5-4ffd-4e90-95ad-79a208a45e90 | Vlad1134323/C- | 14.11 2022/2.cpp | #include <iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main() {
int m=6, n=4;
int counter[n];
int array[m][n];
srand(time(NULL));
for(int a=0;a<n;a++){
counter[a] = 0;}
for(int a=0;a<m;a++){
for(int b=0;b<n;b++){
array[a][b]= rand()%10;}}
for(int a=0;a<m;a++){
for(int b=0;b<n;b++){
cout << array... | ALGO | 0.989554 | 3.894454 |
e71462fa-d25a-4f78-8267-b69d971dbabe | nothpy/gfg160days | Dynamic Programming/7 Edit Distance.cpp |
class Solution {
public:
// Function to compute the edit distance between two strings
int editDistance(string& s1, string& s2) {
int n = s1.length(), m = s2.length();
vector<vector<int>> dp(n + 1, vector<int>(m + 1, 0));
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= m; j++)... | ALGO | 0.999802 | 5.934892 |
6c113f8e-07bf-43fc-a651-9689ce9240c9 | pvthuyet/CppInAction | lib/boost_1_70_0/libs/fiber/src/numa/solaris/topology.cpp | #include "boost/fiber/numa/topology.hpp"
extern "C" {
#include <errno.h>
#include <sys/lgrp_user.h>
}
#include <system_error>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace {
void explore( std::vector< boost::fibers::numa::node > & topo, lgrp_cookie_t cookie, lgrp_id_t node) {
int siz... | TOOL | 0.951012 | 6.510955 |
6b91324b-c543-440a-b8bf-631840ad06cd | yuforest/contests | abc_279/c/main.cpp | // ここは競プロではサボりがちです
#include <bits/stdc++.h>
using namespace std;
// デバッグ用マクロです。詳しくは https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
// 節操ないですが、競プロでは便利です。
using ll = long ... | ALGO | 0.999985 | 4.466245 |
a93034f5-ab47-4722-bfec-1036e8ccffc2 | nikitasalnikov/movie_db | 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 |
27a481b0-0b61-4cd5-9b08-0157a09c9266 | EthanKim8683/High-School-Competitive-Programming | Codeforces/Problemset/DP/327a.cpp | #include<bits/stdc++.h>
using namespace std;
using I=int;
const I N=100;
I a_arr[N];
I ps[N+1];
I main(){
cin.tie(0)->sync_with_stdio(0);
I n;cin>>n;
for(I i=0;i<n;i++)cin>>a_arr[i];
for(I i=0;i<n;i++)ps[i+1]+=a_arr[i];
for(I i=0;i<n;i++)ps[i+1]+=ps[i];
I res=0;
for(I l=0;l<n;l++)for(I r=l;r<n;r++)
... | ALGO | 0.99976 | 3.447012 |
1cfaa7e2-1e93-49d2-a251-1c03ef619487 | asd00012334/Programming-Contest-Practice | GPE/GPE_May_18/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
while(1){
int n;
if(scanf("%d",&n)==EOF) break;
int seq[n];
for(int cnt=0;cnt<n;cnt++)
scanf("%d",seq+cnt);
int maxi=0;
int LIS[n];
for(int cnt=0;cnt<n;cnt++)
LIS[cnt]=1;
... | ALGO | 0.999734 | 3.575604 |
bafd1a85-c2bb-405f-9031-b9c979dc81a4 | HolicKW/codetree-TILs | 241104/사각형 채우기 3/rectangle-fill-3.cpp | #include <iostream>
#define MAX_N 1000
#define MOD 1000000007
using namespace std;
// 변수 선언
int n;
long long dp[MAX_N + 1];
int main() {
// 입력:
cin >> n;
// 초기 조건 설정
dp[0] = 1;
dp[1] = 2;
// 점화식에 따라 dp값 채우기
// dp[i] = dp[i - 1] * 2 + dp[i - 2] * 3 +
// (dp[i - 3] + dp[i - ... | ALGO | 0.999931 | 4.725002 |
1b4e0067-47c2-4f89-a677-46ac429220b7 | TobeOfili/Basic-C-Codes | Bitwise_Operators_Practice.cpp | #include <iostream>
using namespace std;
int main() {
// a = 5 (00000101), b = 9(00001001)
int a = 5;
int b = 9;
// the result is 00000001
cout << "a = " << a << ","
<< "b = " << b << endl;
cout << "a & b = " << (a & b) << endl;
// the result is 00001101
cout << "a | b = " <... | ALGO | 0.998989 | 4.214419 |
8d50b71f-d459-459e-8891-e951bc7c49ab | Nakib-Arman/CSE318---ArtificialIntelligence | 4.DecisionTree/.history/decision_tree_20250706122738.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
int column_num;
string label;
unordered_map<string,Node*> children;
Node* parent;
public:
Node(int column_num){
this->column_num = column_num;
this->parent = NULL;
this->label = "";
}
Node(string label){
... | ALGO | 0.995792 | 5.172289 |
196b1631-bb5f-40d9-af3f-7e403bb8679a | LuckyGrx/PAT_Basic_Level | C++/1039.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
string give,want;
cin>>give>>want;
int hash[62]={0};
for(int i=0;i<give.size();i++)
{
if(give[i]>='0'&&give[i]<='9')
hash[give[i]-'0']++;
else if(give[i]>='a'&&give[i]<='z')
hash[give[i]-'a'+10]++;
else
hash[give[i]-'A'+36]++;
... | ALGO | 0.999985 | 3.550056 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.