uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
93b157ec-02b0-4f05-94b8-acd18e9f5d58 | RZXQ/cpp | TCTM/Regular_Courses/Level_1/code/LESSON_20/02_作业及解析/作业代码/01_数1的个数.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int cnt = 0;
for (int i = 1; i <= n; i++) {
int m = i;
while (m != 0) {
if (m % 10 == 1) cnt++;
m /= 10;
}
}
cout << cnt;
return 0;
}
| ALGO | 0.999556 | 4.671876 |
6623a56f-703a-4ab3-92c8-fd2071b0f32b | abdullah-124/xpsc | Week-10/day-6/B_Olya_and_Game_with_Arrays.cpp | #include<bits/stdc++.h>
#define fastread() {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
#define ll long long
using namespace std;
void solve(){
int n; cin>>n;
int fst = INT_MAX,sec = INT_MAX;
ll ans = 0;
for(int c=0;c<n;c++){
int m; cin>>m;
int a[m];
for(int i=... | ALGO | 0.999757 | 3.766009 |
4d8597c9-fbe4-4837-8f88-078dfc58feab | ShiloDenis1997/MPI_labs | lab2/server.cpp | #include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <stdlib.h>
#include <sys/sem.h>
#include <stdio.h>
#include <unistd.h>
#define SHMSZ 255
#define SHMKEY 5679
#define SEMWKEY 42
#define SEMRKEY 56
int InitSemaphore(int startValue, int semKey)
{
int id = semget(semKey, 1, 0666 | IPC_CREAT);
... | TOOL | 0.860902 | 4.13232 |
00c2492f-77dc-40f5-b139-4eacb9de6dce | dhritisaini/leetcode | ugly number.cpp | class Solution {
public:
int nthUglyNumber(int n) {
if(n<=0)
return 0;
if (n==1)
return 1;
int p2=0,p3=0,p5=0;
vector<int> v(n);
v[0]=1;
for(int i=1;i<n;i++)
{
v[i]=min(v[p2]*2,min(v[p3]*3,v[p5]*5));
if(v[i]==v[p... | ALGO | 0.99999 | 6.08987 |
ad5e0ac4-611d-4fe2-a152-9629edc1a2e7 | SyedaShafi/Algorithm_Phitron | module_20(assignment 3)/buildings.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int N = 1e5 + 5;
int parent[N];
int parentSize[N];
ll cost = 0;
class Edge
{
public:
int a, b, w;
Edge(int a, int b, int w)
{
this->a = a;
this->b = b;
this->w = w;
}
};
bool cmp(Edge a, Edge b)
{
r... | ALGO | 0.999906 | 4.658158 |
3035d65e-9349-4d9e-bfc4-6df219c85305 | ZionArizona/Baekjoon-CPP | 프로그래머스/unrated/181934. 조건 문자열/조건 문자열.cpp | #include <string>
#include <vector>
using namespace std;
int solution(string ineq, string eq, int n, int m) {
int answer = 0;
if(ineq == "<"){
if(eq == "="){
if(n <= m)
return 1;
else
return 0;
}
else if(eq == "!"){
if... | ALGO | 0.999927 | 3.998135 |
fcb46cff-61b4-41aa-9a89-f5c6d7951881 | bagladivyang03/Data-structures-and-algorithms | Linked Lists/7.cpp | //Given a linked list of N nodes. The task is to check if the linked list has a loop. Linked list can contain self loop.
// { Driver Code Starts
// driver code
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node* next;
Node(int val)
{
data = val;
next = NUL... | ALGO | 0.99929 | 4.481219 |
269fc101-7402-434f-a0f4-6f4d3734a986 | Xerox563/Codeforces | Stack-Queue/Conversion/infix-prefix.cpp | #include <bits/stdc++.h>
using namespace std;
// Priority Check
int priority(char ch)
{
if (ch == '^')
{
return 3;
}
else if (ch == '*' || ch == '/')
{
return 2;
}
else if (ch == '-' || ch == '+')
{
return 1;
}
else
{
return -1;
}
}
/* Func... | ALGO | 0.999966 | 5.369307 |
d53ac4ed-0b70-4ba5-8393-23846db96ee8 | mit-dci/opencbdc-tx | tools/bench/atomizer-cli-watchtower.cpp | #include "uhs/atomizer/atomizer/atomizer_raft.hpp"
#include "uhs/atomizer/atomizer/block.hpp"
#include "uhs/atomizer/atomizer/format.hpp"
#include "uhs/atomizer/watchtower/client.hpp"
#include "uhs/atomizer/watchtower/watchtower.hpp"
#include "uhs/sentinel/client.hpp"
#include "uhs/transaction/messages.hpp"
#include "u... | TOOL | 0.918466 | 6.227811 |
f3338614-d3f9-4f1d-b023-077fb8b91169 | Altudy/solutionheejoon | 백준/12842_튀김 소보루.cpp | # 1. 내가 풀었던 코드, 비효율
#include <iostream>
#include <vector>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int n, s, m;
cin >> n >> s >> m;
int eat = n - s;
vector<int> time(m);
for (int i = 0; i < m; i++)
cin >> time[i];
int ans(0);
for(int i=0; i<100000; i++)
... | ALGO | 0.999989 | 3.942544 |
1a4e27d4-64fb-4753-80cf-7aef8b4abd24 | luckyIITR/dsa450solved | Array/Find the contiguous sub-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
// arr: input array
// n: size of array
// Function to find the sum of contiguous subarray with maximum sum.
// long long maxSubarraySum(int arr[], int n)
// {
// int i = 0, j = ... | ALGO | 0.999671 | 6.440133 |
f3540b24-5917-49e9-a523-0333f486b435 | yfuka86/pc | atcoder/abc4old/abc005/c/abc005_3.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define rep_r(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define rep2(i,sta,n) for(ll i=sta;i<(ll)(n);i++)
#define rep2_r(i,sta,n) for(ll i=(ll)(n)-1;i>=sta;i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define mp ... | ALGO | 0.999966 | 4.994305 |
5858afef-98e7-4b66-b648-9b7f68a4c310 | ellenmellon/ReQuest | code/Model/eigen-3.2.5/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
Eigen::VectorXf v(4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
v << 0,1,2,3;
//add v to each row of m
mat.rowwise() += v.transpose();
std::cout << "Broadcasting result: " << std::... | ALGO | 0.996292 | 4.259387 |
d7f77d34-aa97-42b5-8c23-90a560dd70fc | yatinghan/game_of_civilization | GoL/cudamain.cpp | #include "gameOfLifeCuda.h"
#include "gameOfLifeSequential.h"
#include "timing.h"
#include <iostream>
#include <unistd.h>
#include <cstdlib>
using namespace std;
int main(int argc,char* argv[]) {
int count = -1;
int width = 50;
int height = 50;
int printcuda = 0;
int opt;
while ((opt = ... | ALGO | 0.984379 | 4.938252 |
03ea06be-484e-4f6a-bb15-dfda10cf7ed5 | vita-epfl/GEM | pseudo_labeling_pipeline/trajectory_inference/droid_trajectory/droid_slam/thirdparty/eigen/bench/geometry.cpp |
#include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace std;
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 8
#endif
typedef SCALAR Scalar;
typedef NumTraits<Scalar>::Real RealScalar;
typedef Matrix<RealScalar,Dynamic,Dynamic> A;
type... | ALGO | 0.942026 | 5.941502 |
7379e825-dca0-4533-a928-9be6fd4fc009 | bulletphysics/bullet3 | src/Bullet3OpenCL/BroadphaseCollision/b3GpuGridBroadphase.cpp |
#include "b3GpuGridBroadphase.h"
#include "Bullet3Geometry/b3AabbUtil.h"
#include "kernels/gridBroadphaseKernels.h"
#include "kernels/sapKernels.h"
//#include "kernels/gridBroadphase.cl"
#include "Bullet3OpenCL/Initialize/b3OpenCLUtils.h"
#include "Bullet3OpenCL/ParallelPrimitives/b3LauncherCL.h"
#define B3_BROADPHA... | ALGO | 0.970013 | 6.475483 |
12f075a3-d528-495c-90e0-4a65eae31f06 | Huntsama/COAP-and-DTLS | arch/cpu/gecko/lib/gecko_sdk/util/third_party/openthread/src/core/thread/link_metrics.cpp | /**
* @file
* This file includes definitions for Thread Link Metrics.
*/
#include "link_metrics.hpp"
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
#include "common/code_utils.hpp"
#include "common/encoding.hpp"
#include "common/instance.hpp"
#includ... | TOOL | 0.857854 | 5.090836 |
3ab98792-03cc-4c08-84fb-d5bfa4d3caa7 | Divesh1602/Leetcode | 1004-max-consecutive-ones-iii/1004-max-consecutive-ones-iii.cpp | class Solution {
public:
int longestOnes(vector<int>& nums, int k) {
int i=0;
int j=0;
while(j<nums.size()){
if(nums[j]==0)
k--;
if(k<0){
if(nums[i]==0)
k++;
i++;
}
j++;
}
... | ALGO | 0.999978 | 5.968595 |
b415080e-624f-4e02-944f-0adfc3c5e9c9 | TheRickyZhang/CompetitiveProgramming | Misc/Leetcode/447C.cpp | #include <bits/stdc++.h>
using namespace std;
#define tpl_ template
#define tn_ typename
#define cx_ constexpr
#define fn function
#define f(i, to) for (int i = 0; i < (to); ++i)
#define fe(i, to) for (int i = 1; i <= (to); ++i)
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define repr(i, a, b) for (int i = (... | ALGO | 0.999974 | 4.144938 |
81aec30c-25a1-476a-8061-38d8a7bea817 | adhirajChauhan/LPU_BTECH_PEP_2023 | B.tech PEP/DSA/Stacks/2_intro.cpp | #include <iostream>
using namespace std;
class Stack{
int* arr;
int top;
int size;
public:
Stack(){
arr = new int[size];
top = -1;
}
void push(int val){
if(top == size -1){
cout << "Stack Overflow" << endl;
return;
}
top++;
... | ALGO | 0.990445 | 4.490846 |
b74d9e71-e2b3-4de1-84dd-53f4ebd7ae56 | jtianling/blog-sample-code | 2010-10-12/sierpinski-gasket-recursive/main.cpp | /* recursive subdivision of triangle to form Sierpinski gasket */
/* number of recursive steps given on command line */
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include <stdlib.h>
/* initial triangle */
GLfloat v[3][2]={{-1.0, -0.58}, {1.0, -0.58}, {0.0, 1.15}};
int n = 15;
void t... | ALGO | 0.998484 | 6.443542 |
1613a6e3-f604-4eb2-beea-7d7c07e65df3 | ishandutta2007/codeforces | ooops_no/normal/1628/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ld long double
#define int long long
#define ll long long
mt19937 rnd(51);
signed main()
{
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#endif // LOCAL
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--... | ALGO | 0.999981 | 4.627682 |
86046d40-b616-4e64-8f59-be3605e34b47 | luz0415/Problem-Solving | 250814/수들 중 최솟값 최대화하기/maximin-of-numbers.cpp | #include <iostream>
#include <vector>
using namespace std;
int n;
int grid[10][10];
vector<bool> visited;
vector<int> nums;
int ans;
void SelectNum(int step)
{
if(step == n)
{
int min = 10000;
for(int num: nums)
{
min = min > num ? num : min;
}
ans = ans < m... | ALGO | 0.999929 | 5.023733 |
ee25bddb-e29c-4651-8cd5-49cd9b01495e | ishandutta2007/codeforces | ei133333/normal/920/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
struct UnionFindRange
{
vector< int > data;
vector< int > left, right;
UnionFindRange(vector< int > &vs)
{
data.assign(vs.size(), -1);
left = vs;
right = vs;
}
bool unite(int x, int y)
{
x = find(x), y = find(y);
... | ALGO | 0.999999 | 4.235422 |
2eeeebbc-426d-4558-bf5d-36c8e7b5f573 | Codechef-SRM-NCR-Chapter/30-DaysOfCode-March-2021 | answers/Archita/Day 16/Q2.cpp | #include <iostream>
using namespace std;
int indexof1(int arr[],int l,int n)
{
int mid;
mid=l+(n-l)/2;
while(l<n)
{
if(arr[mid]==0)
{
if(arr[mid+1]==1)
{
return mid+1;
break;
}
else
{
... | ALGO | 0.999934 | 5.000108 |
2acd7113-70ec-4a1a-bde4-4cdc5648c660 | Arunkumaryad/GFG-CODE | Easy/Remove all duplicates from a given string/remove-all-duplicates-from-a-given-string.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
string removeDuplicates(string str) {
// code here
string ans = "";
for(int i=0;i<str.size();i++) {
if(ans.find(str[i]) == string::npos) {
... | ALGO | 0.999767 | 6.528165 |
91f83dd8-e01a-4eb0-b695-63a3fd47672d | kartikeyasm/DSA | DP/houseRobber2.cpp | //https://www.naukri.com/code360/problems/house-robber_839733?interviewProblemRedirection=true&search=house%20rob&leftPanelTabValue=PROBLEM&count=25&page=1&sort_entity=order&sort_order=ASC&customSource=studio_nav
//Crete 2 answers 1st excluding 1st house and second excluding last house
/*
#include <bits/stdc++.h>
l... | ALGO | 0.99997 | 5.002068 |
dd579aa2-fbe7-4247-81a4-f3eea84faac1 | ismnitesh/Codes | codechef/goog0le04.cpp | #include <iostream>
#include <string.h>
#include <stdio.h>
using namespace std;
long long int CeilIndex(long long int A[], long long int l, long long int r, long long int key) {
long long int m;
while( r - l > 1 ) {
m = l + (r - l)/2;
(A[m] > key ? r : l) = m;
}
return r;
}
lon... | ALGO | 0.99997 | 4.094454 |
a8cdd35f-8a39-4f20-85dc-87d634c3530f | sumonmd/UVA-Problem-Solving | A. Holiday Of Equality.cpp | #include<bits/stdc++.h>
using namespace std;
int arr[1001];
int main()
{
vector<int>v;
int n,e;
int sum=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>e;
v.push_back(e);
}
sort(v.begin(),v.end());
for(int i=0;i<n;i++){
sum=sum+(v[n-1]-v[i]);
}
cout<<sum<<endl;
... | ALGO | 0.999934 | 3.257128 |
e7506437-6c18-4ba4-be9e-ea23ca97e595 | Datguyprasham/CompetitiveProgramming | Codeforces sol/723/C1.cpp | //dp, if(potion>0)->always select, if(potion<0)->option of max(selecting,not selecting)
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long int lli;
typedef vector<int> vi;
typedef vector<long long int> vlli;
#define pb push_back
#define pi 3.1415
const lli MOD= 1e9+7;
... | ALGO | 0.99998 | 4.412483 |
0f78c5a0-dd10-4a03-80d1-38162fe7c1a3 | DDejviDD/ASD2_Labo1_Ex1 | GraphFromImage.cpp | #include "GraphFromImage.h"
GraphFromImage::GraphFromImage(const bitmap_image& i) : image(i) {
}
GraphFromImage::Iterable GraphFromImage::adjacent(int v) const {
// renvoie une liste de sommets adjacents
Iterable adjList;
unsigned char r, g, b, r2, g2, b2;
image.get_pixel(x(v), y(v), r, g, b);
//pixe... | ALGO | 0.857104 | 3.880298 |
b59b5d3b-fef6-427f-80c0-0c562e9ec7de | Michael-M-aher/Selected-Topics-CS | Assigment 1/C - Smallestn't.cpp | #include <bits/stdc++.h>
#define FIO ios::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
typedef long double ld;
using namespace std;
const int N = 1e9;
const int mod = 1e9 + 7;
int main() {
FIO;
int n;
cin >> n;
vector<int> v(n);
for (auto &i : v) cin >> i;
sort(v.... | ALGO | 0.999977 | 3.951571 |
fa235716-209f-4fff-aef8-fa2df3b74ce5 | KJ202/RobotCleaner2 | src/qlearningLinearApprox.cpp | #include <numeric>
#include "../include/qlearningLinearApprox.hpp"
namespace cleaner{
qlearningLinearApprox::qlearningLinearApprox(world const& w, double epsilon, double learning_rate, double gamma, int episodes, int nbf) : w(w), epsilon(epsilon), learning_rate(learning_rate), gamma(gamma), episodes(episodes), NBF... | ALGO | 0.996223 | 3.513438 |
e6b8dd6c-298f-4a93-b9ec-ae9c6137316f | raincross7/code-similarity | codes/train_code/problem232/problem232_89.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
int n, x;
cin >> n;
map<ll, int> mp;
ll rui = 0;
ll ans = 0;
for(int i=0; i<n; ++i){
cin >> x;
rui += x;
ans += mp[rui];
++mp[rui];
}
ans += mp[0];
cout << ans << endl;
} | ALGO | 0.99994 | 3.883301 |
3976c8cc-0f5d-4654-8311-38b16dbff4c1 | varunsharma10/cpp | CodeForces/ER125Div2B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL);}
#define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
void solve()
{
ll n,b,x,y;
cin>>n>>b>>x... | ALGO | 0.999409 | 3.197956 |
f74904ce-711e-4ee8-a7b3-ff3527fcdeff | hieugiax145/DSA | DSA01001.cpp | #include<bits/stdc++.h>
using namespace std;
int n,a[1001];
void xuat(){
for(int i=0;i<n;i++) cout<<a[i];
cout<<endl;
}
void solve(string s){
for(int i=0;i<s.size();i++){
a[i]=s[i]-'0';
}
}
void sinh(){
int i=n-1;
while(a[i]==1){
a[i]=0;
i--;
}
a[i]=1;
}
int main(){
int t;
cin>>t;
while(t--){
string ... | ALGO | 0.999946 | 4.217008 |
90322a3d-5c53-48a6-9bba-7415948be4aa | Tanyabarsainya/100-Days-Of-Coding-Challenge | Day_63/ps.cpp | #include <iostream>
#include<limits.h>
using namespace std;
int isPal(int n){
int res=0;
int temp=n;
while(temp!=0){
int ld=temp%10;
res=res*10+ld;
temp=temp/10;
}
return res==n;
}
int main()
{
int x=789;
cout<<isPal(x);
return 0;
} | ALGO | 0.99962 | 3.56435 |
06e97da9-8254-40ae-b5b6-8ac989affba7 | RayLikesAnime/Coding-2 | A_Constructive_Problems.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
int mod=1e9+7;
int32_t main(){
int t;
cin>>t;
while(t--){
int n,m;
cin>>n>>m;
cout<<max(n,m)<<endl;
}
} | ALGO | 0.999534 | 4.697305 |
702daa16-8926-41af-98ae-82c27b1e6664 | 306470558/mb | third_party/WebKit/Source/web/ImageDecodeBench.cpp | #ifdef WTF
Provides a minimal wrapping of the Blink image decoders. Used to perform
a non-threaded, memory-to-memory image decode using micro second accuracy
clocks to measure image decode time. Optionally applies color correction
during image decoding on supported platforms (default off). Usage:
% ninja -C /out/Re... | TOOL | 0.898687 | 6.742032 |
ab6a746e-ebb8-4a71-95f0-45abcf826047 | nimendoza/noi-2023 | training/week-5/hackables/cards-a/DippleThree/207922430.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll solve(int n, vector<ll> a){
ll maxx = 0;
for (int i = 0; i < n; i++){
ll summ = 0;
ll mx = 0;
for (int j = i; j < n; j++){
summ += a[j];
mx = max(mx, a[j]);
maxx = max(maxx, summ ... | ALGO | 0.999835 | 4.876089 |
0c49992f-923c-4bbf-9988-58557e347cd7 | ashu15311/leetcode-cpp | 0292-nim-game/0292-nim-game.cpp | class Solution {
public:
bool canWinNim(int n) {
if(n%4==0){
return 0;
}
else
return 1;
}
}; | ALGO | 0.999838 | 5.758187 |
9748e9be-4501-435a-9b53-61e6a9475987 | raincross7/code-similarity | codes/train_code/problem479/problem479_329.cpp | #include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int mod=1e9+7;
const int INF=1001001001;
in... | ALGO | 0.999963 | 4.633435 |
932449b7-687b-45f0-b052-ef269c8e8f29 | dddwqy/Code | temp.cpp | #include<stdio.h>
#include<math.h>
int main()
{
int n;
scanf("%d",&n);
double i=1.0;
double q=1.0;
double s=1.0;
double sum=0.0;
while(1)
{
q=s/i;
sum+=q;
s=-1.0*s;
i=i+2;
if((1/i)<=pow(0.1,n))
{
break;
}
}
sum=4*sum;
printf("%lf\n",sum);
return 0;
... | ALGO | 0.999341 | 3.013948 |
2e429a8f-06d4-4393-a4d7-084d1a80c01f | Prithvi1254/LeetcodeSolutionsPrithvi | 2285.cpp | class Solution {
public:
long long maximumImportance(int n, vector<vector<int>>& roads) {
vector<long long>store(n,0);
for(auto x:roads){
store[x[0]]++;
store[x[1]]++;
}
sort(store.begin(),store.end());
long long ans=0;
int temp=n;
for(... | ALGO | 0.999919 | 5.477913 |
2a6fb797-dc88-43cb-a05c-ce2b19f957a9 | UdayKiran112/Android_Set_1 | src/Android_Set_1/Q2/cpp/HashMap.cpp | #include <iostream>
#include <vector>
#include <sstream>
using namespace std;
class MyHashMap
{
private:
static const int BUCKET_SIZE = 1009;
vector<pair<int, int>> table[BUCKET_SIZE];
int hash(int key)
{
return key % BUCKET_SIZE;
}
public:
MyHashMap() {}
void put(int key, int va... | ALGO | 0.976871 | 4.868252 |
2638e932-7607-42c5-856d-164d61cd85fe | osiris123/WoWCircle434 | src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp | /* ScriptData
SDName: mob_anubisath_sentinel
SD%Complete: 95
SDComment: Shadow storm is not properly implemented in core it should only target ppl outside of melee range.
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "WorldPacket.h"
#include "Item.h"
#i... | TOOL | 0.90866 | 5.86302 |
4221aaf5-1721-4176-a12e-bd890b3827b0 | InfiniteTree/PEE_2023 | CS/408/course_coding/数据结构/第三章.栈和队列/Stack.cpp | #include <iostream>
#define maxSize 100
// Update top of the stack when data into stack
// ###### Sequential Stack
typedef struct
{
int data[maxSize];
int top;
} SqStack;
// Linked Stack
typedef struct LNode
{
int data;
struct LNode *next;
} LNode;
/// Sequential Stack
// Innitialize stack
void initStack(SqStac... | ALGO | 0.985675 | 3.44152 |
6b6072a5-e902-4520-94d5-dea7f7ca5c46 | divyansh1511/CPP | COMPANIES/Amazon/AMAZON/19_valid_anagrams.cpp | #include<bits/stdc++.h>
using namespace std;
bool isanagram(string s , string t){
if (s.length() != t.length())
{
return false;
}
int count[26] = {0};
for (int i = 0; i < s.length(); i++)
{
count[s[i] - 'a']++;
count[t[i] - 'a']--;
}
for (int i = 0; i < 26; i++)
... | ALGO | 0.999945 | 4.353411 |
5bab638d-3aaf-4ebd-a030-6604867574bc | compiler-tree-technologies/cil | mlir/lib/Transforms/Vectorize.cpp | #include "mlir/Analysis/LoopAnalysis.h"
#include "mlir/Analysis/NestedMatcher.h"
#include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Analysis/Utils.h"
#include "mlir/Dialect/AffineOps/AffineOps.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/Dialect/VectorOps/VectorOps.h"
#include "mlir/Dialect/Vecto... | TOOL | 0.913658 | 7.589909 |
a0517fd7-0782-415d-ac3a-b16bf317945d | zj1081923/study | baekjoon/3190.cpp | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
int N, K, L;
// N: map 크기, K: 사과의 개수, L: 뱀의 방향변환 횟수
int map[101][101]{};
enum {UP, RIGHT, DOWN, LEFT};
// 왼쪽이면 -1 오른쪽이면 +1
int dirx[] = {-1, 0, 1, 0};
int diry[] = {0, 1, 0, -1};
typedef struct Snake{
Snake(int l, int d) : length(l), dir... | ALGO | 0.999927 | 3.57914 |
ca0478d0-a1cc-4cbb-87d6-f6100fc3aaf5 | deivyka/Cpp | Assignment/WorkingBackup.cpp | /*
1. Use vector
2. Reuse Point class to represent individual 3D points in the input
3. Update Point class with
*/
#include <iostream>
#include <algorithm> // For sort and next_permutation
#include <vector>
#include <math.h> // For calculateDist(sqrt and pow)
#include<fstream>
using namespace std;
class Point {
pub... | ALGO | 0.999289 | 4.831013 |
2ece6082-a448-4cc7-96e5-2a58a1fe3e33 | sgchoi5/algorithm_book_exam2 | ALDS1_7_D_Reconstruction_of_the_Tree.cpp | // ALDS1_7_D Reconstruction of the Tree
// https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_7_D
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int n, pos;
vector<int> pre, in, post;
void rec(int l, int r) {
if (l >= r) return;
int root = pre[pos++];... | ALGO | 0.999999 | 4.183474 |
f35dc699-69c5-40d5-80a1-b08eda37b316 | Kallaf/LeetCode | binary-watch.cpp | class Solution {
private:
int on(int n)
{
int res = 0;
for(int i=0;i<32;i++)
res += (n>>i)&1;
return res;
}
public:
vector<string> readBinaryWatch(int num) {
vector<int> ons(62);
for(int m=0;m<60;m++)
ons[m] = on(m);
vector<string> ... | ALGO | 0.999345 | 6.374134 |
c16bc58d-aab2-4112-8ab7-49efb3736adb | Xtra-Computing/Clementi | host/graph/graph.cpp | #include "graph.h"
#include <cstdlib>
#include <iostream>
#include <fstream>
void Graph::loadFile(
const std::string& gName,
std::vector<std::vector<id_t>> &data
)
{
std::ifstream fhandle(gName.c_str());
if (!fhandle.is_open()) {
HERE;
std::cout << "Failed to open " << gName << std::end... | ALGO | 0.877493 | 3.990586 |
556e81dc-3fbd-4786-8c6c-5cf5ce5a7f83 | Vector35/binaryninja-api | view/kernelcache/core/KernelCache.cpp | #include "KernelCache.h"
#include <regex>
#include <filesystem>
using namespace BinaryNinja;
std::pair<std::string, Ref<Type>> CacheSymbol::DemangledName(BinaryView &view) const
{
QualifiedName qname;
Ref<Type> outType;
std::string shortName = name;
if (DemangleGeneric(view.GetDefaultArchitecture(), name, outTyp... | TOOL | 0.904482 | 7.504869 |
2e070651-48fa-428a-9ef9-12c1766a0bb9 | amorilio/CExamples | Rand/Rand.cpp | // Rand.cpp: implementation of the Rand class.
//
//////////////////////////////////////////////////////////////////////
#include "Rand.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Rand::Ra... | ALGO | 0.991502 | 4.13212 |
3b83b94a-10c7-410a-aff4-1561cd8d3116 | divaibhav/p35cppcodes | 18july/division_by_user_input.cpp | #include <iostream>
using namespace std;
int main(){
int a,b,c,d,e,f;
cout << "enter 6 values" << "\n";
cin >>a>>b>>c>>d>>e>>f;
cout << "enter an integer value for division" << "\n";
double number1 = 0;
// taking the input
cin >> number1;
cout << "enter an integer value" << "\n";
dou... | ALGO | 0.919805 | 3.024338 |
c1751e3d-a3e2-4e53-9212-e7ed69da8374 | bmx-ng/b3d.mod | assimplib.mod/assimp/code/CalcTangentsProcess.cpp | /** @file Implementation of the post processing step to calculate
* tangents and bitangents for all imported meshes
*/
// internal headers
#include "CalcTangentsProcess.h"
#include "ProcessHelper.h"
#include "TinyFormatter.h"
#include "qnan.h"
using namespace Assimp;
// -------------------------------------------... | TOOL | 0.972421 | 4.383005 |
8f37eb2e-9cf5-41c9-8106-7f9fc31350e9 | WiseCoder24/leetcode-questions | 23 August to 1 September/removeDuplicatesFromList.cpp | /*
83. Remove Duplicates from Sorted List
Easy
Given the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well.
*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(... | ALGO | 0.999955 | 5.742726 |
4ed9a0a8-0dc5-4d6f-bbb0-5af15d3c1367 | Hiddenworld26/DSA_Questions | Arrays-2/lastoccurrence.cpp | #include<iostream>
using namespace std;
int main()
{
int x;
cout<<"Enter the size of array :\n";
cin>>x;
int arr[x];
cout<<"Enter the elements of array :\n";
for(int i=0;i<x;i++)
{
cin>>arr[i];
}
int target;
cout<<"Enter the element you want to be searched for :\n";
... | ALGO | 0.999488 | 3.992543 |
875f7a7f-b08f-464e-b540-429c1ee96455 | furkankurtoglu/whole-well | Overlap_Case/addons/dFBA/src/FBA_model.cpp | /*
* flux_balance_model.cpp
*
* Created on: 11 jun. 2019
* Author: mponce
*/
#include "FBA_model.h"
/* Default model used to initialize the initial cell */
FBA_model FBA_default_model;
FBA_model::FBA_model()
{
this->id = "None";
//this->lp_model = nullptr;
this->is_initialized = false;
}
FBA_... | TOOL | 0.974122 | 5.344626 |
8c32be59-8149-44fa-bcf2-e15360d22bed | nervmor/pdf_hit_detector | code/third/boost_1_58_0/libs/msm/doc/HTML/examples/ExampleCircularBuffer.cpp | #include <vector>
#include <iostream>
// back-end
#include <boost/msm/back/state_machine.hpp>
// header for support of circular_buffer
#include <boost/msm/back/queue_container_circular.hpp>
//front-end
#include <boost/msm/front/state_machine_def.hpp>
// functors
#include <boost/msm/front/functor_row.hpp>
#include <boos... | TOOL | 0.86825 | 6.317823 |
36011af1-05c5-4573-80b2-28263d554089 | Zhanggen-sysu/iOS-Note | 算法/LeetCode/LeetCode/Slove41_60/hot100_53.cpp | //
// hot100_53.cpp
// LeetCode
//
// Created by GenZhang on 2024/1/3.
//
#include "hot100_53.hpp"
bool hot100_53::canFinish(int numCourses, vector<vector<int>>& prerequisites)
{
vector<int> indegree(numCourses);
queue<int> que;
// 累加入度
for (auto pre : prerequisites) {
indegree[pre[0]] ++;
... | ALGO | 0.998495 | 6.360241 |
e8c8cdb2-1a21-4ab9-8a65-baad00e2f52c | break2133/cpp_in_leetcode | 10_getMaximumConsecutive/getMaximumConsecutive.cpp | //https://leetcode.cn/problems/maximum-number-of-consecutive-values-you-can-make/
#include <iostream>
#include <vector>
#include <string.h>
#include <algorithm>
using namespace std;
class Solution {
public:
int getMaximumConsecutive(vector<int>& coins) {
sort(coins.begin(), coins.end());
int point... | ALGO | 0.999835 | 5.347376 |
cea162b6-6c66-41c0-9824-fe635999a4b5 | iagorrr/Competitive-Programming-Solutions | submissions/Codeforces/1955B.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll grid[500][500];
void solve() {
int n;
ll c, d;
cin >> n >> c >> d;
multiset<int> st;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
int x;
cin >> x;
st.emplace(x);
}
}
int f = *st.begin();
for (int i = 0; i < n; i... | ALGO | 0.999857 | 3.938382 |
d7e9a90c-912e-4dc7-a260-275d8223b87a | ArielGarciaM/CompetitiveProgramming | cses/roadconstruction.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> rep, sz;
vector<array<int, 2>> edges;
int comps, mx;
void init() {
fill(rep.begin(), rep.end(), -1);
fill(sz.begin(), sz.end(), 1);
}
int find(int u) {
return rep[u] == -1 ? u : rep[u] = find(rep[u]);
}
bool join(int u, int v) {
u = find(u), v = find(v);... | ALGO | 0.999928 | 5.163898 |
c8e9bbc2-812b-4019-8d97-4bfb4d644f7e | raincross7/code-similarity | codes/train_code/problem081/problem081_63.cpp | #include <bits/stdc++.h>
#include <chrono>
#define fr first
#define sc second
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
const ll md = 1000000007;
ll ad(ll a, ll b) {
return (a%md + b%md + md) % md;
}
ll ml(ll a, ll b) {
return ( (a%md) * (b%md) ) % md;
}
ll pw(... | ALGO | 0.999924 | 4.346231 |
fe69e4f6-7795-4ed5-801d-9d9b1c0292ca | debanjan-2002/crack-your-placement | Trees/Q22_all_nodes_distance_k_in_binary_tree.cpp | // Given the root of a binary tree, the value of a target node target, and an integer k, return an array of the values of all nodes that have a distance k from the target node.
// You can return the answer in any order.
// Example 1:
// Input: root = [3,5,1,6,2,0,8,null,null,7,4], target = 5, k = 2
// Output: [7,4,1]... | ALGO | 0.999993 | 6.514708 |
d0bf9be4-4f9e-44a5-8e45-b575931b7a99 | siddharth-kumar182002/DSA | C_Vlad_and_a_Sum_of_Sum_of_Digits.cpp | #include <bits/stdc++.h>
using namespace std;
long long f(long long i){
long long sum=0;
while(i>0){
sum=sum+(i%10);
i=i/10;
}
return sum;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(__null);
int t;
cin>>t;
vector<long long> ans(2*1e5+1,0);
for (long long i... | ALGO | 0.999785 | 5.471572 |
cbb348eb-9ff6-460e-9c86-12cba6a4b178 | mr2rm/solutions | legacy/TopCoder/ToastXRaspberry.cpp | // Paste me into the FileEdit configuration dialog
#include <cmath>
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <bitset>
#include <queue>
#include <stack>
#include <utility>
#include <algorithm>
#include <cstdio>
using namespace st... | ALGO | 0.999669 | 3.770475 |
f1dd346b-b2b6-45a6-a677-a9c5deee4d13 | Code-OS/frameworks_av | media/libstagefright/codecs/amrwb/src/wb_syn_filt.cpp | /*
------------------------------------------------------------------------------
Filename: wb_syn_filt.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-------------------------------------------------------------------------... | ALGO | 0.999917 | 4.836874 |
b9cf29ca-2734-4e65-90bd-3ba8b248f599 | khieramihoub/CP-why-not | GFG day 3.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void reverseArray(vector<int> &arr) {
int n = arr.size() ;
vector<int> wah(n) ;
for(int i = 0 ; i < n ; ++i){
wah[i] = arr[n-i-1] ;
}
for(int ... | ALGO | 0.996891 | 6.605808 |
9ab1c639-b5fa-4a50-9d10-c970795b3160 | Alignof/AtCoder_template | E.cpp | #include <bits/stdc++.h>
#define PI 3.141592653589793
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
using ll = long long;
int main(void){
cin.tie(0);
ios::sync_with_stdio(false);
int N;
int i,k;
int ans=0;
int ctr=0;
cin >> N;
vector<int> gv(N);
rep(i,N) cin >> gv[i];
//sort(gv.begin(),gv... | ALGO | 0.999805 | 3.592254 |
77e5838f-8cd7-4380-bcc8-352c1833235d | codetrixter/DataStructure-Problems | Linked_List/AddingTwoNumbers.cpp | /**
* LeetCode Problem (Medium)
*/
#include <iostream>
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
ListNode *tempList = NULL, *head = NULL;
int carry = 0;
while((l1 != NU... | ALGO | 0.999948 | 6.273293 |
01e91f37-579f-4304-beed-967dc265608c | lyf-is-coding/competitive-programming | UVa 10110 - Light, more light.cpp | // C++11 5.3.0 - GNU C++ Compiler with options: -lm -lcrypt -O2 -std=c++11 -pipe -DONLINE_JUDGE
#include <bits/stdc++.h>
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(0);
long long walk;
double sqrt;
std::cin >> walk;
do
{
sqrt = std::sqrt(walk);
if (... | ALGO | 0.999946 | 4.345959 |
21768ae8-55bf-465b-9f5f-3da26c8602d0 | xehoth/CS100 | Homework4/hw4package/hw4_2_skeleton.cpp | #include <iostream>
#include <string>
#include <random>
#include <utility>
#include <time.h>
#include <functional>
using namespace std;
#define MAX_ROWS 3
#define MAX_COLS 10
#define MAX_STUDENTS 30
#define UP 1
#define DOWN 2
#define LEFT 3
#define RIGHT 4
#define NOTHING 0
#define APPLEPIE 1
#define BEEF 2
#defin... | ALGO | 0.904131 | 3.8464 |
4972de1f-d882-4805-a70d-63a13219acd7 | Aty-0/S2DE | Libs/boost_1_76_0/libs/spirit/example/qi/num_list4.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This sample demontrates a parser for a comma separated list of numbers.
// The numbers are inserted in a vector using phoenix.
//
// [ JDG May 10, 2002 ] spirit1
// [ JDG March 24, 2007 ] spirit2
//
///////////////////////////... | TOOL | 0.96467 | 6.549457 |
7bdbc800-624f-4dcb-a577-83b1220ee9ad | n1ghtk1ng/DSA | Coding Blocks/lpfall 2016/launchpad c++/sir codes/lecture-14-stacks_queues/QueueMain.cpp | #include<iostream>
#include "Queue.h"
#include "QueueLL.h"
using namespace std;
int main(){
Queue q1;
QueueLL q;
for(int i=1;i<=5;i++){
q.push(i);
}
q.pop();
q.push(6);
while(!q.isEmpty()){
cout<< q.getFront();
q.pop();
}
}
| ALGO | 0.967269 | 3.651038 |
0b69778f-0b62-46cb-a9d1-e79922cca55a | Santosh-Pathak/Code_Forces | Practice/beautifulMatrix.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
pair<int, int> move;
vector<vector<int>> matrix(5, vector<int>(5, 0));
for (int i = 0; i < 5; i++) // Fix loop to start from 0
{
for (int j = 0; j ... | ALGO | 0.999905 | 4.385123 |
43bc0212-5dd0-4b2e-a974-2f3590e2800c | PaukIsUha/optimizing_formating_code | predictions/full_output_predicted_submissions/Codenet/p00439/585601251/2.cpp | #include <algorithm>
#include <climits>
#include <cstring>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, k;
while (cin >> n >> k, n) {
vector<int> ac(n + 1, 0);
for (int i = 1; i <= n; ++i) {
cin >> ac[i];
ac[i] += ac[i - 1];
... | ALGO | 0.999641 | 3.490956 |
cf7aeaad-50d9-49c3-8c55-307c9c51a75b | Lycheeicy/godot | servers/audio/audio_filter_sw.cpp | /*************************************************************************/
/* audio_filter_sw.cpp */
/*************************************************************************/
/* This file is part of: */
/* ... | ALGO | 0.870527 | 4.941711 |
116430d7-b759-48e9-a4f1-b0253651cb6c | matayay/IMDB-Database | driver.cpp | // CSCI 2270 Spring 2023
// Author: Matayay Karuna
// Final Project - driver.cpp
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include "MovieHashTable.hpp"
#include "DirectorSkipList.hpp"
using namespace std;
// Function prototypes
MovieNode* parseMovieLine(string line);
void readMovie... | TOOL | 0.930395 | 6.230524 |
0433fc64-1f36-4473-bd66-8a9aab6647fd | raincross7/code-similarity | codes/train_code/problem422/problem422_413.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, A;
cin >> N >> A;
cout << (N % 500 <= A ? "Yes" : "No") << endl;
} | ALGO | 0.999796 | 3.295835 |
e8914760-56aa-4762-9f8e-a4528270858e | hencle/Marlin_2_1_x | Marlin/src/lcd/menu/menu_delta_calibrate.cpp | //
// Delta Calibrate Menu
//
#include "../../inc/MarlinConfigPre.h"
#if HAS_MARLINUI_MENU && ANY(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION)
#include "menu_item.h"
#include "../../module/delta.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#include "../../module/probe.h"
#if HAS_LEVELING... | TOOL | 0.896088 | 7.274062 |
84389b86-bb96-494c-94e6-b6e8d0566b1b | joy-mohajon/UVa-Problem-solutions | uva 612.cpp | #include<bits/stdc++.h>
using namespace std;
typedef pair <int, int> pairs;
int main()
{
int test, n, m;
cin >> test;
while(test--)
{
cin >> n >> m;
string index[m], data;
vector <pairs> v;// pair type vector
for(int i=0; i<m; i++)
{
cin >> data;... | ALGO | 0.999951 | 4.129839 |
959d7b80-d754-42c4-a354-9b7f4ab41f06 | IkhyeonJo/C_Quizs | Quiz3.cpp | #include <stdio.h>
#define CASE_CHANGE 32
int main(void){
char letter;
printf("letter case changer! input the string : ");
while(letter!='\n'){
scanf("%c", &letter);
if(letter>='A' && letter<='Z') letter+=CASE_CHANGE;
else if(letter>='a' && letter<='z') letter-=CASE_CHANGE;
printf("%c", letter);
}
re... | ALGO | 0.979001 | 4.133484 |
ce7f3c23-5740-45a8-994c-16170d9a7b84 | kushagrasgupta/AlgorithmToolBox.Coursera-Resources- | week6_dynamic_programming2/2_partitioning_souvenirs/partition3.cpp | #include <iostream>
#include <vector>
using std::vector;
int partition3(vector<int> &A) {
//write your code here
return 0;
}
int main() {
int n;
std::cin >> n;
vector<int> A(n);
for (size_t i = 0; i < A.size(); ++i) {
std::cin >> A[i];
}
std::cout << partition3(A) << '\n';
}
| ALGO | 0.999969 | 4.40269 |
9e5ff65d-707b-4395-b2ec-5f117b75151d | cold-su/cold-su | code/2024/11/16/B3939 [GESP样题 四级] 绝对素数.cpp | #include <bits/stdc++.h>
#define deb(...) puts(std::format(__VA_ARGS__).c_str())
#define int long long int
const bool HAVE_MULTIPLE_TESTCASES = false;
void solve() {
int l, r;
std::cin >> l >> r;
auto is_prime = [] (int n) {
for (int i = 2; i <= sqrt(n); i++) {
if (n % i == 0)
return false;
}
return ... | ALGO | 0.999752 | 5.030828 |
b3855b59-3fed-4898-a717-6a3588936b99 | PaimountLtd/open-source-vision-library | modules/imgproc/src/smooth.cpp | #include "precomp.hpp"
#include <vector>
#include "opencv2/core/hal/intrin.hpp"
#include "opencl_kernels_imgproc.hpp"
#include "opencv2/core/openvx/ovx_defs.hpp"
#include "filter.hpp"
#include "fixedpoint.inl.hpp"
namespace cv
{
/***********************************************************************************... | ALGO | 0.963479 | 5.607101 |
576b0698-4daf-476a-b6bc-d8a21a874fcb | Ryeoryeon/Algorithm_study | ryeoryeon/Baekjoon/11047:동전 0/main.cpp | #include <iostream>
using namespace std;
int coinList[10] = {0,};
int main(int argc, const char * argv[]) {
int N, K, currentCoin = 0; //동전의 개수와 가치의 합
cin>>N>>K;
for(int i = 0; i < N; ++i)
cin>>coinList[i];
int coinPointer = N - 1; // 가장 가치가 큰 동전부터 조사해야 하므로
while(K != 0)
{
... | ALGO | 0.999783 | 4.429402 |
ed81981c-5965-4d9c-bf49-6a1290b6943f | ishandutta2007/codeforces | jcvb/normal/553/C.cpp | #include<cmath>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<cstdlib>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<bitset>
using namespace std;
typedef long long ll;
typedef double db;
void gn(int &x){
int sg=1;char tmp;while(((tmp=getchar())<'0'||tmp>'... | ALGO | 0.999987 | 4.028179 |
a9d07e6e-f53a-4bd9-9ed2-e778f8ef5ab6 | Luke-McShane/CPP_Course | Tutorial 37 - Reversing A String.cpp | // Tutorial 37 - Reversing A String.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <string>
#include <iostream>
using namespace std;
int main()
{
char charArray[] = "waka pfft";
//This points to the start of the char array
char * pStart = charArray;
//This works out th... | ALGO | 0.957417 | 4.107573 |
b321a8e3-9db8-4f5a-ba5c-a4ce636aa8d5 | darwin/boost | libs/graph/example/cc-internet.cpp | int
main()
{
using namespace boost;
GraphvizGraph g;
read_graphviz("figs/cc-internet.dot", g);
std::vector<int> component(num_vertices(g));
connected_components
(g, make_iterator_property_map(component.begin(),
get(vertex_index, g), component[0]));
property_map < Gr... | ALGO | 0.88311 | 5.333138 |
f440a4f8-b11f-430e-8d1e-d4825182ac3a | jhson989/algorithm | String/check_group_words.cpp | #include <string>
#include <iostream>
using namespace std;
int total, num=0;
string word;
bool check() {
int board[27] = {0};
char pre = ' ', now;
for (int i=0; i<word.size(); i++){
now = word[i];
if (pre != now && board[now-'a'] != 0) {
return false;
}
... | ALGO | 0.999853 | 4.432858 |
c6155fff-154b-48c1-8bf2-ebe9b37c9013 | Abhishekjadhavv/Assignment---38 | iterateReverse.cpp | // Iterate a list in reverse order C++ STL
#include<iostream>
#include<list>
#include<iterator>
using namespace std;
int main(){
list<int>l{23,45,66,77,88,99};
for(auto it = l.rbegin();it!=l.rend();it++){
cout<<*it<<" ";
}
return 0;
} | TOOL | 0.944748 | 4.428348 |
62030ff0-80e7-4c4b-946f-4408e33b68f7 | PolaKuma/SCU_Homework | 编程C++/C++测试程序/第6章程序/s6_2/smain6_2.cpp | // ļ·:s6_2\smain6_2.cpp
#include <iostream> // Ԥ
using namespace std; // ʹռstd
int sum = 0; // ڴ洢ۼӺ
void Sum(int e) // ۼ
{
sum = sum + e; // sumۼe
}
template <class It, class Fun>
Fun &ForEach(const It &begin, const It &end, Fun &f) // 㷨
{
for (It it = begin; it != end; ... | ALGO | 0.983269 | 4.006158 |
2316da9e-59cd-475f-8e5b-438c234244c4 | abhidahiya23/CompetitiveProgramming | Algo++/sanketandStrings.cpp | #include<bits/stdc++.h>
using namespace std;
void maximumLengthString(string str,int k){
int l = str.length();
if(l==k){
cout<<k<<endl;
return;
}
int acount=0,bcount=0;
int countarray[l]={0};
for(int i=0;i<l;i++){
if(str[i]=='a'){
countarray[i]=1;
acount++;
}else{
bcount++;
}
}
int c1,c2;... | ALGO | 0.999803 | 3.830212 |
a8d8b8ea-57eb-419d-97b2-2ab0e197fe95 | CollinSmiled/mobileProgramming | Sesi3/todoapp/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.99804 | 6.76775 |
31073c22-69a4-45e0-8a2e-9d9c880421de | ducnguyentienvti123/Testgithub | count_string.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
string str ;
getline(cin,str);
long long sum = 0 ;
for(int i=0;i<str.size();i++){
if(str[i]>='0'&&str[i]<='9'){
sum += (int)str[i] -48 ;
}
}
cout << sum ;
} | ALGO | 0.998867 | 3.672196 |
349d5b7b-de90-4209-a643-27655584e9ff | carel009/CS-010C | Lab 3/main.cpp | #include <iostream>
#include <stdexcept>
#include <vector>
#include <ctime>
using namespace std;
template <typename T>
unsigned min_index(const vector<T> &vals, unsigned index)
{
int vectorSize = vals.size();
int minimumIndex = index;
for (int i = (index + 1); i < vectorSize; i++)
{
if (v... | ALGO | 0.994515 | 4.813447 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.