uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
710b02fe-019b-4b5d-84f4-537e510ed8f1 | pascal-the-elf/TIOJ-ASE | solutions/#01924_撿石子遊戲.cpp | #include <bits/stdc++.h>
#define MAXN 2000000
using namespace std;
int n, ans;
string s;
string arr[6] = {"PEC","PCE","EPC","ECP","CPE","CEP"};
int dp[2][3];
signed main() {
ios_base::sync_with_stdio(0), cin.tie(0);
cin >> n >> s;
for (int t = 0; t < 6; t++) {
dp[0][0] = (s[0] == arr[t][0]);
dp[0][1] = dp[0][2... | ALGO | 0.999946 | 3.938388 |
0f282845-a053-46a1-8fb5-b5e8942f347c | K14KHaNaSa/bojPractice | 1049.cpp | #include <iostream>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, m, s, o;
cin >> n >> m;
int six = 1001;
int one = 1001;
for (int i = 0; i < m; i++) {
cin >> s >> o;
six = min(six, s);
one = min(one, o);
}
cout << (n / 6) * min(six, one * 6) +... | ALGO | 0.999662 | 4.193845 |
c032ae7a-f478-4118-9d5e-7a8f2c8e8a1b | Pavitar56/LeetCode | 0124-binary-tree-maximum-path-sum/0124-binary-tree-maximum-path-sum.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.999991 | 6.1829 |
21291dce-d9cb-4873-b2da-9744e5a9efa6 | nehalohani04/Leetcode | 0062-unique-paths/0062-unique-paths.cpp | class Solution {
public:
int uniquePaths(int m, int n) {
// dp[i][j] := unique paths from (0, 0) to (i, j)
vector<vector<int>> dp(m, vector<int>(n, 1));
for (int i = 1; i < m; ++i)
for (int j = 1; j < n; ++j)
dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
return dp[m - 1][n - 1];
}
}; | ALGO | 0.999525 | 6.87765 |
d98cefca-08d9-4c05-a2f3-faa5ea004eac | AtharvPitrubhakta/Coding_Sheet | C++ Sheet/LOVE BABBER SHEET/Functions/Counting.cpp | #include<iostream>
using namespace std;
// Function Signature
void printCounting(int n){
// Function Body
for(int i = 0; i <= n; i++) {
cout << i << " ";
}
cout << endl;
}
int main() {
int n;
cin >> n;
// Function call
printCounting(n);
return 0;
} | ALGO | 0.999184 | 5.346973 |
227a04ea-575e-4e75-b060-eb15f7f80854 | Priyanshu885588/DSA | array/maxDifBtwArrayElements.cpp | // maximum difference between increasing element
#include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
int maximumDifference(vector<int> &arr)
{
int max_diff = arr[1] - arr[0];
int i = 0;
for (i = 0; i < arr.size() - 1; i++)
{
if (arr[i] ... | ALGO | 0.9999 | 4.880274 |
20003aa5-1e22-477c-a692-c8454ab5490a | Aashu1303/GfG | Medium/Largest subsquare surrounded by X/largest-subsquare-surrounded-by-x.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int largestSubsquare(int n, vector<vector<char>> a) {
vector<vector<pair<int,int>>> v (n ,vector<pair<int,int>>(n));
... | ALGO | 0.999712 | 6.357541 |
2e1f15eb-972f-47c8-b574-61325585893f | sazzad90/advance_practice | rockClimbingWithDP.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
int n, m;
bool dfs(vector<vector<int>> &grid, vector<vector<int>> &dp, vector<vector<bool>> &visited, int r, int c){
if(r == n-1 && c == 0) return true;
if(dp[r][c] != -1) return true;
int temp = INT_MAX;
visited[r][c] = t... | ALGO | 0.999779 | 4.402007 |
75628371-fffa-4ba1-b06a-037b23629550 | JanaSabuj/UVa-solutions | CP3/Dynamic Programming/787 - Maximum Sub-sequence Product.cpp | //Built by Sabuj Jana(greenindia) from Jadavpur University,Kolkata,India
//God is Great
#include <bits/stdc++.h>
using namespace std;
#define crap ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
//cout<<fixed<<showpoint<<setprecision(12)<<ans<<endl;
#define endl "\n"
#define int long long int
#define double lo... | ALGO | 0.999974 | 3.511725 |
e5bdbf5e-7499-4cb6-a26f-d9c8d4fe7f9d | ishandutta2007/codeforces | andrew/normal/1427/C.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define p_b push_back
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define all(x) x.begin(),x.end()
#define sset ordered_set
#define sqr(x) (x)*(x)
#define pw(x) (1ll << x)
#define sz(x) (int)x.size()
#define fout(x) {cout << x << "... | ALGO | 0.999981 | 4.496357 |
839a689b-ac7c-401a-adeb-21577c016f59 | haneul/appfence_frameworks_base | tools/localize/Configuration.cpp | #include "Configuration.h"
#include <string.h>
int
Configuration::Compare(const Configuration& that) const
{
int n;
n = locale.compare(that.locale);
if (n != 0) return n;
n = vendor.compare(that.vendor);
if (n != 0) return n;
n = orientation.compare(that.orientation);
if (n != 0) return ... | TOOL | 0.867121 | 5.457647 |
95676a7a-954c-431a-a599-65157186183c | abhishek-217/DSA_Questions | 2580-circular-sentence/2580-circular-sentence.cpp | class Solution {
public:
bool isCircularSentence(string sentence) {
int l = sentence.size();
if(sentence[0] != sentence[l-1]){
return false;
}
for(int i=0; i<l-1; i++){
if(sentence[i] == ' ' && sentence[i] != sentence[l-1] ){
if(sentence[i-1] ... | ALGO | 0.999713 | 5.755795 |
1e52d886-c253-46f0-a0bb-0639273bcd98 | TitikshaBansal/LeetCode | Easy/findWordsContainingCharacter.cpp | class Solution {
public:
vector<int> findWordsContaining(vector<string>& words, char x) {
vector <int> res;
for (int i = 0 ; i < words.size() ; i++) {
if (words[i].find(x) != string::npos) res.push_back(i);
}
return res;
}
};
// https://leetcode.com/problems/find-wor... | ALGO | 0.999535 | 6.30671 |
c54f284c-f640-43e4-8ec7-ee7c1adebd4d | mdshihabshahriar/Problem-Solving | A_Bear_and_Big_Brother.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
int year = 0;
while(a <= b)
{
a *= 3;
b *= 2;
year++;
}
cout << year << endl;
return 0;
}
| ALGO | 0.999594 | 4.000465 |
989b6346-ec56-4736-9a7c-93042f862af4 | fpga-design-contest/ad-refkit | zybo/ROOT_FS/app/ad-sample/src/ad/LineTracer/LineTracer.cpp | #include "LineTracer.h"
namespace ad {
LineTracer::LineTracer() {
if(std::getenv("AD_SAMPLE_ROOT") == nullptr) {
throw std::logic_error("[" + std::string(__PRETTY_FUNCTION__) + "] " +
"Please set environment value : $ export AD_SAMPLE_ROOT=<path of project roo... | ALGO | 0.8974 | 5.882966 |
139672f1-8636-4d60-b371-3082eb2d71fa | kalo-ai/ShapePFCN | Thea/Code/Source/Test/TestPCA.cpp | #include "../Algorithms/PCA_N.hpp"
#include "../Algorithms/SparsePCA_N.hpp"
#include "../Algorithms/PointTraitsN.hpp"
#include "../Common.hpp"
#include "../Math.hpp"
#include "../Vector3.hpp"
#include <iostream>
using namespace std;
using namespace Thea;
using namespace Algorithms;
bool testPCA();
int
main(int argc,... | ALGO | 0.988218 | 5.462699 |
3857410b-916a-4a81-9921-abaacec7dfa5 | thevoid3301/AlgorithmStudy | leetcode/560.和为-k-的子数组.cpp | /*
* @lc app=leetcode.cn id=560 lang=cpp
*
* [560] 和为 K 的子数组
*/
// @lc code=start
class Solution{
public:
static int subarraySum(vector<int>& nums, int aim) {
unordered_map<int, int> map;
// 0这个前缀和,在没有任何数字的时候,已经有1次了
map[0] = 1;
int ans = 0;
for (int i = 0, sum = 0; i < n... | ALGO | 0.999966 | 6.296985 |
10823644-2ea8-4641-95da-f83034a31915 | DavidOrDavud/Drobi | Класс дробь/Класс дробь/Drobi.cpp | #include "Drobi.h"
int chisl;
int znamen;
int NOD(int x, int y)
{
if (y == 0) return x;
return NOD(y, x % y);
}
void input(int c, int z)
{
chisl = c;
znamen = z;
}
void mult(int x)
{
chisl *= x;
cout << ": " << chisl << '/' << znamen << endl;
}
void div(int x)
{
znamen *= x;
cout << ":... | ALGO | 0.991277 | 3.063829 |
f62d4ce9-db4f-4b35-9dbe-b7f3b04b6f6b | ritikbanger/Hacktoberfest2022-DSA | 04. Arrays/FourSum.cpp | /*
Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that:
0 <= a, b, c, d < n
a, b, c, and d are distinct.
nums[a] + nums[b] + nums[c] + nums[d] == target
You may return the answer in any order.
Example 1:
Input: nums = [1,0,-1,0,-2,2], tar... | ALGO | 0.999954 | 6.225027 |
9bf485b2-41c0-4acd-977b-9a45488d2c20 | ArtiGaund/Leetcode | 2202-sum-of-k-mirror-numbers/sum-of-k-mirror-numbers.cpp | class Solution {
public:
int digit[100];
bool isPalindrome(long long x, long long k){
int length=-1;
while(x){
++length;
digit[length]=x%k;
x/=k;
}
for(int i=0,j=length;i<j;i++,j--){
if(digit[i]!=digit[j]) return false;
}
... | ALGO | 0.999927 | 4.990714 |
e5a4e51a-132f-4a17-8aab-d6efc885cc1d | rakibulhasan-swe/problem-solving | codeforces/contest_codeforces/div4/a.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--){
int a, b, c;
cin >> a >> b >> c;
if((a+b) == c)
cout << "+\n";
else if((a-b) == c)
cout << "-\n";
}
return 0;
}
| ALGO | 0.999715 | 4.627337 |
427348a9-3e55-4286-a71f-6656627c72a2 | ccy89/VINS-Mono-Comment | vins_estimator/src/estimator.cpp | #include "estimator.h"
Estimator::Estimator() : f_manager{Rs} {
ROS_INFO("init begins");
clearState();
}
void Estimator::setParameter() {
for (int i = 0; i < NUM_OF_CAM; i++) {
tic[i] = TIC[i];
ric[i] = RIC[i];
}
f_manager.setRic(ric);
ProjectionFactor::sqrt_info = FOCAL_LENGTH / 1.5 * Matrix2d::I... | ALGO | 0.994678 | 4.158881 |
b98d133b-e82e-424b-abd5-1645e86de484 | Nakib-Arman/CSE318---ArtificialIntelligence | 2105128/.history/2105128_20250722121241.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
int column_num;
string label;
unordered_map<string,Node*> children;
float threshold;
public:
Node(int column_num){
this->column_num = column_num;
this->label = "";
this->threshold = 0;
}
Node(string labe... | ALGO | 0.997526 | 4.916104 |
39abcf96-5e30-4cb4-9d6f-16f7778a6358 | TrainingByPackt/CPP-Data-Structures-and-Algorithm-Design-Principles | Lesson5/Activity11/interval_scheduling_solution.cpp | #include <list>
#include <algorithm>
#include <iostream>
#include <random>
// Every task is represented as a pair <start_time, end_time>
struct Task
{
unsigned ID;
unsigned start_time;
unsigned end_time;
};
auto initialize_tasks(size_t num_tasks)
{
std::random_device rd;
std::mt19937 rand(rd());
std::uniform_in... | ALGO | 0.999614 | 5.791245 |
15534b8c-fee0-4f87-bee3-8241650df8a9 | HohyunKim-kr/codingTest-study | AlgorithmJobs/Week2/Day2_2.cpp | // 소수판별2 **
#include <stdio.h>
#include <iostream>
#include <cmath>
using namespace std;
int N, M;
int numArray[20010] = { 0, };
int main() {
scanf("%d %d", &N, &M);
int large, small;
if (N >= M) {
large = N;
small = M;
}
else {
large = M;
small = N;
}
// 숫자 배열 채우기
for (int i = 1; i <= large; i+... | ALGO | 0.999989 | 3.554869 |
0016bdca-5d55-4506-9653-9becc2559437 | tgxworld/CS1020E | pe_past_sems/PE 3/LII/Solution/LII.cpp | #include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
using namespace std;
int main(){
//freopen("a.in", "r",stdin);freopen("a.out", "w", stdout);
int ans = 0;
int N;
cin>>N;
int x, y, ins = 1;
cin>>y;
for (int i=1; i<N; i++){
cin>>x;
if... | ALGO | 0.999959 | 3.641258 |
0bbcea6d-b88f-4f1f-8f56-717aaaf4dc92 | xidianlina/cppplus | chapter_04_addpntrs.cpp | #include <iostream>
int main()
{
using namespace std;
double wages[3] = { 10000.0,20000.0,30000.0 };
short stacks[3] = { 3,2,1 };
double *pw = wages;
short *ps = &stacks[0];
cout << "pw = " << pw << ", *pw = " << *pw << endl;
pw = pw + 1;
cout << "add 1 to the pw pointer:\n";
cout << "pw = " << pw << ", *p... | TOOL | 0.990934 | 3.130884 |
1b668290-9dbc-4b1a-bb26-9b199693258d | limiteci/SlapDash | SlapDash/src/crypter.cpp | #include <openssl/aes.h>
#include <openssl/evp.h>
#include <vector>
#include <string>
#ifdef WIN32
#include <windows.h>
#endif
#include "crypter.h"
bool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::vector<unsigned char>& chSalt, const unsigned int nRounds, const unsigned int nDerivationMe... | TOOL | 0.880158 | 7.062585 |
a1d08732-fb8d-43af-9eb9-ff535d06bbd2 | Katsudon10/Competitive-programming | Atcoder/ABC/ABC355/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define ALL(a) (a).begin(),(a).end()
const int inf = INT_MAX;
using ll = long long;
const ll INF = 1e18;
using P = pair<int,int>;
struct Edge{
int to;
ll cost;
Edge(int to,ll cost):to(to),cost(cost){}
};
using Graph = vecto... | ALGO | 0.999938 | 4.356966 |
bc65d6ac-0422-4ac3-b257-3652df42df2c | st-george-s-programming-club/CCC-Senior-Solutions-Archive | 2016 Senior/2016S4.cpp | // Created by Davidia on 2018-12-17.
//
#include <bits/stdc++.h>
using namespace std;
void print_matrix(vector<vector<int>> matrix){
for (int i = 0; i < matrix.size(); i++){
for (int j =0; j < matrix.at(i).size(); j++){
cout << matrix.at(i).at(j) << ' ';
}
cout << '\n';
}
}... | ALGO | 0.99994 | 4.677755 |
ebed993d-c750-498e-b329-c056ee270af8 | nenuon/CompetitiveProgramming | Atcoder/ABC043/C.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
#define ll long long
#define PI acos(-1.0)
#defi... | ALGO | 0.99916 | 4.027152 |
e1596667-d422-410f-9a29-e0ca6c35f760 | roeas/GAMES101-Premake | Frame/Source/ThirdParty/opencv/modules/dnn/src/ocl4dnn/src/ocl4dnn_pool.cpp | #include "../../precomp.hpp"
#include <string>
#include <vector>
#include "../include/common.hpp"
#include "../include/ocl4dnn.hpp"
#include "opencl_kernels_dnn.hpp"
namespace cv { namespace dnn { namespace ocl4dnn {
template<typename Dtype>
OCL4DNNPool<Dtype>::OCL4DNNPool(OCL4DNNPoolConfig config)
{
int dims = co... | TOOL | 0.951385 | 6.664497 |
2e928128-1831-41e4-981c-ffd8200769f2 | nikez/android_frameworks_base | media/libstagefright/codecs/mp3dec/src/pvmp3_poly_phase_synthesis.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_poly_phase_synthesis.cpp
Date: 09/21/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-----------... | ALGO | 0.999154 | 4.507547 |
637a2abb-5187-404d-ab62-28d76116f740 | tak-ka3/rvv-llvm-project | clang-tools-extra/clangd/ConfigYAML.cpp | namespace clang {
namespace clangd {
namespace config {
namespace {
using llvm::yaml::BlockScalarNode;
using llvm::yaml::MappingNode;
using llvm::yaml::Node;
using llvm::yaml::ScalarNode;
using llvm::yaml::SequenceNode;
llvm::Optional<llvm::StringRef>
bestGuess(llvm::StringRef Search,
llvm::ArrayRef<llvm::St... | TOOL | 0.964358 | 7.068472 |
b6d7116d-2e69-42f5-8071-352e22d12a58 | PranjalAgni/210DaysLeetCode | day-140.cpp | /*
Numbers With Same Consecutive Differences
Return all non-negative integers of length N such that the absolute difference
between every two consecutive digits is K.
Note that every number in the answer must not have leading zeros except for the
number 0 itself. For example, 01 has one leading zero and is invalid,... | ALGO | 0.999767 | 7.185482 |
cff081f4-a070-4698-9059-8e9944340085 | tpkowastaken/Algoritms-CPP | algorithms/string exchange/iteration/main.cpp | #include <iostream>
#include <string.h>
using namespace std;
int *dafield;
int wordSize1, wordSize2;
string word1, word2;
int getFieldNum(int i){
int value1 = dafield[i+1]; //right from the current checking num
int value2 = dafield[i+wordSize2]; //down one
int value3 = dafield[i+wordSize2+1]; // diagonal do... | ALGO | 0.999997 | 3.732138 |
85a520c6-0358-4277-a3b8-b550b71e4ca1 | EasyDae/CodeTest | BOJ/01XXX/01011.cpp | //https://www.acmicpc.net/problem/1011
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t; cin >> t;
while (t--)
{
long long x, y; cin >> x >> y;
long long dist = y - x;
double... | ALGO | 0.999978 | 4.808453 |
e6acc4a5-2906-4c8a-9a13-797c434f71f2 | Shayan-codingways/c- | lab 10/tasks/task3.cpp | #include <iostream>
#include <list>
#include<unordered_map>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
// Declare a list of integers
list<int> myList;
unordered_map<int, int> record;
int n;
cout<<"number of inputs ";
cin>>n;
cout<<endl;
int num;
for(int i=0; i<n; i++){
cin>>num;
... | ALGO | 0.99983 | 5.355992 |
28e20a63-d1f4-4846-8eb7-6f07dc225150 | Scofyyy/leetcode | leetcode/34_元素第一个和最后一个位置.cpp | #include <vector>
using namespace std;
class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
vector<int> res{-1,-1};
int j = nums.size()-1;
for(int i=0;i<nums.size();i++)
{
if(nums[i]==target)
{
for(;j>=i;j--)
... | ALGO | 0.999971 | 6.064366 |
7287c862-6a72-4cf8-ba4c-84b39e1057d5 | hikigaya113/leet_code | Find the median - GFG/find-the-median.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
public:
int find_median(vector<int> v)
{
// Code here.
int n=v.size();
int i=0;
sort(v.begin(),v.end());
if(n%2==0)
return (v[n/2]+v[(n/2)-1])/2;... | ALGO | 0.999938 | 6.439369 |
9803255d-04b4-49a8-b087-af7a496fedb6 | omprakash111/cpp-basic | sum_Firstn.cpp | #include<iostream>
using namespace std;
int main()
{
int num,i,sum=0;
cout <<"Enter the number for sum first natural number"<<endl;
cin>>num;
for(i=1;i<=num;i++)
{
sum=sum+i;
}
cout<<"sum of first natural number till "<<num<<" = "<<sum<<endl;
return 0;
}
| ALGO | 0.984065 | 3.032685 |
42732d9e-8df8-4b5c-9e21-9b2fd964e241 | nafi103/Solved-Problems | Practice/2024/F_Range_Update_Point_Query.cpp | #include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
/********************************Macros********************************/
#define mod 1000000007
#define pb push_back
#define inf 0x3f3f3f3f
#de... | ALGO | 0.999976 | 5.079722 |
c5d99684-37d0-4318-9a1c-c181f1b945e8 | Divyanshu03chauhan103/LeetCode | 1350-remove-sub-folders-from-the-filesystem/remove-sub-folders-from-the-filesystem.cpp | class Solution {
public:
vector<string> removeSubfolders(vector<string>& folder) {
sort(folder.begin(),folder.end());
int n=folder.size();
int i=0;
while(i<n && folder[i]=="/") i++;
if(i>=n) return {};
vector<string>result;
result.push_back(folder[i]);... | ALGO | 0.997622 | 4.874159 |
0ddf781b-25dc-4211-8d72-4b49f52890f8 | cyrilggg/ACM | problem/Daily/2022/7/13/P3917.cpp | #include <bits/stdc++.h>
using namespace std;
#define returnNo return void(puts("No"))
#define returnYes return void(puts("Yes"))
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p)
{
return os << '(' << p.first << ", " << p.second << ')';
}
template <typename T_container, type... | ALGO | 0.999937 | 4.466927 |
a8bca49b-3fdf-432e-91f0-018efad1eb34 | RWTH-HPC/must-rma-correctness22-supplemental | must_rma/src/modules/Callpath/util/string_utils.cpp | using namespace std;
namespace stringutils {
void split(const string& str, const string& delim, vector<string>& parts) {
size_t start, end = 0;
while (end < str.size()) {
start = end;
while (start < str.size() && (delim.find(str[start]) != string::npos))
start++; // skip initial whi... | TOOL | 0.938346 | 6.685614 |
27bab13c-7f3f-459e-a254-005f36504180 | sslab-gatech/juxta | analyzer/libs/z3/src/api/api_solver_old.cpp | #include<iostream>
#include"z3.h"
#include"api_log_macros.h"
#include"api_context.h"
#include"api_model.h"
#include"cancel_eh.h"
extern "C" {
void Z3_API Z3_push(Z3_context c) {
Z3_TRY;
LOG_Z3_push(c);
RESET_ERROR_CODE();
CHECK_SEARCHING(c);
mk_c(c)->push();
Z3_CATC... | TOOL | 0.89165 | 6.045949 |
1f14c491-bdd7-481c-9172-5814ff2c2ddb | nono19972020/atcoder | ABC/ABC010/b.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main(){
long long n;
cin >> n;
long long a[n];
for(long long i = 0; i < n; i++){
cin >> a[i];
}
long long count = 0;
for(long long i = 0; i < n; i++){
if(a[i] % 6 == 2) count++;
else if(a[i] % 6 == 4) co... | ALGO | 0.99991 | 3.393376 |
2bcae0a7-1e28-41b2-838d-897f35ef8a32 | Tetsu-is/neet-code | array_and_hashing/top_k_frequent_elements.cpp | #include <vector>
#include <iostream>
#include <map>
using namespace std;
class Solution
{
public:
vector<int> topKFrequent(vector<int> &nums, int k)
{
map<int, int> num_freq;
for (auto &n : nums)
{
num_freq[n]++;
}
vector<pair<int, int>> freq_vec(num_freq.be... | ALGO | 0.999985 | 5.72368 |
d2dcea8a-131b-4fb2-84c1-cab01382295e | havlenapetr/android_frameworks_base | libs/androidfw/VelocityTracker.cpp | #define LOG_TAG "VelocityTracker"
//#define LOG_NDEBUG 0
// Log debug messages about velocity tracking.
#define DEBUG_VELOCITY 0
// Log debug messages about the progress of the algorithm itself.
#define DEBUG_STRATEGY 0
#include <math.h>
#include <limits.h>
#include <androidfw/VelocityTracker.h>
#include <utils/Bit... | TOOL | 0.961196 | 7.094225 |
2eb16854-4aea-4750-8a2b-7e2f883b6da8 | itohdak/AtCoder | others/Code_Festival/2014_qualB/B.cpp | #include <bits/stdc++.h>
#include "/home/itohdak/AtCoder/000/print.hpp"
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll... | ALGO | 0.999887 | 5.059268 |
313d0ae0-e06a-4a39-9729-e4ac36423a96 | ayk-dev/CppFundamentals | ExamPrep/Problem1/Problem1.cpp | #include <iostream>
#include <sstream>
#include <string>
using namespace std;
const size_t maxSize = 100;
int main()
{
char inpString[maxSize+1];
cin >> inpString;
string alphabet("abcdefghijklmnopqrstuvwxyz");
for (int idx = 0; inpString[idx] != 0; idx++) {
char letter = inpString[idx]... | ALGO | 0.992194 | 4.708402 |
b028d6fb-750d-4d9b-b00e-401d04cc64d2 | delowarsikder/Coding-Ground | Online Judge solution/codeForces/A. Puzzles.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll n,m;
cin>>n>>m;
vector<ll>arr(m);
for(int i=0;i<m;i++){
cin>>arr[i];
}
sort(arr.begin(),arr.end());
ll ans=INT_MAX;
for(int i=0;i<=m-n;i++){
ans=min(ans,abs(arr[i]-arr[n-1+i]));
}
... | ALGO | 0.999991 | 4.021119 |
7db513a4-1b5d-45e8-9cc4-221877c7c6df | ch1ch/Happy-Zoo | Happy Zoo/libs/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp | #include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Point-to-point constraint
// C = p2 - p1
// Cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-I -r1_skew I r2_skew ]
// Identity used:
// w k % (rx i + ry j) = w * (-r... | ALGO | 0.986983 | 7.741631 |
bbe5802c-3e79-4864-95ec-db45022a36cb | TheJP/algorithms | uva/10158War/war.cpp | #include <iostream>
#include <set>
using namespace std;
const int Max = 10000;
const int Count = Max + 5;
class Party {
public:
set<int> members;
set<Party*> enemies;
bool isEnemy(Party * party) {
return enemies.find(party) != enemies.end();
};
};
Party* persons[Count... | ALGO | 0.999741 | 4.111129 |
f0e1f513-a164-47a6-9361-a77187c56a33 | emanlaicepsa/codes | toi2019pB.cpp | #include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);
#define fi first
#define se second
#define reset(n,k) memset((n),k,sizeof(n))
#define all(n) n.begin(),n.end()
#define pb push_back
using namespace std;
using ll=long long;
using pii=pair<ll,ll>;
pii extgcd(ll a,ll b){
if(b==0)return {1,0};
... | ALGO | 0.99996 | 3.435426 |
bf044570-50cf-491e-a719-4f27afd4a50c | ishandutta2007/codeforces | gtrhetr/normal/1314/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 998244353LL
ll f[2050][2050],g[2050][2050],sum[2050];
int n,K;
inline int rd()
{
int x=0;char ch=getchar();
for (;ch<'0'||ch>'9';ch=getchar());
for (;ch>='0'&&ch<='9';ch=getchar()) x=x*10+ch-'0';
return x;
}
inline ll pls(const ll &x,c... | ALGO | 0.999785 | 3.794175 |
059c952e-f065-423f-896f-3992087d1356 | tukaramkangude13/dsa-Problem-and-Many-More | pallindrome of the string.cpp | #include<iostream>
#include<strings.h>
using namespace std;
int main()
{
/* string senttence="hello ji kaise hai sare ";
string target="hello";
cout<<senttence.find(target);*/
string senttence="hello ji kaise hai sare ";
string word="hello";
str.replace(0,4,word);
char a[10],b[10];
cin.getline(a,10);
int... | ALGO | 0.999471 | 3.124905 |
8d16eaaf-1b11-45ae-b662-bf7cebe0c314 | KINHYEONJI/mad-algorithm | AUGUST/KINHYEONJI/BOJ2609.cpp | #include <iostream>
using namespace std;
int main(void)
{
int a, b;
cin >> a >> b;
int gcm, lcm;
for (int i = 1; i < min(a, b) + 1; i++)
{
if (a % i == 0 && b % i == 0)
gcm = i;
}
for (int i = min(a, b); i < a * b + 1; i++)
{
if (i % a == 0 && i % b == 0)
... | ALGO | 0.999893 | 4.322863 |
af3da1fe-1a81-4bf0-b584-aa6cba884a52 | Moin529/My-Codes | Linked List/DoublyLL.cpp | #include <iostream>
using namespace std;
struct ll
{
struct node
{
int value;
node *next;
node *prev;
};
node *head = NULL;
node *tail = NULL;
int insertFirst(int v)
{
node *newnode = new node();
newnode->value = v;
newnode->next = NULL;
... | ALGO | 0.999822 | 4.299008 |
17d85543-926a-4ff3-9a89-dcaf1ac2549a | yuri2078/yuri | leetcode/515.在每个树行中找最大值.cpp | /*
* @lc app=leetcode.cn id=515 lang=cpp
*
* [515] 在每个树行中找最大值
*/
// @lc code=start
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 ... | ALGO | 0.999989 | 6.649255 |
f4acef91-e511-4c95-9909-67bc436a7e50 | Yesh2344/4bitadder | source/FourBitAdder/intern/HalfAdder.cpp |
#include "HalfAdder.h"
HALFADDER::HALFADDER(const unsigned short int id)
{
m_strID = std::to_string(id) + "HALFADDER";
andGate = new AND(id);
nandGate = new NAND(id);
orGate = new OR(id);
m_usiIn1 = 0;
m_usiIn2 = 0;
m_sum = 0;
m_carry = 0;
}
void HALFADDER::setInput(const unsigned short int val1, const uns... | TOOL | 0.860106 | 5.787014 |
6791294a-378b-4d2b-947e-171381834d15 | hoangDEVteams/Home-Work-DSA | Domino piling.cpp | #include <iostream>
using namespace std;
int main() {
int m, n;
cin >> m >> n;
int floor = (m * n) / 2;
cout << floor << endl;
} | ALGO | 0.999649 | 3.860144 |
ead9039e-4f34-4a6a-9d4a-58095c5fb66a | someblue/ACM | ScauOJ/doeveryday/1209-div/main.cpp | #include <iostream>
#include <cstdio>
#define N 210
using namespace std;
char s[N];
int main()
{
int T,Ti,i;
long long div,bediv;
scanf("%d",&T);
for(Ti=1;Ti<=T;Ti++)
{
scanf("%s%I64d",s,&div);
if(div<0)div=-div;
bediv=0;
if(s[0]=='-') i=1;
else i=0;
... | ALGO | 0.993669 | 3.13426 |
550be466-e913-4ea4-ab89-b17eeeb04136 | thaongo95/Cpp_practive_vscode | function_pointer/main.cpp | #include <iostream>
#include <string>
#include <vector>
template<int num>
char shiftLeft(const int& value){
return (char)(value+num);
}
void changeSeries(const std::vector<char>& values, char (*func)(const int&)){
for (auto value:values){
std::cout << func(int(value)) << " ";
}
std::cout << st... | ALGO | 0.997291 | 5.181537 |
24c70297-ab74-4838-9749-f6c0a075a975 | CodeBySushant/SolvedLeetcode | leetcode-main/leetcode-main/lcp/LCP 67. 装饰树/Solution.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.999964 | 6.307571 |
cfd458df-ee2c-42c4-b480-e7761a712535 | repos-cl/NumCSE | Assignments/PolishedCodes/NumericalQuadrature/EffQuadSingInt/template/main.cpp | #include <iostream>
#include "quadsingint.hpp"
///
/// Minimal runner for tasks (8-9.c) and (8-9.e)
///
int main() {
auto f = [](double t) { return 1. / (2. + std::exp(3 * t)); };
std::cout << "Integrating 1. / (2. + std::exp(3*t)): " << quadsingint(f, 25)
<< "; should give " << 0.483296828976607 <<... | ALGO | 0.987863 | 6.025938 |
f4d7ed6c-4fea-4d6e-b5b8-984a76987c95 | CodeToLearnScience/2d_shallow_water | src/diss_movers_h2_conv.cpp | #include "global_declarations.h"
#include "basic_functions.h"
template <typename T>
T Movers(T Fr, T Fl, T Ur,T Ul,T L_max, T L_min);
template <typename T>
T MaxEigVal(T ur, T ul, T vr, T vl, T ar, T al, T nx, T ny);
template <typename T>
T MinEigVal(T ur, T ul, T vr, T vl, T ar, T al, T nx, T ny);
template <typena... | ALGO | 0.999916 | 4.591713 |
ab740966-e58d-4c76-ab34-1c979c75643e | L0vOJ/maze_project | maze_frame_2/maze_member.cpp | #include<iostream>
#include <cstdlib>
#include <cstring>
#include <string>
#include <math.h>
#include <ctime> //C++
#include "main_frame.h"
using namespace std;
#define up field[y-1][x]
#define down field[y+1][x]
#define left field[y][x-1]
#define right field[y][x+1]
#define me field[y][x]
#define ct_wall_width ((wi... | ALGO | 0.946187 | 3.237875 |
8a8331ed-bfcb-49d5-b370-f4ff7a59f5a4 | ImPiyushK/CompetitiveProgramming | Codeforces/2000-2100/2050C.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
string n;
cin >> n;
int sum = 0;
int cnt_2 = 0, cnt_3 = 0;
for (char c : n)
{
int digit = c - '0';
sum += digit;
if (digit == 2)
cnt_2++;
if (digit == 3)
cnt_3++;
}
in... | ALGO | 0.999778 | 5.529251 |
16c5b3cc-82e9-42aa-bb3e-db7da9e5756b | Bharatbardiya/my-leetcode-solutions | 0863-sum-of-distances-in-tree/0863-sum-of-distances-in-tree.cpp | class Solution {
public:
pair<int,int>dfs(vector<vector<int>>&adj, int src, int pr, vector<pair<int,int>>&dp){
pair<int,int> ans = {0,1};
for(auto u : adj[src]){
if(u!=pr){
pair<int,int> pr = dfs(adj, u, src, dp);
ans.first += (pr.first+pr.second)... | ALGO | 0.999992 | 5.281445 |
f2ee82bc-295b-4af3-a1f7-dc1bc99a6feb | riddhi2000/Competitive-programming | codechef/CGEEK03.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t,n,m;
cin >> t;
while(t--){
cin >> n >> m;
vector<int> a(n);
for(int i=0;i<n;i++)
cin >> a[i];
sort(a.begin(),a.end());
int i=0,j=n-1;
while(i<j){
if(a[i]+a[j]>m)
j--;
else if(a[i]+a[j] < m)
i++;
else
break;
}
... | ALGO | 0.999955 | 4.485471 |
1b9652ec-421b-44ee-9ef3-b5220a4d8f8b | tushar854rawat/LeetCode | 1330-longest-arithmetic-subsequence-of-given-difference/1330-longest-arithmetic-subsequence-of-given-difference.cpp | class Solution {
public:
int longestSubsequence(vector<int>& arr, int d) {
int n = arr.size();
unordered_map<int,int>dp;
int ans = 0;
for(int i=0;i<n;i++){
int temp = arr[i]-(d);
int res = 0;
if(dp.find(temp)!=dp.end()){
res = dp[t... | ALGO | 0.999933 | 6.065356 |
95fd4b69-b4c7-478a-b22a-81b43ad1e1e2 | VinayDhaddha/Data-Structure-and-Algorithm | Interview_Bit/Two Pointers/Remove_Element_from_Array.cpp | int Solution::removeElement(vector<int> &A, int B) {
// Do not write main() function.
// Do not read input, instead use the arguments to the function.
// Do not print the output, instead return values as specified
// Still have a doubt. Checkout www.interviewbit.com/pages/sample_codes/ for more details
... | ALGO | 0.999759 | 5.151235 |
dee107d0-2a79-4067-a9de-ad62e8938daf | hieunguyenm/coderetreat2 | cpp/CodeRetreat.cpp | #include <algorithm>
#include <vector>
#include <string>
class CodeRetreat {
public:
static bool is_palindrome(std::string a) {
std::string b = a;
std::reverse(b.begin(), b.end());
return a.compare(b) == 0;
}
static int find_min(std::vector<int>& a) {
if (a.size() == 0) {
... | ALGO | 0.999804 | 5.501214 |
bae61040-0288-4a95-b57d-294866a15c18 | FutureYL3/algorithm_learning | syntax_basic/Lec04/741.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main() {
long Fib[60];
Fib[0] = 0; Fib[1] = 1;
for (int i = 2; i < 60; ++i)
Fib[i] = Fib[i-1] + Fib[i-2];
int n; cin >> n;
for (int i = 0; i < n; ++i) {
int index; cin >> index;
... | ALGO | 0.999288 | 4.205761 |
347490af-3a60-4325-9546-89f0c640f630 | Habanossi/kdeconnect-desktop2 | plugins/ping/fingerprinter/calculations.cpp | #include <iostream>
#include <stdlib.h>
#include <QFile>
#include <QTextStream>
#include <QDebug>
#include <vector>
#include <QString>
#include "string.h"
#include <fftw3.h>
#include <Eigen/Core>
#include <limits>
using namespace std;
void calculations(Eigen::MatrixXd frameMatrix, QString outputfile, QString energyfi... | ALGO | 0.985174 | 3.386587 |
53322136-5158-4145-a18d-b0dbc2e59629 | MPEGGroup/HapticReferenceSoftware | source/WaveletDecoder/src/WaveletDecoder.cpp | #include "../include/WaveletDecoder.h"
namespace haptics::waveletdecoder {
auto WaveletDecoder::decodeBand(Band &band, int timescale) -> std::vector<double> {
if (band.getBandType() != BandType::WaveletWave || !band.getBlockLength().has_value()) {
return std::vector<double>();
}
size_t numBlocks = band.getE... | TOOL | 0.923427 | 6.683273 |
8c3217c0-5bf4-42f3-b273-71ff721f1e8e | Teafox-Yang/GAMES202_HW_TEAFOX | 2.Environment Lighting-PRT/prt/ext/openexr/IlmBase/Imath/ImathRandom.cpp | //-----------------------------------------------------------------------------
//
// Routines that generate pseudo-random numbers compatible
// with the standard erand48(), nrand48(), etc. functions.
//
//-----------------------------------------------------------------------------
#include "ImathRandom.h"
#include "... | ALGO | 0.988857 | 5.511621 |
84518cc7-9c5f-4ff4-b648-5c14addfe785 | chengyiwei/algorithm | CDJCC_ACM/Sakura Tears training #1/A/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 0x3f3f3f3f3f3f3f3f;
int main() {
freopen ("A.in", "r", stdin);
ios::sync_with_stdio(false);
int N, D; ll P; cin >> N >> D >> P;
ll ans = inf;
vector<ll> A(N + 1), S(N + 2, 0);
for (int i = 1; i <= N; i++) {cin >> ... | ALGO | 0.999913 | 3.589572 |
90ce6e33-fd8f-4788-bad4-6ab04f39cc5e | tar3q-az1z/Codeforces-solutions | 2009A.cpp | // @Author: Mars_Coder
// @date: 10-10-2024 Thu 10:19 AM
// https://codeforces.com/problemset/problem/2009/A
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using i64 = long long int;
using uInt = unsigned int;
using... | ALGO | 0.99972 | 4.929172 |
45ccf747-0ee5-48cd-8fbb-c49c03e1f028 | AlexGeControl/Auto-Car-03-SLAM-00-Algorithms | 02-kinematics-in-3d-space/workspace/Eigen/unsupported/doc/examples/BVH_Example.cpp | #include <Eigen/StdVector>
#include <unsupported/Eigen/BVH>
#include <iostream>
using namespace Eigen;
typedef AlignedBox<double, 2> Box2d;
namespace Eigen {
Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point
}
struct PointPointMinimizer //how to compute squa... | ALGO | 0.999829 | 6.502348 |
ef77f0e7-353d-4966-bec2-d1d9dfe125f3 | sanjiv0286/CP-Daily-Practice-Problems | CodeChef_Streak.cpp | // DATE: 14-06-2023
// TIME: 20-13-38
#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
#define ll long long
#define all(a) a.begin(), a.end()
#define forn(i, n) for (ll i = 0; i < n; i++)
#define rep(i, a, b) for (ll i = a; i <= b; i++)
#define dep(i, b, a) for (ll i = b; i >= a; i--)
#define p... | ALGO | 0.999935 | 4.981111 |
f1e1b384-f8ce-415e-9c98-3924d06259c7 | lcls-psana/ImgAlgos | src/AlgImgProc.cpp | //--------------------------------------------------------------------------
// File and Version Information:
// $Id$
//
// Description:
// Class AlgImgProc
//
// Author List:
// Mikhail S. Dubrovin
//
//------------------------------------------------------------------------
//-----------------------
// This Cl... | ALGO | 0.995339 | 4.670063 |
e898dea3-fa95-4511-a0e2-2d0678d62712 | ishandutta2007/codeforces | yzc2005/normal/1428/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, k, a[N];
long long ans;
struct node {
int x, y;
long long z;
inline bool operator < (const node &rhs) const {
return z < rhs.z;
}
};
priority_queue<node> q;
inline long long calc(int x, int y) {
int z = x / y, r = x % y;
return 1... | ALGO | 0.999936 | 3.733845 |
c5d9109d-e7ff-4152-b4d6-f54bf828ad06 | sarvex/leetcode-cyber | solution/2400-2499/2436.Minimum Split Into Subarrays With GCD Greater Than One/Solution.cpp | class Solution {
public:
int minimumSplits(vector<int>& nums) {
int ans = 1, g = 0;
for (int x : nums) {
g = gcd(g, x);
if (g == 1) {
++ans;
g = x;
}
}
return ans;
}
}; | ALGO | 0.999971 | 5.867231 |
f37994e8-a364-47e2-b768-f2919504d4ee | Darkness141/codingground | New Project-20160806/root.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a, b, c;
double x1, x2;
cout << "Enter the value of a, b, c ";
cin >> a >> b >> c;
if ((b*b-4*a*c)<0){
cout << "no root" << endl;
} else if((b*b-4*a*c)>0){
x1 = (-b+sqrt(b*b-4*a*c))/(2*a);
x2 = ... | ALGO | 0.999714 | 3.850398 |
877722ba-8584-47b7-955f-b96d3ae629b0 | raincross7/code-similarity | codes/train_code/problem038/problem038_106.cpp | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i... | ALGO | 0.999743 | 4.079915 |
a52cc36a-13d5-4555-a774-4d0811afcf4e | MichaelPei2003/MyOwnProjects | C++/Others/11.7 web/szy的投票/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void)
{
long long m,n,t,i,j;
cin>>m>>n;
long long a[m]={0};
for(i=1;i<=n;i++)
{
cin>>t;
a[t-1]++;
}
long long top=0;
t=0;
for(i=0;i<m;i++)
{
if(a[i]>=n/2){t=i+1;}
}
if(t!=0){cout<<t;}
els... | ALGO | 0.999903 | 4.320869 |
28e43fbc-a7ae-4496-8333-ee6bcc3502d0 | tamnekbl/c---tasks | 4.cpp | #include <chrono>
#include <thread>
#include <algorithm>
#include <iostream>
#include <mutex>
#include <vector>
#include <windows.h>
#include <random>
std::vector<std::mutex*> forkEvents;
void Delay()
{
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> dist(1000, 1010);
Sl... | TOOL | 0.93559 | 3.723381 |
2b6645a2-62bc-4086-8052-af8ae8a95f7a | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10524_7.cpp | #include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, e, ans = 1, zf;
int main() {
cin >> a >> b >> c >> d >> e;
zf = b + c + d + e;
for (int s = 1; s < a; s++) {
cin >> b >> c >> d >> e;
if (zf < b + c + d + e) ans++;
}
cout << ans << endl;
}
| ALGO | 0.999795 | 3.509742 |
f1b819ff-4738-4140-8c3c-8e88c5c2d009 | luqmanarifin/cp | Codeforces Round #376/c.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int a[N];
vector<int> edge[N];
bool done[N];
set<int> col;
int cnt[N], st;
void dfs(int now) {
if (done[now]) return;
done[now] = 1;
col.insert(a[now]);
cnt[a[now]]++;
st++;
for (auto it : edge[now]) dfs(it);
}
int main() {
int n, ... | ALGO | 0.999913 | 4.306107 |
1b50dd77-9498-439d-b99b-ca0ca74a3d22 | utkarshsp206/100DaysOfCode | Day4/MoveZeros.cpp | //! Leetcode problem: 283. Move Zeroes
#include<bits/stdc++.h>
using namespace std;
void moveZeros(vector<int> &nums){
int left=0;
for(int right=0;right<nums.size();right++){
if(nums[right]!=0){
swap(nums[left],nums[right]);
left++;
}
}
}
int main() {
vector<int> ... | ALGO | 0.999944 | 5.732935 |
87c67bd9-0081-4e5f-bae7-f996531a8969 | njumathdy/code-practice | Leetcode/226_Invert Binary Tree/c++/solution.cpp | /*******************
Invert a binary tree.
*******************/
#include <cstdlib>
#include <cstdio>
#include <exception>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
#include <queue>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeN... | ALGO | 0.999992 | 5.993853 |
82a6e0ca-c76f-4903-ab44-05868ae99304 | NgFEP/NexusMD | NexusMD/core/cuda/src/Forces/force_operators/HarmonicBondForceCudaOp.cpp | //#include "HarmonicBondForceCudaOp.h"
//#include <cuda_runtime.h>
//
//using namespace Cuda;
//using namespace std;
//
//void HarmonicBondForceCudaOp::addForce(CommonForceArgs& ctx)
//{
// /* zero device buffers (forces & PE) that this term is responsible for */
// cudaMemset(dArgs_.d_totalForces, 0, ctx.numAtom... | ALGO | 0.938354 | 6.049125 |
240fb41c-b01a-4f3f-b16e-0eab24215bf9 | TommyW427/TJ-Computer-Vision-1-2 | Convex_Hull/GrahamScan.cpp | //Lab for Computer Vision
//Name: Tommy Williams
//Task: Create a convex hull using Grahams algorithm (Graham Scan)
//Time complexity: O(nlogn);
#include <iostream>
#include <fstream>
#include <math.h>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <list>
#include <string>
#include <chrono>
#incl... | ALGO | 0.999202 | 4.728259 |
fbbb72ef-03c6-4db8-a393-35799fc016bf | shaobozhong/myAcmCodes | 怀化学院程序设计在线/a+b.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,n;
scanf("%d",&n);
while(n--)
{
scanf("%d%d",&a,&b);
printf("%d\n",a+b);
}
return 0;
} | ALGO | 0.99778 | 3.912186 |
dc8907c2-7409-40da-8020-e4dba09cf412 | nillerusr/srcsdk | mathlib/lightdesc.cpp | #include <ssemath.h>
#include <lightdesc.h>
#include "mathlib.h"
void LightDesc_t::RecalculateDerivedValues(void)
{
m_Flags = LIGHTTYPE_OPTIMIZATIONFLAGS_DERIVED_VALUES_CALCED;
if (m_Attenuation0)
m_Flags|=LIGHTTYPE_OPTIMIZATIONFLAGS_HAS_ATTENUATION0;
if (m_Attenuation1)
m_Flags|=LIGHTTYPE_OPTIMIZATIONFLAGS_HAS... | TOOL | 0.90148 | 6.223353 |
73502ed0-db47-4ab5-a157-2fc5d9ad6c2c | Sue217/PracticeCodeFolder | LanQiaoCup/11thprovinceAB/d.cpp | /**
* author: subobo
* created: 01.04.2022 17:34:31
**/
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
long long k... | ALGO | 0.999667 | 3.85919 |
4f869316-f48a-4685-ba58-e2997c0822e5 | imgoodgamerbro/Android_native_surface | my_android_opencv/samples/tapi/camshift.cpp | #include "opencv2/core/utility.hpp"
#include "opencv2/core/ocl.hpp"
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
#include <cctype>
static cv::UMat image;
static bool backprojMode = false;
static bool selectObject... | ALGO | 0.962195 | 6.47593 |
e11e2487-a9c9-4f33-8855-6a532ff524ad | tetrisroyale/a_tetrisroyale_godot_3.1 | servers/physics_2d/joints_2d_sw.cpp | /*************************************************************************/
/* joints_2d_sw.cpp */
/*************************************************************************/
/* This file is part of: */
/* ... | ALGO | 0.973686 | 6.414386 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.