uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
49d9dbff-c509-465b-9c66-a30c1ab32ea6 | ruhulaminjr/Phitron-Cse-Fundamental-Course | contest/while-walkers.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 t;
cin >> t;
while (t--)
{
int n, c;
cin >> n >> c;
int sum = 0;
... | ALGO | 0.999525 | 3.608045 |
ba5e31b6-6695-4bff-b50d-ad0e2af5e25a | aditi2205/Algo- | codevita3.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
int isprime(int n)
{
for(int i=2; i<=sqrt(n); i++)
{
if(n%i==0)
return 0;
}
return 1;
}
int makeprimearray(vector<int> &a, int n)
{
if(n<1)
return 0;
a.push_back(2);
int j=1;
int val=2;
int count=0;
for(int i=3; i<n; i++)
{
if(isprime... | ALGO | 0.99974 | 4.1876 |
c5ddd3d6-1557-4352-9654-a2df0ae7c123 | AmanDhimanD/Leet-Code | Binary Tree Paths.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.999915 | 5.933434 |
be62ddf4-6945-4aa8-a95e-fad32559ae33 | D3v3sh5ingh/Graph-Theory-Algorithms | negative_weight_cycle_detection.cpp | #include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int isNegativeWeightCycle(int n, vector<vector<int>>edges){
// Code here
vector<int>dist(n,INT_MAX);
dist[0] = 0;
for(int i=0;i<n;i++){
for(int j=0;j<edges.size();j++){
if(dist[edges... | ALGO | 0.999907 | 6.009697 |
4752fe39-6366-4983-a43f-88bdcec2f0ad | oreoeo/NumbersStack | stack.cpp | /*
Orion Davis (3003072) <EMAIL>
The University of Akron
Computer Science II, Prof. Will
ASSGN6: Numbers Stack
*/
/*
#include <iostream> // For testing purposes
#include "NumStack.hpp"
/***************************************************************************
* This function will add the top two items and replac... | ALGO | 0.943496 | 4.385112 |
4d0dafac-b9b1-48af-a98e-9d35e1c3a533 | nhdotvn/kithuatlaptrinh | recursion/tst.cpp | #include<iostream>
using namespace std;
int xn(int n){
if (n<=1) return 1;
else{
int sum = 0;
for(int i=0; i<n;i++){
sum += (n-i)*xn(i);
}
return sum;
}
}
int main(){
int n;
cout<<"Nhap n: ";
cin>>n;
cout<<"\n X"<<n<<": "<<xn(n);
} | ALGO | 0.999946 | 4.182232 |
34f48fac-094a-4d27-bd0f-0059cfc53926 | ddotu2612/leetcode_tudv | T12_2024/B5_longest_palingromic_substring_medium.cpp | class Solution {
public:
int expand_around_center(string s, int left, int right) {
while(left >= 0 && right < s.size() && s[left] == s[right]) {
left--;
right++;
}
return right -left -1;
}
string longestPalindrome(string s) {
int start = 0;
int... | ALGO | 0.999981 | 5.999381 |
c1773df6-933d-4079-a82b-bf4a57a7f109 | humblerookie/svg-clip | 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.998848 | 6.76073 |
1fd70eb2-e105-4837-adb7-e01e12cc783c | NiuQiu/jpeg | A3_Hier_JPEG/code/src/huffman.cpp | #include "huffman.hpp"
Huffman::Huffman(std::vector<float> &input_float) {
for (auto &v : input_float) {
input.push_back(std::to_string(v));
}
init();
}
Huffman::Huffman(std::vector<std::string> &input) : input(input) {
init();
}
void Huffman::init() {
for (auto &v : input) {
fre... | ALGO | 0.98466 | 4.82634 |
b9821228-8b81-43be-aa8b-75a1d95dfc29 | AnesioSousa/BeecrowdChallenges | bee1038.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int codigo, quantidade;
float total = 0;
vector<float> cardapio;
cardapio.push_back(0);
cardapio.push_back(4.00);
cardapio.push_back(4.50);
cardapio.push_back(5.00);
cardapio.push_back(2.00);
cardapio.push_bac... | ALGO | 0.879907 | 4.596481 |
8c60c232-050e-457e-acb0-941c47b7140d | mukulbhatia799/solvingLeetCodeQues | 152-maximum-product-subarray/maximum-product-subarray.cpp | class Solution {
public:
int maxProduct(vector<int>& nums) {
int pf = 1, sf = 1;
int maxx = INT_MIN;
for(int i = 0; i < nums.size(); i++) {
pf *= nums[i];
sf *= nums[nums.size()-i-1];
maxx = max(maxx, max(pf, sf));
if(pf == 0) pf = 1;
... | ALGO | 0.99999 | 5.965348 |
3c0c611c-8fca-4fe6-8756-329d3a98b285 | ishandutta2007/codeforces | riverhamster/normal/527/E.cpp | #include <cstdio>
#include <cctype>
#include <algorithm>
#include <vector>
#include <cassert>
using namespace std;
using ll = long long;
namespace io {
#define File(s) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)
const int SIZE = (1 << 21) + 1;
char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT =... | ALGO | 0.999978 | 3.862512 |
c114fe3b-903f-4918-b8ba-1cb587b82ffc | bayashi-cl/procon-submission | atcoder/abc081/abc081_b/23829673.cpp | #pragma region template
#include <atcoder/math>
#include <atcoder/modint>
#include <boost/range/irange.hpp>
// #include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#includ... | ALGO | 0.999987 | 5.090662 |
3003c7f2-2860-4eaf-b66f-6d8cbe4f1b64 | GridOPTICS/GridPACK | src/applications/modules/dynamic_simulation_dae/model_classes/esst1a.cpp | // -------------------------------------------------------------
/**
* @file esst1a.cpp
* @author Shuangshuang Jin
* @author Shrirang Abhyankar
* @Last modified - 04/22/20
*
* @brief ESST1A exciter model implementation
*
*
*/
#include <esst1a.hpp>
#include <gridpack/include/gridpack.hpp>
#include <cons... | ALGO | 0.964902 | 5.399593 |
ebf69557-604d-4b61-8e61-4389c094237d | OwenHelios/algo | backtrack/LC39.cpp | // https://leetcode.cn/problems/combination-sum
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<int>> combinationSum(vector<int>& candidates, int target) {
int n = candidates.size();
vector<vector<int>> ans;
vector<int> cur;
int sum = 0;
... | ALGO | 0.99998 | 6.633373 |
fca9696c-6889-4958-bc2d-c19b666d0afd | kkorona/BOJ_Rche | 2487/main.cpp | #include <cstdio>
#include <cmath>
#include <vector>
using namespace std;
vector <long long > Cycles;
int N;
int Perm[20005],visit[20005];
int dfs(int node) {
if(visit[Perm[node]] == 1) return 0;
visit[Perm[node]]=1;
return dfs(Perm[node])+1;
}
long long gcd(long long a,long long b) {
long long x=a... | ALGO | 0.999848 | 3.519537 |
f61513a7-056f-4eb6-b2fe-8595af7d4007 | Ashutosh-0506/MIK_DesignDataStructure | L5_InsertSearchWord.cpp | //***********************************ASHUTOSH KUMAR***********************************//
/*
कर्मण्येवाधिकारस्ते मा फलेषु कदाचन।
मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि॥
Karmanye vadhikaraste Ma Phaleshu Kadachana,
Ma Karmaphalaheturbhurma Te Sangostvakarmani,
The meaning of the verse is :—
You have the right to wo... | ALGO | 0.995418 | 4.937906 |
b991f181-70a8-4af8-9806-940660caf30c | tenick/cp | Codeforces/Div2/889/b.cpp | #include <iomanip>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
void solve(){
ll n;
cin >> n;
ll curr... | ALGO | 0.99954 | 5.054425 |
0ab678c5-0ce9-4c6b-878d-25666c567fa7 | prajwal6162/DSA-Advance | Arrays/Fundamentals/Linear Search.cpp | class Solution {
public:
int linearSearch(vector<int>& nums, int target) {
for(int i=0; i<nums.size(); i++){
if(nums[i]==target) return i;
}
return -1;
}
}; | ALGO | 0.99971 | 5.941195 |
e7b9d96f-3a57-4199-9d42-924cec7e4cb3 | tlaitinen/xor | xcnf-clusters/xcnf-decompose2.cpp |
#include <sys/time.h>
#include <fstream>
#include <assert.h>
#include <algorithm>
#include <boost/config.hpp>
#include <boost/graph/copy.hpp>
#include <set>
#include <deque>
#include <map>
#include <vector>
#include <list>
#include <math.h>
#include <sstream>
#include <iterator>
#include <cstdlib>
#include <cstdio>
#i... | ALGO | 0.998752 | 3.713745 |
eac29a8b-82f5-49ba-ad50-0536a85f9b32 | taegun1011/problem-solving-cpp | repos/gold/29768.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0)
#define PII pair<int, int>
#define ll long long
int N, M;
void solve() {
cin >> N >> M;
for (int i = 0; i <... | ALGO | 0.998017 | 3.001953 |
143a4ec6-133e-4716-8580-777a4a44187e | Moneemabdullah/Xpsc.moneem | weak 8/day- 6/C_Grandma_Capa_Knits_a_Scarf.cpp | /*
MD Abdullah al moneem
Institute:- BAIUST
Country:- BANGLADESH
date: 2024-05-16 21:21:02
*/
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 5;
#define ll long long
#define INF LLONG_MAX
#define MOD 1000000007
#define pb push_back
#define vvi vector<vector<int>>
#define vpi ve... | ALGO | 0.999617 | 5.467978 |
79e9cebc-d607-4c22-b793-28262348a732 | rahul-goel/CompetitiveProgramming | CodeForces/C/558 C.cpp | /*
Created by Rahul Goel.
*/
/*******************************************************************************/
#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <un... | ALGO | 0.999958 | 4.426123 |
2a54ad21-cf9f-4ee4-8fd7-7c8d21696a12 | than5466/Advent_of_Code_2018 | Day_2/B.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
using namespace std;
bool one_differ(string s1, string s2){
int i = s1.length();
int differ = 0;
for (int j = 0; j < i; j++){
if (s1[j] != s2[j]){
differ ++;
}
}
if (differ == 1){
return true;
}
return false... | ALGO | 0.999911 | 3.716684 |
3bc6c354-247f-4ce7-8cbd-66846a960a4d | nagumallivinay123/striver_c- | dynamic_programming/rod_cutting.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int dp[N];
int minimumPathSum(vector<vector<int>> &triangle, int n)
{
int dp[triangle.size()][traingle.size()];
for (int i = 0; i < triangle.size(); i++)
{
for (int j = 0; j < triangle.size(); j++)
{
... | ALGO | 0.999981 | 4.79331 |
fccec866-a717-4354-9ae2-9f5612940891 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_10052_5.cpp | #include <bits/stdc++.h>
using std::pair;
using db = double;
using i64 = long long;
const int N = 100007;
struct vec {
i64 x, y, z;
} a[2][N], p[2], x;
vec operator-(const vec& a, const vec& b) {
return {a.x - b.x, a.y - b.y, a.z - b.z};
}
vec operator*(const vec& a, const vec& b) {
return {a.y * b.z - a.z * b.y,... | ALGO | 0.9998 | 3.767023 |
8a82204e-a9b7-431a-af7e-ea1e85ca1504 | ishandutta2007/codeforces | vladprog/normal/1328/C.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
typedef long double ld;
typedef pair<int,int> pii;
#define x first
#define y second
signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--)
{
int n;
... | ALGO | 0.999919 | 4.356524 |
f836f5d6-54da-4219-921c-451513c33043 | rupali199999/Leetcode | 129-sum-root-to-leaf-numbers/sum-root-to-leaf-numbers.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.999963 | 6.766269 |
4b797159-48a4-414a-b7a3-284ce59abcb1 | udontur/cs | hkoi/01030.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
queue<int> q;
cin >> n;
for(int i =1; i<=n; i++) q.push(i);
for(int i =0; i<n; i++){
q.push(q.front());
q.pop();
int t=q.front();
q.pop();
if(q.empty()) cout << "\n";
cout << t << " ";
... | ALGO | 0.99997 | 3.324632 |
0e9cc980-1a12-4716-aa89-58ae842be85d | pa1tJj/Data-structure-and-algorithm | bt-thuat toan tham lam/b17.cpp | #include<bits/stdc++.h>
using namespace std;
int kt(string s,int d){
sort(s.begin(),s.end());
int tmp=1,res;
int i=0;
while(i<s.length()){
if(s[i]==s[i+1]){
tmp++;
if(tmp>res){
res=tmp;
}
}else{
tmp=1;
}
++i;
}
if(res==d){
return 1;
}else{
return -1;
}
}
int main(){
string s;
getli... | ALGO | 0.999966 | 4.169825 |
4765f842-a7e2-4466-bf7c-54950e19e6e6 | stevenmsl/cpp_gtw_843 | solution.cpp | #include "solution.h"
#include "util.h"
#include <unordered_set>
#include <numeric>
#include <iterator>
#include <unordered_map>
#include <stack>
#include <string>
#include <sstream>
using namespace sol830;
using namespace std;
/*takeaways
- implement our match method to reduce the list of words
- secret = "acckzz... | ALGO | 0.999905 | 5.971313 |
9c99d2d0-18d6-4c0f-82ad-9a39ed1da9ba | shu8Cream/atcoder-archive | atcoder.jp/dp/dp_f/Main.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i,n) for (int i=0; i<(n); i++)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using Graph = vvi;
template<class T> inline bool chmax(T& a, T b) {
if (a < b) { a = ... | ALGO | 0.999996 | 4.575165 |
63072e2a-21fb-4385-83c0-742bd671e337 | ch-ms/cpp-white-belt | week2/reverse/main.cpp | #include <iostream>
#include <vector>
#include "Reverse.cpp"
using namespace std;
void PrintVector(const vector<int>& vec) {
for (const auto& value : vec) {
cout << value << " ";
}
cout << endl;
}
int main() {
vector<int> numbers = {1, 5, 3, 4, 2};
PrintVector(numbers);
Reverse(numbers);
PrintVector... | ALGO | 0.999018 | 5.336251 |
f00477fe-f877-47f9-b374-b735bc997e14 | weihao306/Leetcode | 17.电话号码的字母组合.cpp | /*
* @lc app=leetcode.cn id=17 lang=cpp
*
* [17] 电话号码的字母组合
*
* https://leetcode-cn.com/problems/letter-combinations-of-a-phone-number/description/
*
* algorithms
* Medium (55.47%)
* Likes: 911
* Dislikes: 0
* Total Accepted: 175.4K
* Total Submissions: 316.2K
* Testcase Example: '"23"'
*
* 给定一个仅包含... | ALGO | 0.999746 | 6.945228 |
e688b6ed-869a-4bbb-bb59-ea3b7a30a4ed | iman1999/acm | UVA/471.cpp | #include<iostream>
#include<algorithm>
#include<math.h>
#include<stdio.h>
#include<string>
#include<vector>
#include<iomanip>
#include<map>
#include <cstdlib>
#include <cstdio>
#include <cstring>
using namespace std;
bool Check(long long int h)
{
bool c[10] = { false };
while (h)
{
if (c[h % 10])
return false;... | ALGO | 0.997589 | 3.317319 |
6bed1b1f-ccf5-4c74-a575-8c24fab9d272 | habib-e/All-Problem-Solving-code-with-name | cost cutting.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t,i,k=1;
int ar[100];
cin>>t;
while(t--)
{
for(i=0;i<3;i++)
cin>>ar[i];
sort(ar,ar+3);
cout<<"Case "<<k++<<": "<<ar[1]<<endl;
}
return 0;
}
| ALGO | 0.999678 | 3.755858 |
26796266-5967-43fb-b8d0-667c3a2ba66e | thakurtpr/Notes | DSA/Recursion_Practice_Problems/isBinary.cpp | // Question: Write a recursive function to check if a given string is a valid binary string (i.e., contains only 0s and 1s).
// Function signature: isBinary(s)
// Example inputs:
// isBinary("1010") returns true
// isBinary("1234") returns false
// isBinary("10102") returns false
// Constraints:
// Use recursion to sol... | ALGO | 0.999904 | 7.112364 |
0ad32170-2de5-4e99-8667-fb8d83967fbb | nwooldridge/4280-P0 | P0.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <stdio.h>
#include <fstream>
#include <vector>
#include "node.h"
#include "tree.h"
using namespace std;
int main(int argc, char ** argv) {
//loop counters
int i, j;
ifstream input;
string line;
string filename;
//lineArray holds each line o... | ALGO | 0.995021 | 4.022871 |
f5e2b5dc-07fc-4aa9-8ba2-27d636448ed3 | maromcik/FaceRecognition | opencv/opencv-4.x/samples/cpp/convexhull.cpp | #include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace cv;
using namespace std;
static void help(char** argv)
{
cout << "\nThis sample program demonstrates the use of the convexHull() function\n"
<< "Call:\n"
<< argv[0] << endl;
}
int main( int argc, c... | ALGO | 0.991994 | 6.031953 |
b7c4fa65-69cd-464e-8853-aac526f5a884 | UTurwashi/leet-gFg_codes | 1979-find-greatest-common-divisor-of-array/1979-find-greatest-common-divisor-of-array.cpp | class Solution {
public:
int gcd(int a,int b){
if(b==0) return a;
else
return gcd(b,a%b);
}
int findGCD(vector<int>& nums) {
sort(nums.begin(),nums.end());
int n=nums.size();
return gcd(nums[0],nums[n-1]);
}
}; | ALGO | 0.999968 | 5.576952 |
f98567c9-e3b6-4115-9de3-8bbaad22e8a4 | MdAfsarHossain/Phitron | Semester 2/Course 1 [Introduction to Algorithms & Problem Solving Part - III]/XM/Lab Ass 2/Prob_5_Tabulation.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int INF = 2e9;
int dp[N];
int main()
{
int n;
cin>>n;
for(int i=0; i<n; i++)
dp[i] = -1;
dp[1] = 0;
int a, b, c;
for(int i=2; i<=n; i++)
{
a = dp[i-1];
b = INF;
c = INF;
if... | ALGO | 0.999993 | 3.80757 |
ac11e321-3ca6-41e3-b804-6ed32ff9da3d | Mantoui-Rom/frameworks_av | media/libstagefright/codecs/amrwb/src/qpisf_2s.cpp | /*
------------------------------------------------------------------------------
Filename: qpisf_2s.cpp
Date: 05/08/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
----------------------------------------------------------------------------... | ALGO | 0.999195 | 6.976351 |
88fa13ff-5bf6-4695-b336-0b929f95770a | nayemhasan45/Assignment | BasicDS_Assignment 1/Queries.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node*next;
Node(int val){
this->val=val;
this->next=NULL;
}
};
int size(Node*head){
int cnt=0;
while (head!=NULL)
{
cnt++;
head=head->next;
}
... | ALGO | 0.999911 | 3.869905 |
96cb809c-ff46-46ae-a6a0-88188e0ef8a2 | yangjufo/LeetCode | 2021/884. Uncommon Words from Two Sentences.cpp | class Solution {
public:
vector<string> uncommonFromSentences(string s1, string s2) {
unordered_map<string, int> count;
split(s1, count);
split(s2, count);
vector<string> res;
for (auto& iter : count) {
if (iter.second == 1) {
res.push_back... | ALGO | 0.99933 | 5.587399 |
fbe78a80-149e-46f0-b262-3a3c432f65d8 | intwocave/algorithm_training | BOJ/2920.cpp | #include <iostream>
#include <string>
using namespace std;
int main(void) {
string str;
getline(cin, str);
if(str == "1 2 3 4 5 6 7 8") cout << "ascending" << endl;
else if(str == "8 7 6 5 4 3 2 1") cout << "descending" << endl;
else cout << "mixed" << endl;
return 0;
}
| ALGO | 0.999648 | 3.188468 |
eb48e577-9dc1-4373-a5bd-267315533931 | Wasii25/ADS | c++/11/11.cpp | #include <iostream>
using namespace std;
template <typename T>
void bubblesort(T arr[], int n){
for(int i=0; i<n; i++){
for(int j=0; j<n-i-1; j++){
if(arr[j]>arr[j+1]){
T temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
}
}
... | ALGO | 0.99974 | 5.146169 |
659fda88-2d35-41af-b95d-c95a246b61bc | thatmartinlau/ConcurrentProject | src/particlemesh_thread.cpp | #include "core.hpp"
#include "simplesimulation.hpp"
#include <vector>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <fftw3.h>
#include <thread>
#include <mutex>
#define M_PI 3.14159265358979323846
#define BIG_G 6.67e-11
#define DEBUG false
#define THREAD_CHECKING false
//use function from simulat... | ALGO | 0.999885 | 4.759057 |
bcef1a15-9238-40e2-89c7-20ca9975d31c | tf153/Leetcode | Questions/703_Kth_largest_element_in_a_stream.cpp | class KthLargest {
priority_queue<int,vector<int>, greater<int>> pq;
int K;
public:
KthLargest(int k, vector<int>& nums) {
for(int n:nums)
pq.push(n);
while(pq.size()>k)
pq.pop();
K=k;
}
int add(int val) {
pq.push(val);
while(pq.si... | ALGO | 0.999951 | 5.925087 |
9340361e-b92a-4fe3-a116-529a07259542 | jeremykvlim/kattis | open/rainfall.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
double c, d;
cin >> T >> c >> d;
vector<int> r(T), pref(T + 1);
for (int i = 0; i < T; i++) {
cin >> r[i];
pref[i + 1] = pref[i] + r[i];
}
aut... | ALGO | 0.999829 | 4.187446 |
e8c80290-058c-4590-8995-a14e7ba1355b | HEltim7/cpcode | NowCoder/暑假/2022/contest9/G.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <array>
using namespace std;
#define endl '\n'
using LL=long long;
using ST=array<int, 6>;
constexpr int K=10;
int n,ans;
struct EerTree {
const static int A=26;
const static char B='a';
struct Node {
int len,lin... | ALGO | 0.99985 | 4.000777 |
ba42b5aa-4bfd-4cf1-bcad-e811080f83b4 | HossamSaberr/Problem-Solving-Library | Most Tech Used/DP/Problems/Number of Subarrays That Match a Pattern I.cpp | // LeetCode : https://leetcode.com/problems/number-of-subarrays-that-match-a-pattern-i/description/?envType=problem-list-v2&envId=rolling-hash
/*
بسم الله الرحمن الرحيم
الْحَمْدُ لِلّهِ الَّذِي هَدَانَا لِهَـذَا وَمَا كُنَّا لِنَهْتَدِيَ لَوْلا أَنْ هَدَانَا اللّهُ
اللهم حرر فلسطين من كيد الصهاينة واجعل كيدهم في نحور... | ALGO | 0.999936 | 6.053161 |
275ec22b-68e9-446b-a33d-1e1ae798d7a7 | Mdominykas/ICPC-team-reference | code/math/modular_exponentiation.cpp | ll modPow(ll a, ll n, ll mod)
{
if(n == 0)
return 1;
else if (n % 2 == 0)
return modPow((a * a) % mod, n / 2, mod);
else
return (a * modPow(a, n - 1, mod)) % mod;
} | ALGO | 0.999823 | 4.127953 |
84357b0b-a768-48ff-8c94-9a2d66ecbbe6 | MeBs2004/HomeworkPrograms | 24.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int a[5]={10,20,30,40,50},i=0,element;
cout<<"Input Searching Element"<<endl;
cin>>element;
while(i<5)
{
if(a[i]==element)
{cout<<"Item Found At Location"<<endl<<i;
break;
}
... | ALGO | 0.999272 | 4.223033 |
b6e70491-6513-4b9b-9925-4909a9f63b20 | dhairyarungta/leetcode | 133_2.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> neighbors;
Node() {
val = 0;
neighbors = vector<Node*>();
}
Node(int _val) {
val = _val;
neighbors = vector<Node*>();
}
Node(int _val, vector<Node*> _neighbors) {
val = _val;
... | ALGO | 0.999675 | 6.153836 |
6c672ad0-89a3-42ce-853e-9530afe115b2 | Umesh-1651/LeetCode | 1510-find-lucky-integer-in-an-array/1510-find-lucky-integer-in-an-array.cpp | class Solution {
public:
int findLucky(vector<int>& arr) {
map<int,int> mp;
for(auto i:arr){
mp[i]++;
}
int ans = INT_MIN;
for(auto i:mp)
{
if(i.second == i.first) ans = max(ans,i.first);
}
return ans==INT_MIN?-1:ans;
}
}; | ALGO | 0.999926 | 5.2184 |
1129e79b-8adf-48aa-993a-8ee5fb085293 | AHAsif1234/Codeforces | codeforces problem solve/A. Choosing Teams.cpp | #include<iostream>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
int arr[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
int count=0;
for(int i=0;i<n;i++)
{
int b=5-arr[i];
if(b>=k)
{
count++;
}
}
int c=count/3;
cout<<... | ALGO | 0.999973 | 3.647529 |
56cce5b0-e479-4851-933c-a8684c61fc2c | DanTrese/FPU-Assembler | lab9.4/Source.cpp | #include <iostream>
using namespace std;
int main() {
float x = 0.2, y = 4;
float results[6];
for (int i = 0; i < 6; i++) {
float Y = 0;
// Вставка асемблерного коду
_asm {
finit; // Ініціалізуємо FPU
fld x; // Завантажуємо з... | ALGO | 0.999078 | 3.598568 |
6ca6bbe1-4559-4bd3-9007-36c2cfbba0ee | escolizzi/Cell_Evolution_stickymoves | src/dish.cpp | // #include <iostream>
// #include <fstream>
#include <map>
#include <vector>
#include <list>
#include <set>
#include <algorithm>
#include <fstream>
#include <string.h>
#include <sstream>
#include <errno.h>
#include <math.h>
#include "dish.h"
#include "sticky.h"
#include "parameter.h"
#include "info.h"
#include "crash.... | ALGO | 0.987873 | 4.441285 |
698d5c7e-2078-4446-9437-36d7cd788c8c | south37/atcoder | joi2008yo/e/e.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>
#include <stack>
using namespace std;
#define COUT(x)... | ALGO | 0.999778 | 4.218428 |
a00820e2-8b0a-4ce8-ad96-6fd211750085 | hanzohasashi33/DSA | Binary Trees/Sum_Of_BinaryTree.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int key;
struct Node *left;
struct Node *right;
Node(int x){
key = x;
left = NULL;
right = NULL;
}
};
Node* make_tree()
{
int n;
cin>>n;
Node* head=NULL;
queue <Node*> q;
for( ; n>0 ; n-=2 )
{
int a,b;
char c;
cin>> a ... | ALGO | 0.99996 | 5.317427 |
8d83d349-be4d-4e4e-a515-c7545b6c943c | svistok04/college-CS | semester-6/compute-acceleration/0.Matrix.C/main.cpp | #include <iostream>
#include <random>
#include <ctime>
#define mMacro 1000
#define nMacro 100
int** allocMat(int rows, int cols) {
int** mat = new int*[rows];
for (int i = 0; i < rows; ++i)
mat[i] = new int[cols]{};
return mat;
}
void fillMat(int** mat, int rows, int cols, std::mt19937& gen) {
... | ALGO | 0.986224 | 4.0089 |
bc89c5ce-0ff3-40ec-b267-c7819a95e56a | GraveKeeper/CS161-Assignments | A03.cpp | /*
Sean Harrington
Cs161
*/
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
float speedx,speedy,timeH,timeM;
cout << "Please input the speed of car A " << endl;
cin >> speedx;
cout << "Please input the speed of car B " << endl;
cin >> speedy;
cout << "Please enter the... | ALGO | 0.996557 | 4.261164 |
5286a3a3-9961-476b-ad57-eae231d9c63b | hacch141/Coding-Practice | LeetCode/746.min-cost-climbing-stairs.cpp | // 746. Min Cost Climbing Stairs
class Solution {
public:
int minCostClimbingStairs(vector<int>& cost) {
int n = cost.size();
for(int i=2; i<cost.size(); i++) {
cost[i] += min(cost[i-1], cost[i-2]);
}
return min(cost[n-1], cost[n-2]);
}
};
| ALGO | 0.999872 | 6.057387 |
750f6918-265d-4185-b389-d0ac11682686 | MerlinLayer2/merlin-zkevm-prover | src/XKCP/Keccak-more-compact.cpp | #define FOR(i,n) for(i=0; i<n; ++i)
typedef unsigned char u8;
typedef unsigned long long int u64;
typedef unsigned int ui;
void Keccak(ui r, ui c, const u8 *in, u64 inLen, u8 sfx, u8 *out, u64 outLen);
void FIPS202_SHAKE128(const u8 *in, u64 inLen, u8 *out, u64 outLen) { Keccak(1344, 256, in, inLen, 0x1F, out, outLen)... | ALGO | 0.999834 | 5.892582 |
a0c3d31a-c748-47a5-845b-925d92b77006 | mohammad654/AlgorithmsProblemSolvingLevel1UsingCPP | Problem29.cpp | #include <iostream>
using namespace std;
enum enOddEven {
odd = 1, even = 2
};
int readNumber() {
cout << "Please enter a number?" << endl;
int number;
cin >> number;
return number;
}
enOddEven checkNumberType(int number) {
if(number % 2 != 0) return enOddEven::odd;
else return enOddEven::even;
}
int printEven_... | ALGO | 0.997592 | 4.779791 |
16927bbd-e312-4129-87df-173da478a2a6 | talhaarshad7/Advanced-Topics | 4) Bit Manipulation/the-equation-kickstart.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#incl... | ALGO | 0.999978 | 5.251196 |
4da33d48-b8b8-4d62-bb69-8daf95302feb | msorvig/qtbase-remac | src/corelib/thread/qreadwritelock.cpp | #include "qplatformdefs.h"
#include "qreadwritelock.h"
#ifndef QT_NO_THREAD
#include "qmutex.h"
#include "qthread.h"
#include "qwaitcondition.h"
#include "qreadwritelock_p.h"
#include "qelapsedtimer.h"
#include "private/qfreelist_p.h"
QT_BEGIN_NAMESPACE
/*
* Implementation details of QReadWriteLock:
*
* Depending... | TOOL | 0.974587 | 7.067065 |
f7e36915-a3d3-4c33-9850-9d9bd292d51c | Shivampg1/DSA-leetcode- | 105-construct-binary-tree-from-preorder-and-inorder-traversal/construct-binary-tree-from-preorder-and-inorder-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.999988 | 6.605544 |
e3fb5565-5552-4576-9c41-53212580b4ca | sparsh2002/Placement-Course-cpp | Problems/2_3_if_else.cpp | #include <iostream>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
int savings;
cin>>savings;
if(savings>5000){
cout<<"Neha";
}else{
cout<<"Rashmi";
}
return 0;
} | ALGO | 0.971527 | 3.5329 |
5d8efab3-9324-430e-a82f-59fbb1f5ba94 | thermotools/lammps_mie_fh | src/KOKKOS/fix_nvt_sllod_kokkos.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing authors: Emily Kahl (Uni. of QLD, <EMAIL>)
------------------------------------------------------------------------- */
#include "fix_nvt_sllod_kokkos.h"
#include "atom.h"
#include "atom.h"
#include "atom_ko... | ALGO | 0.968431 | 6.9446 |
1687f4e4-ddfa-4207-8b96-4e01b1d49045 | meetketanmehta/spoj-solution | Problem5.cpp | #include<iostream>
using namespace std;
int main(){
ios::sync_with_stdio(false);cin.tie(0);
int tc;
cin>>tc;
while(tc--){
int n,k;
cin>>n>>k;
int a[n+1];
for(int i=1;i<=n;i++)
cin>>a[i];
int dp[n+1][k+1];
for(int i=0;i<=k;i++)
dp[0][i]=0;
for(int i=0;i<=n;i++)
dp[i][0]=0;
for(int i=1;i<=n;i... | ALGO | 0.9999 | 3.459661 |
223087cb-f60b-466d-9d76-c8fa071e713b | JorgeIba/Competitive-Programming-Problems | 1068 - Investigation.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define lli long long int
#define ld long double
#define forn(i,n) for (int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
#define fastIO(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define SZ(s) int(s.size())
using namespace std;
typedef vector<lli> VL... | ALGO | 0.999704 | 4.0428 |
15e31e99-584a-4b65-9f65-d9f92df49cb1 | aritra-sen/DSA-Practice | ds/heap/check-if-heap.cpp | #include<iostream>
using namespace std;
bool checkMinHeap(int arr[],int n,int i)
{
if(i<=(n-2)/2)
{
int child1 = 2*i + 1;
int child2 = 2*i + 2;
if(child1<n && arr[i]>arr[child1])
return false;
if(child2<n && arr[i]>arr[child2])
return false;
bool v1 = child1<n?checkMinHeap(arr,n,chi... | ALGO | 0.999117 | 4.688118 |
bb859ab5-f80e-45ad-95f7-b25b36a7db13 | Jobayed1408/XPSC-PS | week 6/day 5/DDMM or MMDD.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t; cin>>t;
while(t--)
{
int a,b,c;
char ch,ch2;
cin>>a>>ch>>b>>ch2>>c;
if(a <= 12 and b <= 12) cout<<"BOTH\n";
else if(a>12 and b<=12) cout<<"DD/MM/YYYY\n";
else if(a<=12 and b>12) cout<<"MM/DD/YYYY\n";
}
} | ALGO | 0.99836 | 3.76953 |
6bac9205-5163-49e4-9a49-119516a75727 | thesoumyaagrawal/RubiksCubeSolver | PatternDatabases/CornerDBMaker.cpp | //
// Created by Lakshya Mittal on 18-02-2022.
//
#include "CornerDBMaker.h"
using namespace std;
CornerDBMaker::CornerDBMaker(string _fileName) {
fileName = _fileName;
}
CornerDBMaker::CornerDBMaker(string _fileName, uint8_t init_val) {
fileName = _fileName;
cornerDB = CornerPatternDatabase(init_val);
... | ALGO | 0.932537 | 4.21835 |
8fcfc03e-128e-4782-a181-815dcd8ff699 | GlibTugboat115/C-24041205 | fecha numero a letra if anidado.cpp | //Nombre: Ochoa Solis Ariel
//No.Control: 24041205
#include <windows.h>
#include <iostream>
using namespace std;
int main( )
{
SetConsoleOutputCP(CP_UTF8);
SetConsoleCP(CP_UTF8);
int d,m,a;
string mes;
cout<<"Dame una fecha en este formato: ddmmaaaa";
scanf("%2d%2d%4d",&d,&m,&a);
if (m==1)
mes="Enero";
else... | TOOL | 0.954774 | 3.552141 |
21d17250-782e-4ea0-9d73-0b73b3a79d68 | ishandutta2007/codeforces | pavel.savchenkov/normal/528/C.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <cstdlib>
#include <memory>
#include <queue>
#include <cassert>
#include <cmath>
#include <ctime>
#include <complex>
#include <bitset>
using namesp... | ALGO | 0.999971 | 4.332052 |
29142464-f948-47d3-a1fc-abb587389587 | a-oboh/relight | 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.998693 | 6.797273 |
ba02a676-c607-41c0-bf11-afd4a3a50099 | sinian666/codes_86_3 | cpp_副本11/chapter_sorting/insertion_sort.cpp | /**
* File: insertion_sort.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 插入排序 */
void insertionSort(vector<int> &nums) {
// 外循环:base = nums[1], nums[2], ..., nums[n-1]
for (int i = 1; i < nums.size(); i++) {
int base = nums[i], j = i - 1;
/... | ALGO | 0.999959 | 6.17374 |
58425115-80b4-41ec-939c-94c05d5d6706 | sfd-mhrana/CP_CLUB | W-4/D-3/Boxes.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
const int SMALL_LETTER_STATING_POINT = 97;
const int CAPITAL_LETTER_STATING_POINT = 65;
void solve()
{
ll n;
cin >> n;
ll arr[n];
for (ll i = 0; i < n; i++)
{
cin >> arr[i];
}
sort(arr, arr + n, ... | ALGO | 0.999878 | 5.1485 |
d4478e95-0ffa-4d52-becd-1e76c808507e | sarahishamsaied/Problem-Solving | Code Forces/easyQueue.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n;
cin>>n;
queue<int>q;
while (n--)
{
int query;
cin>>query;
if(query==1){
int y;
cin>>y;
q.pu... | ALGO | 0.999548 | 4.590663 |
a6ace5e1-a09d-4e5e-9aa6-f899cad35bb1 | ishandutta2007/codeforces | monogon/normal/1075/A.cpp |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll n, x, y;
cin >> n >> x >> y;
ll dist1 = max(x - 1, y - 1);
ll dist2 = max(n - x, n - y);
cout << (dist1 <= dist2 ? "White\n" : "Black\n");
} | ALGO | 0.999068 | 3.854748 |
d4b2b459-8fff-47f8-9236-bd74bc3a8463 | sktasnim2005/CodeForces-Solution | A_Blackboard_List.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ii int
#define ss string
#define dd double
void solve() {
ii n;
cin >> n;
vector<ll> a(n);
for(ll &x : a) cin >> x;
sort(a.begin(),a.end());
cout << a[0] <... | ALGO | 0.999527 | 5.269976 |
10cf4954-7bed-43a5-a35b-3541c40e3a1e | tkgaolol/brushcode_leetcode | code/242.cpp | class Solution {
public:
bool isAnagram(string s, string t) {
int record[26] = {0};
for (int i = 0; i < s.size(); i++)
{
record[s[i] - 'a'] ++;
}
for (int i = 0; i < t.size(); i++)
{
record[t[i] - 'a'] --;
}
for (int i = 0; i < ... | ALGO | 0.999982 | 6.19882 |
051ad5fb-a3a6-4629-8a1c-b4e20c5c8df4 | yashas-salankimatt/URS-Project | ros_workspace/src/rosbot_description/amcl_custom/src/amcl/sensors/amcl_laser.cpp | ///////////////////////////////////////////////////////////////////////////
//
// Desc: AMCL laser routines
// Author: Andrew Howard
// Date: 6 Feb 2003
// CVS: $Id: amcl_laser.cc 7057 2008-10-02 00:44:06Z gbiggs $
//
///////////////////////////////////////////////////////////////////////////
#include <sys/types.h> //... | ALGO | 0.984705 | 5.809357 |
d3b33323-1549-46ff-92b0-ce92bab3a979 | himanshimr11/DSA | Maximum Count of Positive Integer and Negative-integer.cpp | //https://leetcode.com/problems/maximum-count-of-positive-integer-and-negative-integer/
class Solution {
public:
int maximumCount(vector<int>& nums) {
int pos=0,neg=0;
for(int num:nums)
{
if (num > 0)
pos++;
else if (num < 0) ... | ALGO | 0.999868 | 5.231735 |
6e5571ff-8a96-41ca-98e4-be4a5d930785 | hjiang13/LLMs-in-IR | processed_data/Decompiled_Humaneval_x_cpp_164_Result_O3/Meta-Llama-3.1-405B_Humaneval_x_cpp_164/CPP_35.cpp | #include <stdio.h>
float max_element(float* data, int size) {
float max_val = -10000.0f;
if (size == 0) {
return max_val;
}
int unroll_factor = (size >> 2) + 1;
int remainder = size & 3;
if (unroll_factor < 4) {
for (int i = 0; i < size; i++) {
float val = data[i]... | ALGO | 0.99946 | 5.038917 |
dae74c29-0cf0-4ba0-885e-535e66c64ff2 | bmelinden/uncertainSPT | HMMcore/triSym_triInv_backsubLDU.cpp | /*
[y,w0,w1,lnDetT]=triInv_backsub(a,b,x)
Solve linear system T*y=x, and compute log(det(T)) and the diagonal and
first off-diagonal entries of inv(T), where T is a symmetric, positive
definite tridiagonal matrix of the form
T = [a(1) b(1) 0 . . . . . . ]
[b(1) a(2) b(2) 0 . . . . ]
[ 0 b(2) a(... | ALGO | 0.999988 | 4.994522 |
4a8a0670-63a5-4c1d-a58d-dcd1c7b9a34d | sarvex/leetcode-clojurescript | solution/1800-1899/1819.Number of Different Subsequences GCDs/Solution.cpp | class Solution {
public:
int countDifferentSubsequenceGCDs(vector<int>& nums) {
int mx = *max_element(nums.begin(), nums.end());
vector<bool> vis(mx + 1);
for (int& x : nums) {
vis[x] = true;
}
int ans = 0;
for (int x = 1; x <= mx; ++x) {
int g... | ALGO | 0.999915 | 5.836481 |
fcaec052-3141-49d9-824a-57afce74b4dd | AdityaPapal/CPP_Bootcamp | For Loop/1.cpp | #include<iostream>
using namespace std;
int main()
{
int x;
cout << "Enter the number";
cin>>x;
for (size_t i = 0; i < x; i++)
{
cout<<i<<endl;
}
return 0;
} | TOOL | 0.882612 | 3.219409 |
a5f6676a-cb85-4345-b33e-a0d54710f09d | vektort13/AntidetectFirefox | toolkit/mozapps/update/common/readstrings.cpp | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include "readstrings.h"
#include "errors.h"
#ifdef XP_WIN
# define NS_tfopen _wfopen
# define OPEN_MODE L"rb"
#else
# define NS_tfopen f... | TOOL | 0.927962 | 6.547497 |
7fae518e-7139-4b68-a51a-a94e8764a369 | Dm1tryb1t/labs | source/lab2/lab2.cpp | #include "Vector.h"
// g++ source/lab2/lab2.cpp source/lab2/Vector.cpp -o build/lab2
#include <fstream>
#include <iostream>
#include <string>
int main() {
double arr[] = {1.0, 2.0, 3.0, 4.0, 5.0};
std::ifstream in;
Vector vec1;
Vector vec2;
Vector vec3(arr, 5);
in.open("./input/input_lab2.txt");
if (!i... | ALGO | 0.940428 | 3.659052 |
9af108a8-475f-4e94-8e61-87b2b4b03c5b | mdallrabbi/Online-Judge-Solution-Backtrack | Timus Online Judge/2023 - Donald is a postman.cpp | #include <iostream>
using namespace std;
int main()
{
int n,sum=0;
cin>>n;
string m;
int arr[n];
arr[0]=1;
for(int i=1;i<=n;i++)
{
cin >> m;
if(m[0]=='A' || m[0]== 'P' || m[0]=='O' || m[0]== 'R')
{
arr[i]= 1;
}
else if(m[0]=='B' || m[0]== 'M' || m[0]=='... | ALGO | 0.999089 | 3.544516 |
fc342077-f764-4bd2-8bdd-b4e0b72121bf | Dhaked1/Cpp______programming_language | c++ programs 2/27.pass-string-by-ptr.cpp | #include<iostream>
using namespace std;
void display(char*);
int main()
{
char s1[25] = "alka";
display(s1);
return 0;
}
void display(char *p)
{
while (*p)
{
cout<<*p;
p++;
}
} | ALGO | 0.966998 | 3.048108 |
e90d2a6a-318f-4a74-a6bc-04d421d0c0f7 | BoSmallEar/OS-Practice | jimzhang.troyhe.zzliu.2/test7.cpp | #include <iostream>
#include <queue>
#include "cpu.h"
#include "thread.h"
#include "mutex.h"
#include "cv.h"
using namespace std;
void child(void* arg){
int id = *(int*)arg;
if(id <= 100000){
thread* t = new thread(child, new int(id * 2));
cout<<id<<endl;
if(1000 < id && id < 10000) thread::yield();
}
}
voi... | TOOL | 0.975272 | 3.270864 |
9114deca-5efd-4391-a80f-0179071c7aae | slk000/newbie | acm/cf/260A.cpp | //AC
//http://codeforces.com/problemset/problem/260/A
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
#define INF 0x3f3f3f3f
#define MAX 100000
int arr[MAX + 10];
int main(){
int a, b, n;
scanf("%d %d %d", &a, &b, &n);
if(a%b==0){
printf("%d", a);
... | ALGO | 0.999691 | 3.293766 |
7bfcd1e0-4637-46d4-b098-3e403fa92455 | mruegenberg/houdini-transform-matcher | eigen/doc/examples/Tutorial_ArrayClass_accessors.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXXf m(2,2);
// assign some values coefficient by coefficient
m(0,0) = 1.0; m(0,1) = 2.0;
m(1,0) = 3.0; m(1,1) = m(0,1) + m(1,0);
// print values to standard output
cout << m << endl << endl;
... | ALGO | 0.98226 | 3.536336 |
b75f9def-fe6a-49cd-8d9e-c662fbfe0fc7 | aryuemaan/competitive_programming | Competitive_Programming/A_Insert_Digit.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::va... | ALGO | 0.999598 | 5.197054 |
4a4ca331-7b69-4b55-8b00-1baa1c5c9332 | Jojo10x/classic-russian-checkers | player.cpp | #include "checkers.h"
#include <iostream>
#include <string>
void playerTurn(Checkers& game, char player) {
std::string move;
std::vector<std::pair<int, int> > captures = game.getMandatoryCaptures(player);
if (!captures.empty()) {
std::cout << "You must capture!" << std::endl;
}
std::cout ... | ALGO | 0.940825 | 5.56859 |
3e59c818-8422-4b78-9fa0-39b976d2d711 | yhw-yhw/MOVER | thirdparty/scene_initialization/Manifold/3rd/igl/setdiff.cpp | template <
typename DerivedA,
typename DerivedB,
typename DerivedC,
typename DerivedIA>
IGL_INLINE void igl::setdiff(
const Eigen::DenseBase<DerivedA> & A,
const Eigen::DenseBase<DerivedB> & B,
Eigen::PlainObjectBase<DerivedC> & C,
Eigen::PlainObjectBase<DerivedIA> & IA)
{
using namespace Eigen;
usi... | ALGO | 0.978054 | 6.318884 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.