uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
33163e89-69a0-4baa-a3de-2c982b0dabc6 | nkrishnan94/3D-Eden-Model | 3D_eden_cpp/3D_eden_standard.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <math.h>
#include <sstream>
#include <string>
#include <unistd.h>
#include <array>
#include <vector>
#include <random>
#include <ctime>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
const int xdemes = 500;
const int ydemes = 500;
const int zde... | ALGO | 0.998603 | 3.237442 |
ed42727a-e0bb-42ff-9128-0bd3dca159ba | YouRyuu/CPNPbiubiubiu | LeetCode/leetcode128.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
int len = nums.size();
if(len==0) return 0;
sort(nums.begin(), nums.end());
vector<int> dp(len);
dp[0] = 1;
for(int i=1; i<len; ++i)
{
if(nums[i]==nums[i-1])
dp[i... | ALGO | 0.999956 | 5.670749 |
33ef24cd-ab63-4f3a-9dcf-4d39c37f4eff | heyankit78/6Companies30Days | Microsoft/Prerequisite Tasks.cpp | class Solution {
public:
bool isPossible(int num, vector<pair<int, int> >& preq) {
// Code here
vector<vector<int>>adj(num);
vector<int>indeg(num,0);
queue<int>q;
for(auto a: preq){
adj[a.second].push_back(a.first);
indeg[a.first]++;
}
... | ALGO | 0.999923 | 5.308928 |
37d4c66d-354d-4ff6-af31-e5612b7d1253 | LChanwoo/backjoon_practice | cpp/p10815.cpp | #include<iostream>
#include<map>
using namespace std;
int n, m, tmp;
map<int,int> mp;
int main(){
ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
cin >> n;
for(int i=0;i<n;i++) cin >> tmp, mp[tmp]++;
cin >> m;
for(int i=0;i<m;i++) cin >> tmp, cout << mp[tmp] << ' ';
return 0;
} | ALGO | 0.999863 | 3.508535 |
2e283488-8c50-40ba-b200-3e3fff3c8d69 | iagozag/competitive_programming | contests/cf/gym/101401/f.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define rep(i,x,n) for(auto i=x;i<n;i++)
#define repr(i,n,x) for(auto i=n;i>=x;i--)
#define forr(x, v) for(auto& x: v)
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a.size())
#define endl '\n'
#define ff first
... | ALGO | 0.99998 | 4.235256 |
f247495b-c521-4d6a-bb70-d67981a3d021 | bitnetcrypto/BItnet | src/stealth.cpp | #include "stealth.h"
#include "base58.h"
#include <openssl/rand.h>
#include <openssl/ec.h>
#include <openssl/ecdsa.h>
#include <openssl/obj_mac.h>
//const uint8_t stealth_version_byte = 0x2a;
const uint8_t stealth_version_byte = 0x28;
bool CStealthAddress::SetEncoded(const std::string& encodedAddress)
{
data_chu... | TOOL | 0.902946 | 6.022294 |
4148c841-eed7-4a10-ba2b-f632ed7f1b62 | idsyr/leetcode | 2022.03.23_#9_palindrome_number.cpp | class Solution {
public:
bool isPalindrome(int x) {
if(x<0)
return false;
long int reverse = 0;
int def_x = x;
while(x!=0)
{
reverse*=10;
reverse += x%10;
x/=10;
}
if(def_x == reverse)
return true;
else
return false;
}
}; | ALGO | 0.999944 | 5.861201 |
553e7c5f-b46d-47f3-a14c-8f9b19a25300 | hxzinh/VOI | NUMBERSPIRAL/main.cpp | #include <bits/stdc++.h>
#define ll long long
#define INF 1e9
#define FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
template<class X, class Y>
inline bool maximize(X &x, const Y &y) {return (x < y ? x = y, 1 : 0);}
template<class X, class Y>
inline bool minimize(X &x, const Y &y... | ALGO | 0.999844 | 4.73657 |
1bb178a5-8cb5-4e3c-a1e1-cd6891f504d1 | WadekarPrashant/GeeksForGeeks-Questions | POTD/8oct.cpp | class Solution {
public:
Node* sortedInsert(Node* head, int val) {
Node* temp = head;
if (temp->data >= val) {
Node* add = new Node(val);
add->next = head;
return add;
}
else {
Node* temp1 = head;
bool flag = true;
... | ALGO | 0.999994 | 5.619455 |
61be4db2-7f11-4024-acc3-ed797da09c47 | sarvex/leetcode-julia | solution/2500-2599/2544.Alternating Digit Sum/Solution.cpp | class Solution {
public:
int alternateDigitSum(int n) {
int ans = 0, sign = 1;
for (char c : to_string(n)) {
int x = c - '0';
ans += sign * x;
sign *= -1;
}
return ans;
}
}; | ALGO | 0.999978 | 6.337138 |
979e8a0b-463f-44eb-8535-e35714bde55b | ImShubhK/CPP-Leetcode | C++/1295. Find Numbers with Even Number of Digits.cpp | class Solution {
public:
int findNumbers(vector<int>& nums) {
int n=nums.size();
int ans = 0;
for (int i = 0; i < n; i++)
{
int count = 0;
int k = nums[i];
while (k > 0)
{
k = k / 10;
count++;
}
if (count % 2 == 0)
... | ALGO | 0.99956 | 5.895126 |
c3bc9cb6-6482-4ed1-8076-bab2049c45c8 | Xaunther/AdventOfCode | 2020/day17/day17.cpp | //To solve day 17 puzzle
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <array>
//Bounds of our 3D space, it marks where the outermost cubes might possibly be
using Bounds = std::vector<std::pair<int32_t, int32_t>>;
//Cubes: coordinates and state
using Cube = std::pa... | ALGO | 0.999102 | 5.17883 |
f606844b-3e66-4704-a87f-39274da3bf6c | NilsonCesar/cp_solutions | atcoder/abc_410/a.cpp | #include <bits/stdc++.h>
using namespace std;
void mainIO(string s = "") {
cin.tie(NULL); ios_base::sync_with_stdio(false);
if(s.size()) {
freopen((s + ".in").c_str(), "r", stdin);
freopen((s + ".out").c_str(), "w", stdout);
}
}
int main(void) {
mainIO();
int n, k, ans = 0;
cin... | ALGO | 0.999956 | 4.314374 |
3f1aa23c-7f97-4696-94bb-db1a1f9fa569 | allydev/android_frameworks_base | media/libstagefright/codecs/amrnb/enc/src/cor_h_x.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include "typedef.h"
#include "cnst.h"
#include "cor_h_x.h"
#include "basic_op.h"
/*------------------------------------------------------------------... | ALGO | 0.999932 | 4.849229 |
2f455b78-6e9b-4432-a612-846d17ba36ff | vonJOKER/2023guosai | ssc-solarpilot_v1.3.1/shared/lib_pv_shade_loss_mpp.cpp | #include "lib_pv_shade_loss_mpp.h"
#include <functional> // std::greater
#include <algorithm> // std::sort
#include <math.h> // logarithm function
#include <cstring> // memcpy
#include "lib_miniz.h" // decompression
#include "DB8_vmpp_impp_uint8_bin.h" // char* of binary compressed file
// define the following t... | ALGO | 0.952637 | 5.111302 |
9c57efd3-663c-4886-bfb8-6c7b7ee803ca | NXIST-backup/algorithm_trans | acwing/acwing175.cpp | /*
Problem Name:电路维修
algorithm tag:双端BFS
*/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int INF = 1e9;
con... | ALGO | 0.999972 | 4.081329 |
5fa764d4-7d00-483d-b2b7-f7e49015925b | justindomke/marbl | main_code/eigen322/doc/examples/Tutorial_BlockOperations_print_block.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(4,4);
m << 1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16;
cout << "Block in the middle" << endl;
cout << m.block<2,2>(1,1) << endl << endl;
for (int i = 1; i <= 3; ++i)
{
cout << "B... | ALGO | 0.988877 | 3.6853 |
63e8cd40-2d63-4c4b-a1a0-839f75036d10 | JustAG7/Competitive_Programming | Training/vk23/F.cpp | #include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL);
#define ll long long
#define pb push_back
#define pf push_front
#define db double
#define X first
#define Y second
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define... | ALGO | 0.999977 | 3.787144 |
45877b22-eb48-4259-82bc-e045db0e889e | wdeyes/Sword_offer | 13/RobotMove.cpp | //==================================================================
// ָOfferԹپͱ⡷
// ߣκ
//==================================================================
// 13˵˶Χ
// Ŀһmnеķһ˴(0, 0)ĸӿʼƶ
// ÿһοҡϡƶһܽλ֮
// kĸӡ磬kΪ18ʱܹ뷽(35, 37)Ϊ3+5+3+7=18
// ܽ뷽(35, 38)Ϊ3+5+3+8=19ʸûܹٸӣ
#include <cstdio>
int movingCountCore(int thresh... | ALGO | 0.998985 | 5.15344 |
2637fc1a-83cc-4878-a5c6-1df472c4e7e3 | aadyasinghh26/C- | stairCaseways_recursion.cpp | #include<iostream>
using namespace std;
int stairCaseways(int n)
{
if (n==0) return 1;
if (n<0) return 0;
return stairCaseways(n-1)+stairCaseways(n-2)+stairCaseways(n-3);
}
int nstairs(int n,int k)
{
if (n==0) return 1;
if (n<0) return 0;
int ans=0;
for (int i=1;i<=k;i++)
{
... | ALGO | 0.999943 | 3.512479 |
0c691657-1155-4fe6-abb8-252d2223efa5 | bolatov/contests | hackerrank.com/service-lane.cpp | #include <iostream>
#include <vector>
#include <cstdio>
#include <cmath>
using namespace std;
/*
* Used RMQ to solve this challenge
* src:
* http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=lowestCommonAncestor#Range_Minimum_Query_%28RMQ%29
*/
void printArray(std::vector<int> &v) {
for (int i :... | ALGO | 0.99999 | 4.85844 |
91aa90ae-3a4f-4265-afee-25ae87e8b544 | RinCloud/TrickCatcher | Datasets/TrickyBugs/GenProgs/dpp_generated_progs_cpp/p03686/p03686_num9_parsed.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<pair<int, int>> ranges(N);
for (int i = 0; i < N; i++) {
cin >> ranges[i].first >> ranges[i].second;
}
sort(ranges.begin(), ranges.end());
... | ALGO | 0.999958 | 4.316468 |
5f8859b5-ff45-44c6-852c-7ee2d6ee5b00 | ishandutta2007/codeforces | krk/normal/1615/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <int, int> ii;
const int Maxn = 200005;
const int Maxm = 1048576;
const ll Inf = 9000000000000000000ll;
int n, k;
ll best[Maxn];
vector <int> neigh[Maxn];
int cur, lef[Maxn], rig[Maxn];
int inlef[Maxn];
ii st[Maxm];
int flag[Maxm];
int ... | ALGO | 0.99987 | 3.907439 |
f9e6a7d9-01a5-4faa-b615-471b2b9abfdd | rt-kill/CompetitiveProgramming | Codeforces/1957/E/main.cpp | #include <bits/stdc++.h>
using namespace std;
/* Macros {{{ */
/* A lot of this is from some of Benq's submissions
[https://codeforces.com/profile/Benq]
Ugly af to the eyes, but with vim fold its barable
Hopefully c++20 concepts can make all this stuff must cleaner */
/* Basics {{{ */
using ll = long lon... | ALGO | 0.999752 | 5.138891 |
a76df94e-0f31-4940-8481-42cc80356f07 | Natanalpe/Beecrowd-solutions | C++/1958.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double a;
cin >> a;
cout << scientific << showpos << setprecision(4) << uppercase << a << endl;
return 0;
} | ALGO | 0.996661 | 3.932864 |
b7dc059c-6808-4392-a814-0fbbdce942a6 | NEWPLAN/OJ | data/suffixarray/multiply.cpp | /////////////////////////////////////////////////////////////////
//Constructing Suffix Array with Doubling Algorithm, O(n log n).
/////////////////////////////////////////////////////////////////
#include <algorithm>//sort
#include <cstring>//memsetusing namespace std;const int MAX_SFX = 210000;struct Sfx {
int i;... | ALGO | 0.9993 | 3.515898 |
19dee816-fab9-495d-9e1c-5f8cd44a13d5 | arenazhong/leetcode-solutions | cpp/0036-valid-sudoku.cpp | /*
Determine if a 9x9 Sudoku board is valid (no repeats)
Boolean matrices to store seen values. Check rows, cols, 3x3 sub-boxes
Time: O(cnt^2)
Space: O(cnt^2)
*/
class Solution {
public:
bool isValidSudoku(vector<vector<char>>& board) {
const int cnt = 9;
bool row[cnt][cnt] = {fal... | ALGO | 0.999358 | 7.211486 |
63696ccc-2884-477e-9426-6b7ec48ab9ba | aomsumita/sumitalab18 | lab18_2.cpp | #include<iostream>
using namespace std;
struct Rect{
double x,y,w,h;
};
double overlap(Rect *R1, Rect *R2){
double sqx1 = (**&R1).w + (**&R1).x;
double sqx2 = (**&R2).w + (**&R2).x;
double sqy1 = (**&R1).y - (**&R1).h;
double sqy2 = (**&R2).y - (**&R2).h;
double side1, side2;
side1 = min(sqx1, sqx2) - max... | ALGO | 0.993062 | 3.423671 |
65968390-88ae-464e-9458-4fd3d105b2e2 | Rahul-Encoded/LeetHub | 2552-maximum-sum-of-distinct-subarrays-with-length-k/2552-maximum-sum-of-distinct-subarrays-with-length-k.cpp | class Solution {
public:
long long maximumSubarraySum(vector<int>& nums, int k) {
int i = 0, j = 0;
long long result = 0;
long long currWindowSum = 0;
unordered_set<int> st;
while (j < nums.size()) {
while (st.find(nums[j]) != st.end()) {
... | ALGO | 0.999961 | 6.169387 |
5d4e1a01-1202-4a21-8d1c-5f7a9ffc5f31 | Tamimkhan7/CP-Course | Phase 1/class seven/contest/GCD vs LCM.cpp | #include <bits/stdc++.h>
using namespace std;
#define MTK \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define mem(a, b) memset(a, b, sizeof(a))
#define trace(x) cout << #x << ' ' << x << endl
#define all(x) (x).begin(), (x).end()
#define ll int long l... | ALGO | 0.999434 | 3.68277 |
15887ea6-3c2f-4178-979f-8de12380787c | anubhawbhalotia/Competitive-Programming | Codeforces/1296E1.cpp | #include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long>> ... | ALGO | 0.999996 | 4.192576 |
7887e296-ff36-4a29-bf64-ff1d921a1ccc | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4335_2.cpp | #include <bits/stdc++.h>
using namespace std;
int n, l, r;
long long p;
long long mod, bs, expo;
pair<long long, long long> gcd(long long a, long long b) {
if (a == 0) {
return make_pair(0, 1);
}
pair<long long, long long> prev = gcd(b % a, a);
return make_pair(prev.second - (b / a) * prev.first, prev.first... | ALGO | 0.999982 | 3.801405 |
48332b65-4964-4e05-8fb9-09515f88456f | ezstefan/leetcode | 1838-frequency-of-the-most-frequent-element/1838-frequency-of-the-most-frequent-element.cpp | class Solution {
public:
int maxFrequency(vector<int>& nums, int k) {
sort(nums.begin(), nums.end());
int maxFreq = 1;
int left = 0;
long long total = 0;
for (int right = 1; right < nums.size(); ++right) {
total += (long long)(nums[right] - nums[right - 1]) * (... | ALGO | 0.999985 | 6.368801 |
ba924069-3389-404b-9718-2db61b046562 | hyemsnail/LeetCode | 0020-valid-parentheses/0020-valid-parentheses.cpp | class Solution {
public:
bool isValid(string s) {
stack<char>st;
for(char c:s){
if(c == '(' || c == '{' || c == '['){
st.push(c);
}
else{
if(st.empty())
return false;
if((c == ')'&& st.top() != '(') ... | ALGO | 0.999307 | 6.259822 |
9f062f06-9d6b-4425-93cc-e2f64249c137 | sagpant/swiftshader | third_party/llvm-10.0/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp | #include "llvm/Transforms/Scalar/InstSimplifyPass.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/An... | TOOL | 0.891067 | 7.85177 |
54a196ee-e526-4a79-9f64-caf2b05ba6b1 | xidianlina/cppprimer | chapter_14_26.cpp | #include <iostream>
#include <string>
#include <memory>
#include <algorithm>
class StrVec
{
friend bool operator==(const StrVec&, const StrVec&);
friend bool operator!=(const StrVec&, const StrVec&);
friend bool operator<(const StrVec&, const StrVec&);
friend bool operator<=(const StrVec&, const StrVec&);
friend ... | TOOL | 0.872099 | 5.47348 |
64ba922e-e238-4199-b431-77ba7ce40d2e | sKAR04/CP-Practice | Codeforces/363/363C.cpp | //Strike me down and I shall become stronger, than you can possibly imagine
//Streak Count : 5
#include <bits/stdc++.h>
using namespace std;
//save time
#define endl '\n'
typedef long long ll;
//for sorting
#define all(a) a.begin(),a.end()
//Constants
#define PI 3.141592653593
#define MOD 1000000007LL
#define EP... | ALGO | 0.999977 | 4.540447 |
d36bb126-45a7-47ce-9faf-c42b9fc60834 | sherin456/leetcode | 0005-longest-palindromic-substring/0005-longest-palindromic-substring.cpp | class Solution {
public:
string longestPalindrome(string s) {
string res="";
for(int i=0;i<s.length();i++)
{
string temp=helper(s,i,i);
if(temp.length()>res.length())
{
res=temp;
}
temp=helper(s,i,i+1);
i... | ALGO | 0.999979 | 6.091453 |
2fb7890d-ade6-43d7-99c2-ae0d76157625 | Baobaobear/sort | demo.cpp | // filename: demo.cpp
// author: baobaobear
// create date: 2019-09-20
#include "sortlib.hpp"
#include "sorttest.hpp"
#include <vector>
#include <functional>
#include <cstdio>
template<class RandomAccessIterator, class Comp>
bool check_sorted(RandomAccessIterator beg, RandomAccessIterator end, Comp compare)
{... | TEST | 0.987241 | 5.689528 |
4131ab67-01ed-48a0-b1e5-c5afc0db72de | kacper-ziemecki/Competitive-Programming | Codeforces Problems/1657A.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long
#define ld long double
#define ull unsigned long long
void dbg_out() { cout << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cout << ' ' << H; dbg_out(T...); }
#define dbg(...) cout << "(" << #__VA... | ALGO | 0.999862 | 4.646792 |
2a29e23e-4b81-4360-8109-74523d7a35ea | huinaibing/PA | src/ProbFilter.cpp | #include "ProbFilter.h"
#include <random>
ProbFilter::ProbFilter(float prob)
{
this->prob = prob;
}
ProbFilter::~ProbFilter()
{
}
bool ProbFilter::filter(float value)
{
std::random_device rd; // 非确定性随机源(硬件熵)
std::mt19937 gen(rd()); // 使用Mersenne Twister引擎
std::uniform_int_distribution<> dis(0, 1);
... | ALGO | 0.989865 | 4.970765 |
b6aa6307-c42b-4de8-bb60-6d44b4fd4530 | geekboxzone/mmallow_external_opencv | cv/src/cvadapthresh.cpp | #include "_cv.h"
static void
icvAdaptiveThreshold_MeanC( const CvMat* src, CvMat* dst, int method,
int maxValue, int type, int size, double delta )
{
CvMat* mean = 0;
CV_FUNCNAME( "icvAdaptiveThreshold_MeanC" );
__BEGIN__;
int i, j, rows, cols;
int idelta = type == CV_... | ALGO | 0.999289 | 6.834167 |
17073a3d-7575-4dc7-a148-00607db9b7c1 | architJanugade/Polygon-Map-Generation-UE4-CPP | Source/DualMesh/Private/RandomSampling/SimplexNoise.cpp |
#include "RandomSampling/SimplexNoise.h"
#include <cstdint> // int32_t/uint8_t
/**
* Computes the largest integer value not greater than the float one
*
* This method is faster than using (int32_t)std::floor(fp).
*
* I measured it to be approximately twice as fast:
* float: ~18.4ns instead of ~39.6ns on an AMD A... | ALGO | 0.99878 | 4.828169 |
6090dfb0-3c42-4400-9258-3f6319e4a409 | ChinhNgo02/CTDL-GT | C++/tichluythua.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
long long x,y,p;
cin >> x >> y >> p;
long long i = 1;
for(int j = 0; j < y;j++){
i = (i*x)%p;
}
cout << i << endl;
}
} | ALGO | 0.999916 | 3.650432 |
031d4ba3-6992-4993-9c48-7f7a9cb7a656 | bacon-aosp/android_system_core | adb/adb_listeners.cpp | #include "adb_listeners.h"
#include <stdio.h>
#include <stdlib.h>
#include <android-base/stringprintf.h>
#include <cutils/sockets.h>
#include "sysdeps.h"
#include "transport.h"
int gListenAll = 0; /* Not static because it is used in commandline.c. */
static alistener listener_list = {
.next = &listener_list,
... | TOOL | 0.969871 | 5.895167 |
ed8222a1-9796-4ca0-8635-72d453f8576a | raincross7/code-similarity | codes/train_code/problem345/problem345_482.cpp | #include<iostream>
using namespace std;
int main(){
int n;
while(cin>>n){
int a=n/15,b=n%15;
cout<<a*11800+b*800<<endl;
}
return 0;
} | ALGO | 0.998242 | 3.506825 |
562098da-3501-453f-afb5-506bfe02c292 | Lewuathe/mlir-hello | thirdparty/llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.find.end/ranges.find_end.pass.cpp | // <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17
// template<forward_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2,
// class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
// requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
// cons... | TEST | 0.960063 | 7.367566 |
91288c39-179d-4f72-9ca5-122f84f401bb | alexandraback/datacollection | solutions_5731331665297408_0/C++/foxermen/main.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <stack>
#include <list>
#include <ctime>
#define x first
#define y second
#define mp make_pair
#define pb push_ba... | ALGO | 0.999854 | 4.278209 |
97d6e847-1b38-4d24-83b0-c30ba2b57641 | kcopenhagen/lammps-myxosim | install-lammps/lammps-working/lib/poems/onbody.cpp | #include "onbody.h"
#include "body.h"
#include "inertialframe.h"
#include "joint.h"
#include "onfunctions.h"
#include "virtualmatrix.h"
#include "matrixfun.h"
#include <iostream>
#include "norm.h"
#include "eulerparameters.h"
using namespace std;
OnBody::OnBody(){
system_body = 0;
system_joint = 0;
parent = 0;
... | ALGO | 0.946684 | 5.646829 |
1ae7b836-49ff-4832-be22-081156460ab8 | kingarthur11/leetcode | solution/3100-3199/3128.Right Triangles/Solution.cpp | class Solution {
public:
long long numberOfRightTriangles(vector<vector<int>>& grid) {
int m = grid.size(), n = grid[0].size();
vector<int> rows(m);
vector<int> cols(n);
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j) {
rows[i] += grid[i][j];
... | ALGO | 0.999959 | 5.740695 |
bbaf0f4c-de0b-4aba-bb0b-a9f55c2c2f98 | he8300384/my-cpp-exercise-and-practise | algorithm/pick_k_element.cpp | #include<iostream>
#include<vector>
using namespace std;
//使用快排的划分操作
template< typename IT>
IT partition(IT p, IT q)
{
IT i = p;
for( IT j = p + 1; j <= q; ++j)
{
if(*j <= *p)
{
i += 1;
swap(*j , *i);
}
}
swap(*p , *i);
return i;
}
temp... | ALGO | 0.999966 | 3.779423 |
fa8a8e46-6114-4044-b8da-b35aa905af77 | yash-tingre-10/DSA | 0017-letter-combinations-of-a-phone-number/0017-letter-combinations-of-a-phone-number.cpp | class Solution {
public:
string dialer[10] = {"", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
void helper(vector<string>& ans, string digit, string st, int idx){
if(idx==digit.length())
{
ans.push_back(st);
return;
}
s... | ALGO | 0.999933 | 6.768771 |
d4843e94-e34f-40b6-8aad-02fc1dfb93a5 | Ziklon/algorithms | uva/11462.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int A[2000001];
int n,k;
int main(){
while(scanf("%d",&n)){
if(n==0)break;
for(int i=0;i<n;i++)scanf("%d",&A[i]);
sort(A,A+n);
printf("%d",A[0]);
for(int i=1;i<n;i++)printf(" %d",A[i]);
printf("\n");
... | ALGO | 0.999831 | 3.250381 |
1c86c79f-e6a4-4840-9336-2c5b6c20908d | raincross7/code-similarity | codes/train_code/problem075/problem075_50.cpp | //#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<set>
#include<map>
/*
#include<boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/rational.hpp>
namespace mp = boost::multiprecision;
using Real = ... | ALGO | 0.999799 | 3.502685 |
a31d6f59-18e3-4da8-a385-431fdb79465f | Timokrut/UniversityLabs | YA_TEST_BOP/9/3.cpp | // Алгоритмы простая: Давно дерево class Node {Node* left; Node* right; int value};
// Написать рекурсивную функцию для подсчета числа вершин
#include <iostream>
class Node {
public:
int value;
Node* left;
Node* right;
Node(int val) : value(val), left(nullptr), right(nullptr) {}
};
... | ALGO | 0.9995 | 6.045904 |
b9376b97-2394-40f0-bf9d-540833e103bc | nunesg/WinterTraining2019 | Aula3/sqrt.cpp | //URI - 1500 - Consultas Horríveis usando SQRT pra range update / range queries
#include <bits/stdc++.h>
using namespace std;
#define N 101010
#define BLOCK 333
typedef long long ll;
int block_size;
int n, q, blc[N], ini[BLOCK], fim[BLOCK];
ll sum[BLOCK], lazy[BLOCK], v[N];
void build(){
block_size = sqrt(n)+1;
... | ALGO | 0.99828 | 4.487182 |
7dac2739-52b2-41f6-8a99-3c1d42a86b05 | Chandan017/Coder-s-Byte | AtCoder Code/POW.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define loop(i,a,b) for(int i=a;i<(b);i++)
#define ff first
#define ss second
#define vi vector<int>
#define fastio() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int main()
{
fastio();
ll a,b,c;
cin>>a>>b>>c;
... | ALGO | 0.999995 | 3.764961 |
8df5a59f-3733-4fdf-83da-3c0bb2887f7f | Himanshu4776/leetcode-submissions | 233-number-of-digit-one/2023-01-22 00.05.02 - Accepted - runtime 4ms - memory 5.9MB.cpp | class Solution {
public:
int countDigitOne(int n) {
int countr = 0;
for (long long i = 1; i <= n; i *= 10) {
long long divider = i * 10;
countr += (n / divider) * i + min(max(n % divider - i + 1, 0LL), i);
}
return countr;
}
}; | ALGO | 0.999935 | 6.578788 |
dfbfcce1-72b3-43b9-83cc-db8b88419db9 | ishandutta2007/codeforces | p6pou/normal/1446/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_N = 5000 + 5;
int A, B;
char a[MAX_N], b[MAX_N];
int ans, f[MAX_N][MAX_N];
int main() {
scanf("%d%d", &A, &B);
scanf("%s%s", a + 1, b + 1);
for (int i = 1; i <= A; i ++) {
for (int j = 1; j <= B; j ++) {
if (a[i] == b[j]) {
... | ALGO | 0.999847 | 3.797495 |
a458376c-df67-47dc-853b-2ca63c578396 | codgician/competitive-programming | HDUOJ/2570/greedy.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <climits>
#include <iomanip>
#define SIZE 101
using namespace std;
int arr[SIZE];
int main()
{
ios::sync_with_stdio(false);
int caseNum;
cin >> caseNum;
while (caseNum--)
{
... | ALGO | 0.999841 | 3.838651 |
f01da52a-5650-4e7d-b6ea-4b3c7723429e | YunusEmreSimseek/job_finder_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 |
9eb6b5a0-5638-46cb-8891-cf2184904c83 | SEA-ME-COSS/Control | control_ws/src/stanley/include/stanley/dbcppp/third-party/boost/libs/atomic/src/find_address_sse41.cpp | /*!
* \file find_address_sse41.cpp
*
* This file contains SSE4.1 implementation of the \c find_address algorithm
*/
#include <boost/predef/architecture/x86.h>
#include <boost/atomic/detail/int_sizes.hpp>
#if BOOST_ARCH_X86 && defined(BOOST_ATOMIC_DETAIL_SIZEOF_POINTER) && (BOOST_ATOMIC_DETAIL_SIZEOF_POINTER == ... | ALGO | 0.994947 | 6.262462 |
4f978e15-9ad6-403e-b518-2bde330c1a54 | keshav-goswami/DSA | TREES/BALANCED_NAIVE.cpp | // Its time complexity is O(N^N)
#include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node* left;
Node* right;
Node(int val){
val = data;
left = right = NULL;
}
};
int maxdepth(Node* root){
if(!root) return 0;
return 1 + max(maxdepth(root->left),maxdepth(root... | ALGO | 0.999905 | 5.104633 |
092e46c8-7105-41d4-87d4-baa9cffeb5c5 | JianCong-WENG/IterCluster | IterCluster/IterCluster-MCL/src/eigen-eigen-b9cd8366d4e8/bench/benchEigenSolver.cpp |
// g++ -DNDEBUG -O3 -I.. benchEigenSolver.cpp -o benchEigenSolver && ./benchEigenSolver
// options:
// -DBENCH_GMM
// -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3
// -DEIGEN_DONT_VECTORIZE
// -msse2
// -DREPEAT=100
// -DTRIES=10
// -DSCALAR=double
#include <iostream>
#include <Eigen/Core>
#include <Eigen/QR>
#in... | TOOL | 0.996655 | 5.772194 |
47a7befd-18d3-4d26-b76b-98816464cd71 | bytedance/terark-zip | 3rdparty/boost-include/libs/multiprecision/performance/voronoi_performance.cpp | #ifdef _MSC_VER
#pragma warning(disable:4244)
#endif
#include <boost/polygon/detail/voronoi_predicates.hpp>
#include <boost/polygon/detail/voronoi_structures.hpp>
#include <boost/polygon/detail/skeleton_predicates.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#i... | TEST | 0.98151 | 6.788018 |
fa368977-bc94-41f8-9a26-baf43f700782 | tonyH2O/exercises_solutions_3 | day1/8.cpp | #include <iostream>
using namespace std;
int add_numbers(int x, int y)
{
int answer = x+y;
return answer;
}
int main()
{
cout<<add_numbers(10,10);
return 0;
}
| TOOL | 0.92788 | 4.275386 |
fd860690-9569-498b-b70d-b4065b3de14f | yinzixuan126/my_udacity | src/CarND-MPC-Quizzes/mpc_to_line/src/Eigen-3.3/doc/examples/Tutorial_BlockOperations_print_block.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(4,4);
m << 1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16;
cout << "Block in the middle" << endl;
cout << m.block<2,2>(1,1) << endl << endl;
for (int i = 1; i <= 3; ++i)
{
cout << "B... | ALGO | 0.974149 | 3.6853 |
46ebbea8-d89b-40e8-bc86-8fe62ba915da | mauryavinay1407/DSA-cpp | Arrays/Intervals/Check_if_Grid _be_Cut_into_Sections.cpp | // problem : https://leetcode.com/problems/check-if-grid-can-be-cut-into-sections
/*
Approach - Using sorting
Time Complexity : O(N*logN)
Space Complexity : O(N)
*/
class Solution {
public:
using P = pair<int, int>;
bool static customComparator(const P& a, const P& b) {
if (a.first == b.fi... | ALGO | 0.999989 | 6.313874 |
b54e61c3-54b1-4e03-8a54-72a92cef2984 | PanCake8909/neuronet | sources/neuron.cpp | /*
*This is neuron class which uses in net.
*So, I can say that this is logic kernel.
*/
#include "neuron.h"
#include <math.h>
//settings
double Neuron::eta = 0.15; // net learning rate
double Neuron::alpha = 0.5; // momentum
//construct
Neuron::Neuron(unsigned numOutputs, unsigned myIndex) {
for (unsigned c = 0;... | ALGO | 0.979208 | 4.189891 |
ddfbba60-079b-4760-a812-05be96cfe3f4 | ishandutta2007/codeforces | jakube/normal/789/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.precision(10);
cout << fixed;
int n, k;
cin >> n >> k;
vector<int> v(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
}
long long sum = 0;
for (int x ... | ALGO | 0.9999 | 4.189684 |
ee56f572-b105-4220-89b9-23cb3facf50f | MiaFoxcat/flightgear | src/FDM/UIUCModel/uiuc_2Dinterpolation.cpp | #include <simgear/compiler.h> // MSVC: to disable C4244 d to f warning
#include "uiuc_2Dinterpolation.h"
double uiuc_2Dinterpolation( double xData[100][100],
double yData[100],
double zData[100][100],
int xmax[100],
... | ALGO | 0.992416 | 5.782938 |
a1d7614a-d4f4-4092-83dd-605b2ca50af1 | Ujwal-Gaonkar/Ds-Algo- | Bit Manipulation/ithSetBit.cpp | #include <bits/stdc++.h>
using namespace std;
bool checkBit(int n,int pos){
int f=1;
f=f<<pos;
int res=n&f;
if(res==0)
{
return false;
}else
{
return true;
}
}
int main()
{
int n,pos;
cin>>n>>pos;
cout<<checkBit(n,pos)<<endl;
return 0;
} | ALGO | 0.999585 | 3.926515 |
eb8b05d2-6c3e-4795-9f8e-52404bca5d38 | brunk23/code-challenges | AdventOfCode2016/Day04/day04-1.cpp | #include <iostream>
#include <string>
int validRoom(std::string);
using namespace std;
int validRoom(string ident) {
int count[26], i, highest, curr, value=0;
int index;
// We use this to count the amount of chars.
for(i = 0; i < 26; i++) {
count[i] = 0;
}
highest = 0;
// Read the character cod... | ALGO | 0.980382 | 4.546512 |
549b03cd-0dfb-496e-9e15-bb928c305cb8 | Sahil-Naik/SE-Programming | SPPU-DSL/DSL_Assign_31.cpp | /*
Name: Sahil S. Naik
PRN: S20111006
Subject: DSL Lab
Assignment: #31
*/
#include<iostream>
using namespace std;
#define SIZE 5
class dequeue
{
int a[10],front,rear,count;
public:
dequeue();
void add_at_beg(int);
void add_at_end(int);
void delete_fr_front();
void delete_fr_rear();
void display();
};
dequeue... | ALGO | 0.996453 | 4.087794 |
ad8ed61a-daa6-4647-848b-3af54789f7cc | Diseqoff/Programaci-n | Bloque 4/while.cpp | #include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int i = 0, opcion = 0;
// i = i;
cout<<"\tOrdenamiento de numeros"<<endl;
cout<<"\n1.Ascendente (Hasta el 20)"<<endl;
cout<<"2.Descendente (Hasta el 0)"<<endl;
cout<<"3.Salir"<<endl;
cout<<"\nElija una opcion: ";
... | TOOL | 0.892065 | 3.359822 |
ca39c848-1843-449e-bc45-eaa2a3df0de0 | Lubiyangka/AlgorithmProject | OOP/查找/2-D.cpp | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
int m, n;
int a[105][2005];
int temp[105];
struct state{
int x;
int i;
int j;
bool tag;
state(int x = 0, int i = 0, int j = 0, bool tag = false):
x(x), i(i), j(j), tag(tag){}
bool operator > (const st... | ALGO | 0.999926 | 3.315555 |
48305b7b-5096-409d-83e8-aef96f71d954 | Autoratch/submissions | Codeforces/1195A.cpp | #include <bits/stdc++.h>
using namespace std;
int a[1001];
int ans;
int cnt;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
int n,k;
cin >> n >> k;
k = (n+1)/2;
for(int i = 0;i < n;i++){ int x; cin >> x; a[x]++; }
for(int i = 1;i <= 1000;i++) if(a[i])
{
if(a[i]/2>k) a... | ALGO | 0.999614 | 3.756285 |
f6b2dea7-31d3-4f90-a25a-c767d2afbea3 | cernekee/dnsproxy2 | jni/DnsProxyListener.cpp | #include <arpa/inet.h>
#include <dirent.h>
#include <errno.h>
#include <linux/if.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <string.h>
#include <pthread.h>
#include <resolv_iface.h>
#include <net/if.h>
#include <unistd.h>
#include <sys/sysca... | TOOL | 0.870684 | 6.019825 |
999c83b6-be75-4069-824e-63f545ddf9e3 | d33panpaudel07/allSemesterCodes | 3rd_Semester/Numerical Method/lab 1/bisection.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
#define e 0.02
#define f(x) (sin(x) + pow(x, 2) + 5 * x - 9)
// #define f(x) (pow(x,4) -2 * pow(x,3)- x-3)
using namespace std;
int main() {
int i = 0;
double xu, xl, fxu, fxl, xm = 0;
double fxm, error = 0;
cout << "Enter the value of xu:" <<... | ALGO | 0.999968 | 4.295267 |
244664ec-1c58-49e2-bbe2-01e91090f189 | haowanwuyifan/data_structure_and_algorithm | 字符串匹配/luogu3808.cpp | /*------------------------------------------------------------------------------
* @file LUOGU3808.CPP
* @author FIRMWARE TEAM
* @date 2024/03/29 17:28:50
* @brief THIS FILE PROVIDES ALL THE FIRMWARE FUNCTIONS.
* -----------------------------------------------------------------------------
/* Define to ... | ALGO | 0.999931 | 4.914366 |
870bbba7-7310-463d-aa0d-7116582035bb | athuls/RL_Soar | Fall2011/boost_1_46_0/libs/spirit/example/qi/sum.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// A parser for summing a comma-separated list of numbers using phoenix.
//
// [ JDG June 28, 2002 ] spirit1
// [ JDG March 24, 2007 ] spirit2
//
///////////////////////////////////////////////////////////////////////////////
#inc... | TOOL | 0.907878 | 6.890997 |
bf51c9ce-054e-4774-bb07-73056473a7f9 | davehorton/pcap_ripper | deps/boost_1_65_1/libs/spirit/classic/example/techniques/no_rules_with_typeof/rule_parser_2_1.cpp | //------------------------------------------------------------------------------
// This example shows a recursive grammar built using subrules and typeof.
// See boost/spirit/include/rule_parser.hpp for details.
// This example is based on subrule_calc.cpp.
//--------------------------------------------------------... | TOOL | 0.851136 | 7.871853 |
551b828c-044b-48b6-b102-829f542e0647 | ishandutta2007/codeforces | balbit/normal/1303/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define int ll
#define ll long long
#define pii pair<ll, ll>
#define f first
#define s second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define MX(a,b) a = max(a,b)
#define MN(a,b) a = min(a,b)
#define pb push_back
#define FOR(i,a,b) for (int i... | ALGO | 0.99984 | 3.824177 |
586b33e9-ba94-4673-80f7-7dc451500ec4 | Sambokk/2DCollision | D2DDefault/gjkSupport.cpp | #pragma once
#include "pch.h"
#include "define.h"
#include "function.h"
#include "gjkSupport.h"
#include "Collider.h"
/// <summary>
/// a x b x c ߰
/// </summary>
Vector3 TripleProduct(Vector3 _a, Vector3 _b, Vector3 _c)
{
Vector3 a = _a;
Vector3 b = _b;
Vector3 c = _c;
Vector3 first = Cross(a, b);
Vector3 secon... | ALGO | 0.997991 | 4.059761 |
8a437fd8-5e2f-4943-aedf-5d2e2a4b4685 | TaoZhang5023/Algorithm | two_sum.cpp | // Given an array of integers, return indices of the two numbers such that they add up to a specific target.
// You may assume that each input would have exactly one solution, and you may not use the same element twice.
// Example:
// Given nums = [2, 7, 11, 15], target = 9,
// Because nums[0] + nums[1] = 2 + 7 = 9,... | ALGO | 0.999703 | 6.807468 |
8c298658-8de0-4a0b-8047-374fd5dbeb99 | pigotop/flutter_firstapp | 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 |
7118e45e-c8cc-4f73-b245-730604bc2ecd | codewalkerster/platform_frameworks_av | media/libeffects/lvm/lib/Eq/src/LVEQNB_Process.cpp | /****************************************************************************************/
/* */
/* Includes */
/* ... | ALGO | 0.996688 | 5.497777 |
5c563713-2a3f-42d2-9bec-056cf6b0022f | ichn/3-code-for-ac | BZOJ/3992-sdoi2015-序列统计-ntt-求指标.cpp | #include <bits/stdc++.h>
#define pt cerr << (double)clock() / CLOCKS_PER_SEC << endl
using namespace std;
typedef long long LL;
const int mod = 479 * (1 << 21) + 1;
const int G = 3;
const int maxn = 10000;
LL fpm(LL a, LL i, LL m) {
LL r = 1;
for (; i; i>>=1, a=a*a%m)
if (i&1) r=r*a%m;
return r;
}
int n, m, x... | ALGO | 0.999978 | 4.39738 |
f8619bda-4142-4cf5-b1ad-6124f4deebab | TrMTan/Code-CPP-PTIT | c++ tren lop/c++/125.cpp | #include<bits/stdc++.h>
using namespace std;
int snt(int n){
for(int i = 2; i <= sqrt(n); i++){
if(n % i == 0){
return 0;
}
}
return n > 1;
}
void check()
{
int a, b;
cin >> a >> b;
if(a > b){
swap(a, b);
}
for(int i = a; i <= b; i++){
if(sn... | ALGO | 0.999863 | 3.868401 |
24d3a5e1-a9e7-4bb4-a3a4-fbc6ae8c048b | hashir-mohd/Leetcode | 3548-find-the-count-of-good-integers/3548-find-the-count-of-good-integers.cpp | class Solution {
public:
long long countGoodIntegers(int n, int k) {
unordered_set<string> dict;
int base = pow(10, (n - 1) / 2);
int skip = n & 1;
for (int i = base; i < base * 10; i++) {
string s = to_string(i);
// s += string(s.rbegin() + skip, s.rend());
... | ALGO | 0.999774 | 5.776295 |
4e0e4314-b35b-4fc0-b3f0-16495802501b | ishandutta2007/codeforces | gshgsh/normal/1465/B.cpp | #include<iostream>
using namespace std;
#define ll long long
int T;ll N;int main(){cin>>T;while(T--){cin>>N;while(1){bool flag=1;ll x=N;while(x)x%10?flag&=N%(x%10)==0:0,x/=10;if(flag){cout<<N<<endl;break;}N++;}}return 0;} | ALGO | 0.999813 | 4.140177 |
d975a189-95ca-4f1c-85cc-c3995dee64d3 | ishandutta2007/codeforces | redstar_13/normal/215/D.cpp | #include<bits/stdc++.h>
#define NN 5555
using namespace std;
typedef long long INT;
typedef double DO;
char s;
int main(){
int n,m,i,j;
cin>>n>>m;
INT t,T, x, cost;
INT ans=0;
for(i=0; i<n; i++){
scanf("%I64d%I64d%I64d%I64d", &t, &T, &x, &cost);
INT tmp1=cost+(t+m>T)*x*m;
INT tmp2;
if(T<=t) ... | ALGO | 0.999287 | 3.38021 |
6f794834-50d7-4e70-bcf7-c2d436b83240 | 2369931/LintCode | code/86_二叉查找树迭代器.cpp | #include <iostream>
using namespace std;
class TreeNode {
public:
int val;
TreeNode *left, *right;
TreeNode(int val) {
this->val = val;
this->left = this->right = NULL;
}
};
class BSTIterator {
public:
stack<TreeNode*> record;
/*
* @param root: The root of binary tree.
... | ALGO | 0.999935 | 5.661968 |
889cd7f9-5157-4383-9c8e-1afc07ab2ce2 | AndMSWDE97/llvm-digital | llvm/lib/Support/CachePruning.cpp | #include "llvm/Support/CachePruning.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#define DEBUG_TYPE "cache-pruning"
#include <set>
#include <system_error>
us... | TOOL | 0.92912 | 7.909294 |
c6874416-db7d-4071-bd0a-3bbd5f7831ca | alokmaurya013/leetcode_alok | 2482-difference-between-ones-and-zeros-in-row-and-column/2482-difference-between-ones-and-zeros-in-row-and-column.cpp | class Solution {
public:
vector<vector<int>> onesMinusZeros(vector<vector<int>>& grid) {
int n=grid.size();
int m=grid[0].size();
vector<int>or1(n,0),oc(m,0),zr(n,0),zc(m,0);
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(grid[i][j]==1){
o... | ALGO | 0.99992 | 5.941465 |
2ca7d7c0-0d37-44dd-a656-49057263a2ee | Lee-JunH/cpp_study | 0x03/1919.cpp | #include <iostream>
using namespace std;
int main(void)
{
ios:: sync_with_stdio(0);
cin.tie(0);
string s1, s2;
cin >> s1 >> s2;
int alpha[26] = {}, count = 0;
for (auto i : s1) alpha[i - 'a']++;
for (auto i : s2) alpha[i - 'a']--;
for (int i = 0; i < 26; i++) {
if (alpha[i] != 0) {
if (alpha[i] < 0) cou... | ALGO | 0.999942 | 3.685388 |
b41a1b97-a3d0-4133-b339-d63630949519 | EstherCS/CS106HW_2015 | 1043335-hw8/1043335.cpp | #include <iostream>
#include <fstream>
using namespace::std;
// read in a C++ program from a cpp file, and put it to the array "program".
void load(char program[][200], int &numLines);
void deleteComments(char line[]); // if there is a single-line comment in "line", delete it.
void deleteStringConstants(char line[])... | TOOL | 0.902659 | 3.418653 |
eb2b83ce-52b8-4c4c-b6e6-f360fe7ad9e8 | meowmeow321/cp-snippets | some good fuckin snippets/USACO-master/Contests/USACO Solutions/2015-16/Open 2016/Gold/16 Open G3.cpp | #include<fstream>
#include<algorithm>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define pi pair <int, int>
#define vi vector<int>
#define FOR(i, a, b) for (int i=a; i<b; i++)
#define FORd(i, a, b) for (int i=a-1; i>=b; i--)
#define F0Rd(i, a) for (int i=a-1; i>=0; i--)
#def... | ALGO | 0.999903 | 3.818874 |
194621d4-c39c-44c8-b715-7d799af03580 | greenbeanpie/OI-training | NOIP2023-ZJ/ZJ-0558/run/run.cpp | #include<bits/stdc++.h>
using namespace std;
#define MAXN 1000005
#define MAXM 1000005
#define int long long
int n,m,k,d,g,ans=0xcfcfcfcfcfcfcfcf;
int testid,T,sum[MAXN];
struct Node{
int x,y,v;
}node[MAXM];
inline bool cmp(Node x,Node y){return x.x<y.x;}
signed main(){
freopen("run.in","r",stdin);
freopen("run.out"... | ALGO | 0.999885 | 3.856126 |
58b7c342-a982-481f-8472-886bb928827d | sarvex/leetcode-nim | solution/1000-1099/1011.Capacity To Ship Packages Within D Days/Solution.cpp | class Solution {
public:
int shipWithinDays(vector<int>& weights, int days) {
int left = 0, right = 0;
for (auto& w : weights) {
left = max(left, w);
right += w;
}
auto check = [&](int mx) {
int ws = 0, cnt = 1;
for (auto& w : weights) ... | ALGO | 0.999993 | 5.888124 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.