uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
724ea918-a339-43b5-b816-694c872ec102 | vitorkei/IME-USP | Desafios/A02/1.cpp | /*
Nome: Vítor Kei Taira Tamada
NUSP: 8516250
MAC0327 - Desafios de Programação - 2016/2
Batch 1 - Aula 02 - Problema A
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, l, i, dist = 0, lim_dist;
double distf;
scanf("%d %d", &n, &l);
int loc[n];
for (i = 0; i < n; i++)
scanf("%d", &l... | ALGO | 0.999953 | 3.405038 |
49fcd78f-8ae7-452d-957c-282000604321 | zshangGEO/gmsh | src/plugin/MinMax.cpp | #include "MinMax.h"
#include "PViewOptions.h"
StringXNumber MinMaxOptions_Number[] = {{GMSH_FULLRC, "View", nullptr, -1.},
{GMSH_FULLRC, "OverTime", nullptr, 0},
{GMSH_FULLRC, "Argument", nullptr, 0},
... | TOOL | 0.965219 | 6.418268 |
272f0c04-b775-43c5-8950-59986c789ade | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10241_0.cpp | #include <bits/stdc++.h>
using namespace std;
int x[500111], v[5001111], n;
int main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
;
cin >> n;
for (int i = 1; i <= n; i++) cin >> x[i] >> v[i];
double ll = 0, rr = 1000111222;
while (abs(rr - ll) > 1e-9) {
double mid = (ll + rr) / 2;
bool enek... | ALGO | 0.999976 | 3.848734 |
b5b93e7d-a280-4854-8382-850506795bb4 | PixysOS/system_core-old | fs_mgr/libsnapshot/estimate_cow_from_nonab_ota.cpp | #include <iostream>
#include <memory>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/strings.h>
#include <android-base/unique_fd.h>
#include <gflags/gflags.h>
#include <libsnapshot/cow_writer.h>
#include <opens... | TOOL | 0.934908 | 7.360289 |
1069b5a8-80ef-4f1c-bb70-c2c300699348 | hjiang13/LLMs-in-IR | processed_data/Decompiled_Humaneval_x_cpp_164_Result_O3/GPT4o_human_x_164_decompiled/test/CPP_49.cpp | #include <iostream>
int mod(int a, int b) {
if (a <= 0) {
return 1;
}
int temp = a & 3;
if ((a - 1) < 3) {
return (a & -4);
}
int result = 1;
int count = 1;
while (true) {
if (temp == 0) {
return result;
}
resul... | ALGO | 0.999862 | 5.854522 |
c026af1a-c83a-4b37-85e9-86634ccffa2e | tlsgkdns/study | DynamicProgramming/11052_buyCard.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> card, dp;
int N;
int solve(int cnt)
{
int& ret = dp[cnt];
if (ret != -1) return ret;
ret = 0;
for (int i = 1; i <= cnt; i++)
ret = max(ret, solve(cnt - i) + card[i]);
return ret;
}
int main()
{
ios_base::sync_with_std... | ALGO | 0.999962 | 4.418084 |
3c182b11-819f-4a60-9851-99b2f77e88f5 | sarvex/leetcode-php | solution/1000-1099/1035.Uncrossed Lines/Solution.cpp | class Solution {
public:
int maxUncrossedLines(vector<int>& nums1, vector<int>& nums2) {
int m = nums1.size(), n = nums2.size();
vector<vector<int>> dp(m + 1, vector<int>(n + 1));
for (int i = 1; i <= m; ++i) {
for (int j = 1; j <= n; ++j) {
if (nums1[i - 1] == nu... | ALGO | 0.999995 | 6.404184 |
51341ce7-5c90-4a33-9d3a-f96e270887dd | blockspacer/CXTPL | third_party/icu_wrapper/third_party/icu/source/common/uvector.cpp | #include "uvector.h"
#include "cmemory.h"
#include "uarrsort.h"
#include "uelement.h"
U_NAMESPACE_BEGIN
#define DEFAULT_CAPACITY 8
/*
* Constants for hinting whether a key is an integer
* or a pointer. If a hint bit is zero, then the associated
* token is assumed to be an integer. This is needed for iSeries
*/
... | TOOL | 0.918036 | 6.984235 |
06d9249c-553d-4e8b-949d-cc385b1e219d | moinhameed27/DSA-A2Z-TUF | Linked List/Single Linked List/14_Delete the Middle Node of a Linked List.cpp | // LeetCode : https://leetcode.com/problems/delete-the-middle-node-of-a-linked-list/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next... | ALGO | 0.999811 | 6.204029 |
652da018-5b84-472b-b896-5efb7fac5666 | Um-ded/problem-solving | Codechef Codes/10. FLOW013.cpp | ///*/////////////////////////////*///
/// IN THE NAME OF ALMIGHTY ALLAH ///
///*/////////////////////////////*///
///*////////////////////*///
/// Author : SAIFULLAH29 ///
///*////////////////////*///
#include <bits/stdc++.h>
#define SS " "
#define endl "\n"
#define EPS 1e-9
#define gcd ... | ALGO | 0.999421 | 4.696692 |
3ebfde7d-000b-46c8-b6b1-213e76509f2f | badpingpong/cppProgramming | 2syou/rensyu/2-47-1.cpp | #include <iostream>
using namespace std;
int main(){
for(int i=1;i<=10;i++){
//1つ目
for(int j=1; j<=10; j++){
if(j<=i)
cout << "*";
else
cout << " ";
}
cout << " ";
//2つ目
for(int j=10; j>=1; j--){
if(i<=j)
cout << "*";
else
cout << " ";
}
cout << " ";
//3つ目
for(int j=1;... | ALGO | 0.999818 | 3.303235 |
ba671198-848a-4201-9b1b-13c0346788da | LYXRhythm/Py-CPP-LUT | eigen-3.4.0/doc/examples/matrixfree_cg.cpp | #include <iostream>
#include <Eigen/Core>
#include <Eigen/Dense>
#include <Eigen/IterativeLinearSolvers>
#include <unsupported/Eigen/IterativeSolvers>
class MatrixReplacement;
using Eigen::SparseMatrix;
namespace Eigen {
namespace internal {
// MatrixReplacement looks-like a SparseMatrix, so let's inherits its trai... | ALGO | 0.99816 | 6.112806 |
a8f3709b-e8c1-42ed-90fc-4d619f45d48f | i-rony18/leetcode | my-folder/problems/longest_increasing_subsequence/solution.cpp | class Solution {
public:
int solver(vector<int> &n,int i,int pi,vector<vector<int>> &dp){
if(i==n.size())return 0;
if(dp[i][pi+1]!=-1)return dp[i][pi+1];
int len=0;
len=solver(n,i+1,pi,dp);
if(pi==-1 || n[pi]<n[i]){
len=max(len,1+solver(n,i+1,i,dp));
... | ALGO | 0.999994 | 5.661889 |
c5c85726-fd11-4260-908e-27e0ec3e9d7a | BRL-CAD/brlcad_externals | proj/proj/src/projections/nsper.cpp | #define PJ_LIB_
#include "proj.h"
#include "proj_internal.h"
#include <errno.h>
#include <math.h>
/* Note: EPSG Guidance 7-2 describes a Vertical Perspective method (EPSG::9838),
* that extends 'nsper' with ellipsoidal development, and a ellipsoidal height
* of topocentric origin for the projection plan.
*/
namesp... | ALGO | 0.999139 | 6.768117 |
31c31d87-f860-4818-8aff-09bd14333ba8 | bernotieno/system-monitor | mem.cpp | #include "header.h"
// Get memory information from /proc/meminfo to match 'free -h' command exactly
MemoryInfo getMemoryInfo()
{
MemoryInfo memInfo = {0};
ifstream file("/proc/meminfo");
string line;
unsigned long memAvailable = 0;
while (getline(file, line)) {
if (line.find("MemTotal:") ... | TOOL | 0.968989 | 4.556227 |
9b9653b7-5d80-49e7-b2ed-de7c54511b2b | Blackmane/adventofcode | 2022/day13/day13.cpp | /**
* @file day13.cpp
* @project advent of code
*
* @author Niccolò Pieretti
* @date 13 Dec 2022
*
****************************************************************************
*
* _ _ o __ __ __ _ o _ ,_ _
* / |/ | | / / / \_|/ \_| |/ / | |/
* ... | ALGO | 0.999087 | 5.756014 |
dd779c17-99bf-4d03-9bf0-3affa405be63 | PaxuitoGIT/Colecci-n-de-Ejercicios-Flujo-C- | main_mates.cpp | #include <iostream>
#include <sstream>
namespace Matematicas {
int suma (int a, int b){
return a + b;
}
int resta (int a, int b) {
return a - b;
}
}
int main() {
int a, b;
std::cout << "Ingresa un número: ";
std::string imput1;
std::getline(std::cin, imput1);
std::stringstr... | ALGO | 0.932563 | 5.107681 |
186c7f7d-c14c-44ae-b598-8c3fb991e7e5 | kriti-002/Coding-Solutions | 0946-validate-stack-sequences/0946-validate-stack-sequences.cpp | class Solution {
public:
bool validateStackSequences(vector<int>& pushed, vector<int>& popped) {
stack<int>st;
int i=0, j=0, n=pushed.size();
while(i<n){
st.push(pushed[i]); i++;
while(st.size()> 0 and st.top()== popped[j]){
st.pop(); j++;
... | ALGO | 0.99925 | 6.191038 |
35ca82a6-f67c-4cbe-b128-bf4f78bf6a16 | ng8165/USACO | Misc/AtCoder/Frog2.cpp | // Frog 2
// AtCoder Educational DP Contest: https://atcoder.jp/contests/dp/tasks/dp_b
#include <bits/stdc++.h>
using namespace std;
int n, k;
int h[100005];
int dp[100005];
int main() {
cin >> n >> k;
for (int i=1; i<=n; i++) cin >> h[i];
dp[1] = 0;
for (int i=2; i<=n; i++) {
dp[i] = IN... | ALGO | 0.999968 | 4.33116 |
85912524-61c4-48bf-9f7a-4ce3042c2b18 | DeshratnaBharti/Leetcode | 0094-binary-tree-inorder-traversal/0094-binary-tree-inorder-traversal.cpp |
class Solution {
public:
vector<int> inorderTraversal(TreeNode* root) {
stack<TreeNode*> st;
// Start from the root node
TreeNode* node = root;
// Initialize a vector to store
// inorder traversal result
vector<int> inorder;
// Start an infinite
// loop for traversal
whil... | ALGO | 0.999995 | 6.865583 |
d61cbf0c-201a-489f-b6aa-363f545b7f6c | manforowicz/competitive-coding | club/2023-spring/contest1/b.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
//freopen("in.txt", "r", stdin);
int cases; cin >> cases;
for (int t = 0; t < cases; t++) {
int64_t l, r, a; cin >> l >> r >> a;
int64_t x = (r+1) / a * a - 1;
if (x < l) x = r;
cout << x / a + x ... | ALGO | 0.999821 | 3.419276 |
3740440a-d004-4a51-81de-743e299c7627 | Keshav-Thakur8/Leetcode-Stuffs | generate-parentheses/generate-parentheses.cpp | class Solution {
public:
vector<string> res;
void helper(string s, int n, int open, int close){
//Base Case
if(open==n && close==n){
res.push_back(s);
return;
}
if(open<n){
helper(s+'(',n,open+1,close);
}
if(close<open){
... | ALGO | 0.99994 | 6.274705 |
636da366-8aab-446d-a4de-ceecb051d31d | wujinggrt/PAT | Advanced/1111/s.cpp | #include <functional>
#include <vector>
#include <iostream>
#include <cstdio>
using namespace std;
static const int INF = 0x3f3f3f3f;
struct Edge {
int len = INF;
int time = INF;
};
int main(){
int n, m;
cin >> n >> m;
vector<vector<Edge>> graph(n, vector<Edge>(n));
for (int i = 0; i < m; ++i... | ALGO | 0.99979 | 4.44209 |
629cb0bd-f383-488b-acd8-897593b735ab | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7026_8.cpp | #include <bits/stdc++.h>
using namespace std;
int i, j, cs;
vector<int> v[4003];
const int INF = 1000000000;
int source;
int mn = INF;
void dfs(int u, int depth, int total) {
for (auto x : v[u]) {
if (depth > 1 and x != source) {
dfs(x, depth - 1, total + v[x].size());
} else if (depth == 1 and x == sou... | ALGO | 0.999685 | 4.071894 |
9d4f7eea-af09-42de-9d54-e7cf728507cc | pinegreen83/codetree-TILs | 241203/여러 수의 최대공약수와 최소공배수/common-divisor-multiple-2.cpp | #include <iostream>
#include <vector>
using namespace std;
int gcd(int a, int b) {
if(b == 0) return a;
return gcd(b, a % b);
}
long long lcm(int a, int b) {
return (long long) a / gcd(a, b) * b;
}
int main() {
// 여기에 코드를 작성해주세요.
int n;
cin >> n;
vector<int> nums(n);
for(int i=0; i<... | ALGO | 0.999974 | 4.577219 |
07ca91c8-2124-4100-ae74-70ca89ffd70b | Hrishikesh-Thakkar/CodeChef | September_Long/chefinsq.cpp | #include<bits/stdc++.h>
using namespace std;
long long int ncr(int n,int k){
if (n < k) {
return 0;
} else if (n == 0 || k == 0 || k == n) {
return 1;
}
if (k > n - k) k = n - k;
long long result = 1;
for ( int d = 1; d <= k; ++d) {
result *= n--;
result /= d;
}
return result;
}
int main(){
int t;... | ALGO | 0.999917 | 3.493955 |
71eec656-5080-414c-9036-3d1ca542bd76 | sixtyfourbits/baekjoon-online-judge | problem3.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
cin >> n;
int mx = 0;
vector<vector<char> > v(n, vector<char>(n));
for (int i = 0; i < n; ++i)
for (int j = 0; j < n; ++j)
cin >> v[i][j];
int o, p;
cin >> o >> p;
vector<int> hr(o + ... | ALGO | 0.999107 | 3.532044 |
545a1fae-56eb-4a7a-8601-b570e08c0364 | Nacili/GilmoresProcedure | forall.cpp | #include "forall.h"
Forall::Forall(const Variable &var, const Formula &f)
: Quantifier (var, f)
{
}
std::ostream &Forall::print(std::ostream &out) const
{
return printImpl(out, "V");
}
Formula Forall::substitute(const Variable &v, const Term &t) const
{
return substituteImpl<Forall>(v, t);
}
Formula For... | TOOL | 0.903073 | 4.206177 |
c40fac91-d5dd-4b4a-ba3c-6c6ace7a4a6d | jasveen18/CP-krle-placement-lag-jayegi | 450 DSA Questions/14 Dynamic Programming/4LongestIncreasingSubsequence.cpp | int lcs(int x, int y, int s1[], int s2[]) {
// Initialization
int dp[x + 1][y + 1];
memset(dp, -1, sizeof(dp));
for (int i = 0; i <= x; i++)
dp[i][0] = 0;
for (int j = 0; j <= y; j++)
dp[0][j] = 0;
// Build up the dp
for (int i = 1; i <= x; i++) {
for (int j = 1; j <= y; j++) {
if (s1[i - 1] == s2[j -... | ALGO | 0.999955 | 5.211484 |
0ac8842e-64c1-43a1-93bd-eecdd67ddc56 | ayush4518/DSA-CPP | arrays/DUPLICATEelement.cpp | #include<iostream>
using namespace std;
int main()
{int ans=0;
int arr[7]={1,2,3,4,5,6,5};
for (int i = 0; i < 7; i++)
{
ans=ans^arr[i];
}
for (int i = 0; i < 7; i++)
{
ans=ans*i;
}
cout<<ans<<endl;;
} | ALGO | 0.999953 | 3.115779 |
fadf9bf4-d91c-4ab7-ac43-4512d86b58d0 | Veljko28/cpp-data-algrtms | codeforces/17/JOEIsOnTv.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <set>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <unordered_map>;
using namespace std;
#define ll long long
#define ull unsigned long long
#def... | ALGO | 0.998059 | 3.619859 |
9bc8eb3f-6821-4bf9-8554-d9bf58493970 | nileshsatote/program | Q7.cpp | #include<iostream>
#include<vector>
#include<bits/stdc++.h>
using namespace std;
void mergeVector(vector<int> &v1 , vector<int> &v2)
{
vector<int> v3(v1.size() + v2.size());
merge(v1.begin(),v1.end(),v2.begin(),v2.end(),v3.begin());
for(int i=0;i<v3.size();i++)
{
cout<<v3[i]<<" ";
}
cou... | ALGO | 0.999973 | 3.615424 |
5f9a725d-a219-4558-a7b1-f25d5a3baeb2 | ShyamGupta1/DS-Algo-Solutions | Hash Table/Maximum Difference Between Even and Odd Frequency I.cpp | // T.C : O(N)
// S.C : O(1)
class Solution
{
public:
int maxDifference(string s)
{
map<char, int> mp;
for (auto ch : s)
mp[ch]++;
int evenMAX = 0, evenMIN = INT_MAX, oddMAX = 0, oddMIN = INT_MAX;
for (auto x : mp)
{
if (x.second & 1)
{... | ALGO | 0.999954 | 5.518101 |
d2e31c75-0b6d-4ca5-b26a-281f8a694389 | cpp-learn-Maimba/cpp-learning- | 16.Functions/17.15SizedArraysByReference/main.cpp | #include <iostream>
//Declaration
double sum( const double (&scores) [10]);
int main(){
double student_scores[] {10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,1};
double sum_result = sum(student_scores);
std::cout << "result is : " << sum_result << std::endl;
return 0;
}
//Definition
doub... | ALGO | 0.984957 | 4.241154 |
4d03edf2-c3af-4f59-b631-ab1dde1e9de8 | Romasa102/CompetitiveProgramming | JOI/Actual/B.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i = 0; i < (n); ++i)
#define repp(i,o,n) for(ll i = o; i < (n); ++i)
using P = pair<ll,ll>;
int main(){
ll a,b,c;
cin >> a >>b >> c;
if(a+b==c || a+c==b || b+c==a){
cout << 1 << endl;
return 0;
}
... | ALGO | 0.999874 | 4.160276 |
cb9cbdfb-0c4f-4e9b-a13c-b60062b02cdc | Farrius/cp | usaco_guide/gold/dynamic_programming/usaco_problems/time_is_mooney.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int MX = 1e3 + 5;
int main () {
freopen("time.in", "r", stdin);
freopen("time.out", "w",stdout);
ll n, m, c;
cin >> n >> m >> c;
ll ar[MX], dp[MX][MX];
vector<pair<int, int>> edges;
for (int i = 1; i <= n; i++)... | ALGO | 0.999986 | 3.952322 |
dd4cee6b-68fd-4fe6-819d-338ad7b63b3c | leo950413/Codeforces | Codeforces/1300/628C/628C.cpp | #include <stdio.h>
#include <string>
using namespace std;
char buf[200005];
bool valid(char c, int n){
if(c + n <= 25 + 'a' && c + n >= 'a'){
return true;
}
return false;
}
int main(){
int n,k;
scanf("%d %d" , &n , &k);
scanf("%s", buf);
string s = buf;
for(int i=0; i<s.size(); ... | ALGO | 0.999906 | 3.927602 |
ff655a1b-fd39-45fb-b096-630f2a57f25f | NguyenLabJHU/Tahoe-FEM | tahoe/src/elements/shape_functions/meshfree/D2/D2OrthoMLS2DT.cpp | /* $Id: D2OrthoMLS2DT.cpp,v 1.3 2002-10-20 22:49:42 paklein Exp $ */
/* created: paklein (10/17/1999) */
#include "D2OrthoMLS2DT.h"
#include "ExceptionT.h"
#include "dSymMatrixT.h"
/* constructor */
using namespace Tahoe;
D2OrthoMLS2DT::D2OrthoMLS2DT(int complete):
D2Ortho... | ALGO | 0.906671 | 6.655845 |
6453dde3-3ba3-436c-ad0b-0c5c790490fb | Tangent5969/Ray-Tracing | src/BVH.cpp | #include "headers/BVH.h"
BVH::BVH(Model model, std::vector<Triangle> triangles) {
this->modelTriangles = triangles;
BVHNode root;
root.leftIndex = 0;
root.triIndex = 0;
root.triCount = (model.endIndex - model.startIndex) + 1;
nodes.push_back(root);
// calculate triangle centres for subdivision
// BVHTriangle... | ALGO | 0.998097 | 6.400462 |
a38767b7-ae9c-4ced-864d-7625624a4d27 | kzrobin/CodeForce-solution | 0101-0200/A_Twin_Permutations.cpp | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<cmath>
#include<cstring>
#define ll long long
#define scll(n) scanf("%lld",&n)
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
void solve(){
ll n;
scll(n);
ll x;
for(... | ALGO | 0.999534 | 3.530654 |
40941dbd-1681-46bf-b83f-b1a984af7548 | PokemonAutomation/Arduino-Source | SerialPrograms/Source/Tests/TestUtils.cpp | /* Test Utils
*
* From: https://github.com/PokemonAutomation/
*
*
*/
#include "TestUtils.h"
#include <iostream>
#include <sstream>
#include <fstream>
using std::cout;
using std::cerr;
using std::endl;
namespace PokemonAutomation{
std::vector<std::string> parse_words(const std::string& filename_base){
... | TOOL | 0.901327 | 5.319065 |
920a994a-47e9-4550-847d-e01b96dbdb0e | Premkolte/1001-Days-of-Code-Leetcode | 1972-rotating-the-box/rotating-the-box.cpp | class Solution {
public:
vector<vector<char>> rotateTheBox(vector<vector<char>>& box) {
int m = box.size();
int n = box[0].size();
for (auto& row : box) {
int dropPos = n - 1;
for (int currPos = n - 1; currPos >= 0; currPos--) {
i... | ALGO | 0.999947 | 6.435564 |
4b761418-fcff-4945-8d21-5ae32dd41ab2 | NameLessJedi/framework_base | media/libstagefright/codecs/aacdec/tns_decode_coef.cpp | /*
Pathname: tns_decode_coef.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Modified from original shareware code
Description: Implemented in 16-bit Fixed Point
Description: Implemented in 24-bit Fixed Point
Description: Modified to return ... | ALGO | 0.999777 | 6.670528 |
03279091-4265-4547-97cc-42aca2166308 | KKranzz/cpp-search-server | search-server/main.cpp | /* решение задачи "Выводим результаты поиска страницами" из темы "Итераторы" */
#include <iostream>
#include "document.h"
#include "paginator.h"
#include "read_input_functions.h"
#include "request_queue.h"
#include "search_server.h"
using namespace std;
template <typename Container>
auto Paginate(const Container& c,... | WEB | 0.896701 | 4.3124 |
98ca7b0b-171b-4749-91de-5e9bcc87d3a8 | JDevAman/Practice | LeetCode/rotateMatrix.Cpp | class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
int n = matrix.size();
for(int i=0; i<n; i++){
reverse(matrix[i].begin(),matrix[i].end());
}
for(int i=0; i<n; i++){
//To swap all elements lying before the diagonal line.
for(int j=0; j<n-i-1; j++... | ALGO | 0.999979 | 6.529335 |
37d6692d-4f97-44a1-8abc-048f90685493 | raghvendra240/DSA | Dynamic programming/Total ways to give change(using O(n)space).cpp | https://www.interviewbit.com/problems/coin-sum-infinite/
int Solution::coinchange2(vector<int> &A, int B) {
vector<int>&S=A;
int n=B;
int m=A.size();
int table[n+1];
// Initialize all table values as 0
memset(table, 0, sizeof(table));
// Base case (If given value is 0)
table[0] = 1;
... | ALGO | 0.999709 | 5.051913 |
70828bb0-316e-43e6-b633-5947afcbe22b | 42somoim/42somoim4 | junhypar/2.DP1주차/2.2XNtile_2.cpp | #include <iostream>
int pivo(int a)
{
if (a==1)
return(1);
else if (a==2)
return(2);
else
return((pivo(a-1)+pivo(a-2))%10007);
}
int main()
{
int a;
std::cin >> a;
std::cout << pivo(a);
}
| ALGO | 0.998614 | 4.286564 |
b042cd49-d7b4-42b7-b7b2-ecb93cc4e806 | GMIOS01/HBT | qlynv.cpp | #include <iostream>
#include <vector>
#include <map>
#include <string>
using namespace std;
struct Employee {
string name;
int birthYear;
int yearsWorked;
double salaryCoefficient;
};
int main() {
int n, q;
cin >> n >> q;
vector<Employee> employees(n);
map<string, int> nameCount;
... | ALGO | 0.997869 | 4.414493 |
311e4008-4f8f-4fd2-ae6e-a79dc946dbc1 | GauthamPrabhuM/LeetCode | 92-reverse-linked-list-ii/92-reverse-linked-list-ii.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverseBetw... | ALGO | 0.999998 | 5.648861 |
89966234-eca7-49d6-b0e8-8ff4df22bd38 | LJ-hyeok/Algorithm_with_C | 2021/UnionFind/공항_2.cpp | #include<iostream>
using namespace std;
int G,P;
int p[100005];
bool c[100005];
int lo = 1;
void find(int x){
if(!c[x]){
lo = x;
return;
}
find(x+1);
}
int main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);
int cnt = 0;
cin >> G >> P;
for(int i=1;i<=P;i++) cin >> p[i];
for(int i=1;i<=P;i++){
int cur ... | ALGO | 0.999874 | 3.163217 |
05571936-a70e-48ea-bfd8-a2ed46ba410f | rosekamallove/problem-solving | practice/cf/A/A-ColoutTheFlag.cpp | #include "bits/stdc++.h"
using namespace std;
#define int long long
#define endl "\n"
#define all(x) x.begin(),x.end()
#ifndef ONLINE_JUDGE
#define deb(x) cerr<<#x<<"=>"; _print(x); cerr<<endl;
#else
#define deb(x)
#endif
void fastIO();
template<typename T>void _print(T n);
template<class T>void _print(vector<T>v);
... | ALGO | 0.999913 | 3.919659 |
87b9addb-6052-4688-9e64-bb9b7bff0825 | hansenidden18/gem5 | src/systemc/tests/systemc/misc/user_guide/chpt11.7/mean.cpp | /*****************************************************************************
mean.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.999534 | 4.447187 |
a37eb5ca-5520-4b89-95e4-ddeae6dec924 | MANISHDUTT224/LeetCode | 2681-put-marbles-in-bags/2681-put-marbles-in-bags.cpp | class Solution {
public:
long long putMarbles(vector<int>& weights, int k) {
int n=weights.size();
vector<int>pairweights(n-1,0);
for(int i=0;i<n-1;i++){
pairweights[i]=weights[i]+weights[i+1];
}
sort(pairweights.begin(),pairweights.end());
long long answe... | ALGO | 0.999918 | 5.309445 |
e940b771-2b60-499c-8c11-7d87b6f27240 | lubiluk/braitenberg-vehicles | cocos2d/cocos/base/ZipUtils.cpp | // FIXME: hack, must be included before ziputils
#ifdef MINIZIP_FROM_SYSTEM
#include <minizip/unzip.h>
#else // from our embedded sources
#include "unzip.h"
#endif
#include "base/ZipUtils.h"
#include <zlib.h>
#include <assert.h>
#include <stdlib.h>
#include "base/CCData.h"
#include "base/ccMacros.h"
#include "platfo... | TOOL | 0.902339 | 6.689685 |
fa410f9b-1437-452b-8a0b-328e78649a40 | itsvishalcodes/Leetcode-Solutions | 733-flood-fill/flood-fill.cpp | class Solution {
public:
void fill(vector<vector<int>>& image, int sr, int sc, int *color, int *currColor, set<pair<int, int>>& visited) {
if(sr<0 || sr>=image.size() ||
sc<0 || sc>=image[0].size() ||
visited.find(make_pair(sr, sc))!=visited.end() ||
image[sr][sc] != *currColor
) {
r... | ALGO | 0.988885 | 6.546661 |
a74ed8df-c601-49f4-be0d-2d6d3c0f2e47 | STEllAR-GROUP/hpx | libs/core/command_line_handling_local/src/parse_command_line_local.cpp | #include <hpx/command_line_handling_local/config/defines.hpp>
#include <hpx/command_line_handling_local/parse_command_line_local.hpp>
#if defined(HPX_COMMAND_LINE_HANDLING_HAVE_JSON_CONFIGURATION_FILES)
#include <hpx/command_line_handling_local/json_config_file.hpp>
#endif
#include <hpx/datastructures/any.hpp>
#include... | TOOL | 0.995085 | 5.034178 |
a80d1010-c381-4e26-be41-dd4c00314f2b | AndreaFinazzi/nif | src/common/nif_utils/src/cubic_spliner.cpp | #include "nif_utils/cubic_spliner.h"
CubicSpliner::CubicSpliner(std::vector<double>& points_x,
std::vector<double>& points_y)
: points_x_(points_x), points_y_(points_y) {
// ROS_DEBUG("Object of Spline Class was created");
assert(points_x_.size() == points_y_.size());
std::vector<do... | ALGO | 0.993703 | 5.286079 |
26621aa7-77fc-4a84-8f12-e8536835c7ba | psyche435/test | main.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
vector<int> num;
num.push_back(1);
num.push_back(2);
num.push_back(3);
for(vector<int>::iterator it=num.begin();it!=num.end();it++)
{
cout<<* it<<endl;
}
return 0;
} | ALGO | 0.99108 | 3.036822 |
b881a6e9-923c-4e28-a510-d89558bdbf0b | harshitadhaduk/firebaseDemo | 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.998784 | 6.761023 |
53a08781-4d80-47de-960c-05117d4a0f73 | Premkumar2312-pw/SkillRack | Daily Challenge/C++/Substring - First Occurrence 18.7.2025.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string s1, s2;
cin >> s1 >> s2;
int mn = s1.size(), mx = -1;
for (char c : s2) {
int pos = s1.find(c);
if (pos < mn) mn = pos;
if (pos > mx) mx = pos;
}
cout << s1.substr(mn, mx - mn + 1);
return... | ALGO | 0.999786 | 3.684246 |
1d9d92b5-9d17-410f-81a2-1ba0efdb0d3a | ishandutta2007/codeforces | thenymphsofdelphi/normal/520/A.cpp | #include<iostream>
#include<algorithm>
#include<ctype.h>
using namespace std;
int main(){
int n, i, x;
cin >> n;
string a;
cin >> a;
if (n < 26){
cout << "NO";
return 0;
}
bool b[26];
for (i = 0; i < 26; i++){
b[i] = false;
}
for (i = 0; i < n; i++){
... | ALGO | 0.999994 | 4.088429 |
e463702c-7915-453d-a547-18f9aab15724 | JonathanYuan23/DMOJ-Solutions | Solutions/ecoo19r3p1.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize "Ofast"
#define ll long long
#define MOD 1000000007
#define fi first
#define se second
#define INF 0x3f3f3f3f
#define MAXN 1000005
#define pb push_back
#define LSB(S) (S & (-S))
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<i... | ALGO | 0.999666 | 3.425581 |
4fc30b0a-7db0-46ef-8416-6963b7bc33f6 | durgeshkk/Codeforces-Contests | Contest #553(DIV 2)/C_Problem_for_Nazar.cpp | //CELEBRATING SEMIANNIVERSARY OF DADDY_DYNAMO!!
#include<bits/stdc++.h>
#include<iomanip>
#include <deque>
#include <bitset>
#include <cstdint>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//#define ordered_set tree<int, null_type,less<in... | ALGO | 0.99986 | 3.961879 |
6b557825-22c6-4150-8e70-112e2255f06e | mvancompernolle/ai_project | data/GoUctUtil.cpp | //----------------------------------------------------------------------------
/** @file GoUctUtil.cpp */
//----------------------------------------------------------------------------
#include "SgSystem.h"
#include "GoUctUtil.h"
#include <iomanip>
#include <iostream>
#include <boost/io/ios_state.hpp>
#include <boost... | ALGO | 0.984343 | 6.223044 |
319b59ab-d601-4ea4-b4de-e41bfcbcfce5 | 0-jij-0/CompetitiveProgramming | Problems Archive/0000 - 0999/0357 - Reachability From The Capital.cpp | #include <iostream>
#include <vector>
using namespace std;
struct edge {
int u, v; edge() {}
edge(int _u, int _v) :
u(_u), v(_v) {}
};
struct node { vector<edge> edges; };
struct graph {
vector<node> nodes[2];
vector<edge> edges;
int n, m;
graph(int _n) : n(_n) { nodes[0].resize(n); nodes[1].resize(n); }
... | ALGO | 0.999933 | 4.578701 |
6074f4d2-90ec-4d4a-9b65-27fec53c7ebf | tamim-kabir/C-plus-plus | vactor iterator/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<string> text{"Hello world"}, f{"ljdsfuif"};
auto beg = text.begin(), end = text.end();
auto mid = text.begin() + (end - beg)/2;
while(mid != end && *mid != f)
{
if(f < *mid)
end = mid;
else
... | ALGO | 0.998734 | 3.576317 |
90b2e097-1e68-43a7-91fe-849238ef6c51 | vfolunin/archives-solutions | MCCME/112146.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
double radius;
cin >> radius;
cout.precision(3);
cout << fixed <<... | ALGO | 0.994083 | 3.626991 |
39148971-58dc-4a6a-a2ff-0730220560d0 | ShivanshGupta02/DSA | 115-distinct-subsequences/115-distinct-subsequences.cpp | class Solution {
// TC : O(N*M) // N -> t.size() ; M -> s.size()
// SC : O(N*M)
public:
int numDistinct(string s, string t) {
vector<vector<unsigned long>>dp(t.size(),vector<unsigned long>(s.size()));
dp[0][0] = (s[0]==t[0]);
for(int i=0;i<t.size();... | ALGO | 0.999982 | 6.643677 |
1d317081-fb1a-4e1d-aaf6-ac9c38803fd2 | EDHE08232001/CSI2372Files | LabAssignments/Assignment2_300176553/Ex1/Ex1.cpp | #include <iostream>
using namespace std;
int main(void){
int tab[10]; //declares an array of 10 integers with undefined values
int* p; //declare a pointer p that can point to an integer
for (int t = 0; t < 10; t++){ // this loop intializes each element of the array tab with the square of its index
tab[t] = t ... | ALGO | 0.99229 | 3.713925 |
6660616f-5d1c-4e76-97e0-3e0788c225aa | ztg-666/algorithm | algorithm/Dynamic planning/Two-dimensional/LongestIncreasingPath.cpp | #include <vector>
#include <algorithm> // 包含 std::max
#include <iostream> // 可选:用于测试/调试
// 使用标准命名空间以简化代码(可选)
using namespace std;
// 矩阵中的最长递增路径
// 给定一个 m x n 整数矩阵 matrix ,找出其中 最长递增路径 的长度
// 对于每个单元格,你可以往上,下,左,右四个方向移动
// 你 不能 在 对角线 方向上移动或移动到 边界外(即不允许环绕)
// 测试链接 : https://leetcode.cn/problems/longest-increasing-path-in... | ALGO | 0.999977 | 6.721973 |
44a935a5-def0-4a2b-a98e-137c994b0584 | ishandutta2007/codeforces | anandoza/normal/1469/E.cpp | #include <bits/stdc++.h>
using namespace std;
// clang-format off
// template {{{
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define resz resize
#define sz(x) int((x).size())
#define all(x) (x).... | ALGO | 0.999957 | 4.729748 |
880b3ab2-5b59-4318-b48b-e6e94672a277 | cout/clemson | thesis/spantree/biname.cpp | #include <list>
#include <algorithm>
#include <iterator>
#include "biname.h"
// Strictly speaking, in a biname, a 0 indicates going down a level,
// and a 1 indicates going up a level. In this implementation, we are
// using the opposite representation. This would result in the maxtree
// if we were to use the compa... | ALGO | 0.987821 | 4.56737 |
301d4570-447f-4669-b748-3637cb862702 | dampers/algorithm | 12780.cpp | #include <bits/stdc++.h>
#define swap(a,b) (a)^=(b)^=(a)^=(b)
#define endl '\n'
using namespace std;
typedef long long lld;
char s[100002];
char a[12];
int main()
{
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
scanf(" %s %s", s, a);
int len = strlen(s);
int alen = strlen(a);
int cnt = 0;
for(... | ALGO | 0.999426 | 3.436874 |
b54d88a6-8401-4afe-be18-b746c62eabc8 | Dipti821/DSA_Questions | 88-merge-sorted-array/88-merge-sorted-array.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
// Method 1 sorting algo
// Method 2 insertion sort algo SC: O(1)
// Method 3 gap algo TC: O((N+M)LOG(N+M)) SC: O(1)
// int nextGap(int gap)
// {
// if (gap <= 1)
// ... | ALGO | 0.999979 | 5.484446 |
502cf834-8203-46dd-a2a8-1869efb0e8e3 | uzairakram0/CPPprograms | Project3/main.cpp | /************************************************************
main.cpp
Uzair Akram
ReadMe: compile on cse machine using the following command:
g++ -std=c++11 main.cpp
Run executable using:
./a.out
************************************************************/
#include <iostream>
#include <string>
#include <fstre... | ALGO | 0.985358 | 5.429224 |
0a0629ed-6c8f-4ace-bfa7-e8635788bc33 | AZCPCF/quera | 00000593/index.cpp | #include <iostream>
using namespace std;
bool isPrime(int x) {
if (x <= 1) return false;
for (int i = 2; i * i <= x; i++) {
if (x % i == 0) return false;
}
return true;
}
int main() {
int n, sum = 0, b = 0;
cin >> n;
int temp = n;
while (temp > 0) {
sum += t... | ALGO | 0.999963 | 5.050108 |
10273055-9b49-4e8b-a578-5237c869171a | jvm-coder/Hacktoberfest2022_aakash | CPP/Depth_First_Search_using_recursion.cpp | #include <bits/stdc++.h>
using namespace std;
int visited[7] = {0, 0, 0, 0, 0, 0, 0};
int graphmapping[7][7] = {
{0, 1, 1, 1, 0, 0, 0},
{1, 0, 0, 1, 0, 0, 0},
{1, 1, 0, 1, 1, 0, 0},
{1, 0, 1, 0, 1, 0, 0},
{0, 0, 1, 1, 0, 1, 1},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 1, 0, 0}};
void DFS(int va... | ALGO | 0.99992 | 4.006083 |
60b16755-44b7-4f3a-9246-7206f657261b | ibsson/Program | BKJN/누적 합/20250124_bkjn_2003(수들의 합 2)(투 포인터).cpp | #include <iostream>
using namespace std;
#define MAX 10001
int A[MAX];
int N, M, cnt;
int main(void) {
cin >> N >> M;
for (int i = 0; i < N; i++) {
cin >> A[i];
}
int start = 0, end = 0;
int result = A[0];
while (start <= end && end < N) {
if (result < M) {
result += A[++end];
}
else if (result ... | ALGO | 0.999995 | 3.96038 |
f8a62185-45eb-4ca4-be1e-3c43f96c1625 | hssik508/baekjoon | 2024/2408/13305.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
vector<pair<long long, long long>> v(n + 1); // <1리터당 가격, 다음도시까지 거리>
for (int i = 1; i < n; i++)
{
cin >> v[i].second;
}
for (int i = 1; i <= n; i++)
{
... | ALGO | 0.99992 | 3.373136 |
9d482cdc-6dc0-46e0-869c-19ce6f664a17 | KKyzm/leetcode | cpp/0015.3sum/solution.cpp | // Created by Yaniru at 2023/10/16 22:30
// leetgo: dev
// https://leetcode.cn/problems/3sum/
#include "LC_IO.h"
#include <bits/stdc++.h>
#include <tuple>
using namespace std;
// @lc code=begin
class Solution {
public:
vector<vector<int>> threeSum(vector<int> &nums) {}
};
// @lc code=end
int main() {
ios_base:... | ALGO | 0.99963 | 6.1719 |
f4e7e756-c605-4877-8f40-c597ff8f97c6 | Jiwan/RADS | thirdparty/boost/libs/graph/example/girth.cpp | /*
Adapted from the GIRTH program of the Stanford GraphBase.
Sample output:
This program explores the girth and diameter of Ramanujan graphs.
The bipartite graphs have q^3-q vertices, and the non-bipartite
graphs have half that number. Each vertex has degree p+1.
Both p and q should be odd prime numbers;
... | ALGO | 0.999783 | 5.480107 |
61b84f63-dac1-4032-8e01-2ca5de04c792 | yuanwangshui/Capstone-project | 代码/opencv/opencv_contrib-3.4.18/modules/phase_unwrapping/src/histogramphaseunwrapping.cpp | #include "precomp.hpp"
namespace cv {
namespace phase_unwrapping {
class CV_EXPORTS_W HistogramPhaseUnwrapping_Impl : public HistogramPhaseUnwrapping
{
public:
// Constructor
explicit HistogramPhaseUnwrapping_Impl( const HistogramPhaseUnwrapping::Params ¶meters =
... | ALGO | 0.999233 | 3.440134 |
294e3416-2243-4f7c-8d7b-70e12f3cd1ab | IsabelMelendezz/Repositorio_TareasP2k24 | LaboratorioIII_Programacion/4.5 Suma de enteros (1-10)/main.cpp | #include <iostream>
using namespace std;
int main()
{
unsigned int suma=0;
unsigned int x=1;
while (x<=10){
suma+=x;
x++;
}
cout << "La suma es: "<< suma<< endl;
return 0;
}
| ALGO | 0.984518 | 3.51409 |
cbba6afc-c464-4b93-a6f2-13fe7c7e95e8 | thegamer1907/Code_Analysis | Graphs/1417.cpp | // start of CP 2.0
#include <bits/stdc++.h>
//____By:sirjan13____
#define ll long long int
#define ld long double
#define mod 1000000007
#define mod1 mod
#define mod2 100000009
#define show(a) for(int i=0;i<a.size();i++) cout<<a[i]<<" ";
#define fi first
#define se second
#define vi vector<int>
#define vs v... | ALGO | 0.999997 | 3.660667 |
fdfc7f74-1298-41a0-bdac-c151b6cd635e | WebDevDibbo/DS_Algo | String/2375. Construct Smallest Number From DI String.cpp | //* submitted at Feb 18, 2025 19:21
//? TC --> O(N) SC --> O(N)
class Solution {
public:
string smallestNumber(string pattern) {
int n = pattern.size();
string ans;
int num = 1;
stack<char>st;
for(int i=0; i<=n; i++)
{
... | ALGO | 0.999901 | 6.105253 |
97dbdaa0-fa53-4265-b595-0878309f533c | sumitkumar16dec/LeetCode | 0146-lru-cache/0146-lru-cache.cpp | class LRUCache {
public:
class node{
public:
int key, val;
node *next, *prev;
node(int key_, int val_){
key = key_;
val = val_;
}
};
void addnode(node *toadd){
node *temp= head->next;
head->next= toadd;
toadd->prev= head;... | ALGO | 0.999424 | 6.371784 |
6d733bf7-b18a-4591-a1ac-ee898aa049cf | weslse/WesLeet | WesLeet/1266.cpp | /*
* Solved by Weslse
* 2020.07.05
*/
// Problem
// 1266. Minimum Time Visiting All Points
// On a plane there are n points with integer coordinates points[i] = [xi, yi].
// Your task is to find the minimum time in seconds to visit all points.
// You can move according to the next rules :
// In one second ... | ALGO | 0.99998 | 5.70287 |
b838f17c-41dd-490d-ab14-a76651ba8030 | dimitarpg13/cpp_testcode | ConcurrencyInAction/src/ConcurrencyInAction.cpp | #include <iostream>
#include <thread>
#include <pthread.h> // for the pthread example
#include <string>
#include <numeric> // for std::accumulate
#include <vector>
#include <algorithm> // for std::for_each
#include <list>
#include <mutex>
#include <deque>
#include <stack>
#include <functional>
#include <memory>
#includ... | TOOL | 0.894909 | 4.530067 |
d18248e0-8c16-4499-b4c3-8f6743235a42 | shrai31/C-solution | arrayLowerBound.cpp | #include<iostream>
using namespace std;
int binarySearch(int arr[], int n, int elem){
int start = 0, end = n-1;
while(start <= end ){
int mid = (start+end)/2;
if(arr[mid] == elem){
return mid; }
else if(arr[mid] > elem){
end = mid-1;
}
else{... | ALGO | 0.999979 | 5.449046 |
b86161bd-7c61-40e6-994d-f1af70a51ada | zhiweigan/randomized-splay-trees | trees/even.cpp | #include "trees.h"
using namespace std;
void EvenSplayTree::AccessSplay(s* x) {
while (x->parent) {
if (x->parent->left == x) {
if (x->parent->parent->left == x->parent) {
R_Rotate(x->parent->parent);
R_Rotate(x->parent);
} else {
R_R... | ALGO | 0.999996 | 3.21042 |
13427a9a-6d33-4684-a764-3ce5d5ab33d2 | Sejalkathane/Complete_dsa_cpp | Array/14_stock_buy_and_sell.cpp | #include <iostream>
using namespace std;
// Efficent solution
// int maxprofit(int price[],int n)
// {
// int profit=0;
// for(int i=1;i<n;i++)
// if(price[i]>price[i-1])
// profit+= (price[i]-price[i-1]);
// return profit;
// }
int maxprofit(int price[], int n)
{
int profit = 0;
... | ALGO | 0.997713 | 5.109069 |
7aad8cb4-b1c5-496d-ac9d-7ab8d49f3545 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4003_5.cpp | #include <bits/stdc++.h>
using namespace std;
const int Maxn = 400005, mod = 998244353;
int n, m, f[Maxn], g[Maxn];
int Pow(int x, int k) {
int ret = 1;
while (k) {
if (k & 1) ret = (long long)ret * x % mod;
k >>= 1;
x = (long long)x * x % mod;
}
return ret;
}
void ntt(int *a, int p, int f) {
stat... | ALGO | 0.999987 | 3.824907 |
bc23dbe2-3aa5-4316-8383-beeb89416b71 | ishandutta2007/codeforces | risujiroh/normal/1450/B.cpp | #include <bits/stdc++.h>
#pragma region my_template
struct Rep {
struct I {
int i;
void operator++() { ++i; }
int operator*() const { return i; }
bool operator!=(I o) const { return i < *o; }
};
const int l_, r_;
Rep(int l, int r) : l_(l), r_(r) {}
Rep(int n) : Rep(0, n) {}
I begin() const... | ALGO | 0.999887 | 4.692729 |
e8fc6796-780d-4f48-9d1f-b144a8ea21c5 | HardenedBSD/hbsdfw-ports-mirror | graphics/nurbs++/files/patch-nurbs_sp.cpp | --- nurbs/nurbs_sp.cpp.orig Mon May 13 14:07:46 2002
+++ nurbs/nurbs_sp.cpp Fri Dec 1 00:46:20 2006
@@ -41,7 +41,7 @@
*/
template <class T, int N>
void NurbsCurveSP<T,N>::updateMaxU() {
- if(deg_>3){
+ if(this->deg_>3){
#ifdef USE_EXCEPTION
throw NurbsInputError();
#else
@@ -51,10 +51,10 @@
#endif
}
... | ALGO | 0.999518 | 7.302486 |
0d5357d4-3558-459a-9ff5-9e128b8b0fd5 | AndrewAllenPi/CodeChef_Easy | AmbiguousPermutations.cpp | #include <cstdio>
#include <vector>
void printVect(std::vector<int> &vect){
for(int i = 0; i < vect.size(); ++i)
{
if(i != vect.size() - 1)
printf("%i", vect[i]);
else
printf("%i\n", vect[i]);
}
}
void readIn(std::vector<int> &vect){
for(int i = 0; i < vect.size(... | ALGO | 0.99912 | 3.805116 |
16287c43-a075-4fd6-938d-7db2d37c90ce | li924579/ACM | 2015暑假集训/DAY-23+24/F.cpp | const int INF=0x3f3f3f3f;
const int MOD=1e9+7;
const double eps=1e-9;
const double pi=acos(-1);
typedef long long ll;
using namespace std;
string s,t;
int n,dp[1010][10][10];
// dp[i][j][k] ʾtǰi-1Ѿƥãjsеikǵi+1
int dfs(int d,int d1,int d2){
int &ans=dp[d][d1][d2];
if (ans>=0) return ans;
if (d==s.size()) return 0;... | ALGO | 0.999451 | 4.329462 |
379a2914-f937-4cb9-9e45-221762d0eb9a | NinjaOS/frameworks_av | media/libstagefright/codecs/amrnb/common/src/residu.cpp | /*
Pathname: ./audio/gsm-amr/c/src/residu.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template used to PV coding template. First attempt at
optimizing code.
Description: Deleted stores listed in the Local Stores Needed/Modified... | ALGO | 0.999934 | 3.810766 |
5424102a-ccc9-4fb3-9e6a-643326a22289 | alexandraback/datacollection | solutions_2751486_0/C++/Tiwalun/proba.cpp | #include<cstdio>
#include<iostream>
using namespace std;
bool isCon(char c) {
if (c == 'a') return false;
if (c == 'e') return false;
if (c == 'i') return false;
if (c == 'o') return false;
if (c == 'u') return false;
return true;
}
bool hasCons(string sub, int n) {
int c = 0;
//cout << "Checking str... | ALGO | 0.998628 | 4.897713 |
a98c034b-0bc4-40c4-83f9-99cc21cbe0fb | SarbajitPbappy/CF | 1295A-DisplayTheNumber.cpp | #include <cstdio>
int main(){
long t; scanf("%ld", &t);
while(t--){
long n; scanf("%ld", &n);
if(n & 1){printf("7"); n -= 3;}
for(long p = 0; p < (n / 2); p++){printf("1");};
puts("");
}
return 0;
}
| ALGO | 0.999804 | 3.419539 |
2ec69818-73b6-4bcd-9b3f-91778825cd72 | omermerm/AdventOfCode | 2015/Day3B.cpp | #include <iostream>
#include <fstream>
#include <set>
using namespace std;
void updateLoc(pair<int, int> * loc, char c) {
switch (c)
{
case '>':
(*loc).first += 1;
break;
case '<':
(*loc).first -= 1;
break;
case '^':
(*loc... | ALGO | 0.999934 | 5.320098 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.