uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3f3e2b45-4384-4562-a96f-a52e482136f5 | Raj-588/CP_code | rod1.cpp | #include <iostream>
#include <string>
#include <climits>
using namespace std;
int rodCut(int price[], int n)
{
if (n == 0) {
return 0;
}
int maxValue = INT_MIN;
for (int i = 1; i <= n; i++)
{
int cost = price[i - 1] + rodCut(price, n - i);
if (cost > maxVa... | ALGO | 0.99965 | 4.496947 |
b3bcff9c-c699-45e6-a6e8-5e22346346fb | Hafiz-Sakib/Data-Structure-Algorithms | Data Structures/02. Mathematics/most_distant.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
vector<double>d;
long int y_0=INT_MIN,x_0=INT_MIN,ny_0=INT_MAX,nx_0=INT_MAX;
while(t--){
long int x,y;
cin>>x>>y;
if(y==0){
x_0=max(x_0,x);
nx_0=min(nx_0,x);
}
e... | ALGO | 0.999878 | 4.339 |
30ad973e-bf7c-4185-bc29-391034bcfc4c | wangzhangjun/cplusplus-study | c++-stl/值语义.cpp | #include <iostream>
#include <vector>
/*
容器是值语义的:
一定要提供相关的拷贝构造函数,和重载=
这样你自己的对象才能被放到容器中。
*/
class Teacher {
public:
char *name;
int age;
public:
//有参构造函数
Teacher(const char *pname , int age) {
this->name = new char[strlen(pname)];
strcpy(this->name, pname);
this->age = age;
}... | TOOL | 0.919488 | 3.422901 |
df1b6ca8-3965-42d7-b75c-9b7207c77d32 | kunal-umich/Udacity-Path-Planning-Highway-Driving | src/Eigen-3.3/doc/examples/Tutorial_ArrayClass_addition.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXXf a(3,3);
ArrayXXf b(3,3);
a << 1,2,3,
4,5,6,
7,8,9;
b << 1,2,3,
1,2,3,
1,2,3;
// Adding two arrays
cout << "a + b = " << endl << a + b << endl << endl;
// Subt... | ALGO | 0.921426 | 3.642258 |
8d52ff65-4c4a-460a-9f21-c8361430c51e | rajveer-09/HustlerWorkspaceLeetcode | 908-middle-of-the-linked-list/middle-of-the-linked-list.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* middleNode(... | ALGO | 0.9999 | 5.808238 |
4855c0c2-a4fc-4a13-aa2e-deb63813d881 | KwonSunwon/Y23S2_NGP_Proj | Client/api/core/examples/plugins/fmod_distance_filter.cpp | #ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "fmod.hpp"
extern "C"
{
F_EXPORT FMOD_DSP_DESCRIPTION* F_CALL FMODGetDSPDescription();
}
const float FMOD_DISTANCE_FILTER_PARAM_MAX_DISTANCE_MIN = 0.0f;
const float FMOD_DISTANCE_FILTER... | TOOL | 0.984013 | 6.188813 |
496e675e-3237-45dd-b9d2-d601ec95d3b0 | ishandutta2007/codeforces | zyb/normal/1515/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 100005
int a[N];
int main() {
int test;
scanf("%d",&test);
while (test--) {
int n,m;
scanf("%d%d",&n,&m);
long long s=0;
for (int i=1;i<=n;i++) {
scanf("%d",&a[i]);
s+=a[i];
}
if (s==m) {
puts("NO");
continue;
}
sort(a+1,a+1+n);
s=0... | ALGO | 0.999907 | 3.240234 |
f7e9f5de-04b0-4299-a41e-39a17aeb33f5 | JasonHamburg/Marcos | USACO Training Website/Chapter 1 - Getting Started/USACO-1.5/Arithmetic Progressions/ariprog.cpp | /*
ID: ayushn.2
TASK: ariprog
LANG: C++11
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
bool checkProg(vector<int> bisquares, int startIndex, int gap, int duration) {
for(int i = 0; i < duration; i++) {
int z = bisquares[startIndex] + (i * gap);
... | ALGO | 0.999888 | 3.17702 |
8dc2113f-abb1-4e70-ba5e-94e52ea3a229 | omron-sinicx/homotopy-aware-MAPP | src/braid.cpp | #include "braid.hpp"
#include <algorithm>
#include <cassert>
bool Braid::operator<(const VirtualBraid &_b) const {
auto b = dynamic_cast<const Braid &>(_b);
if (sign != b.sign)
return sign < b.sign;
if (main_i != b.main_i)
return sign ^ (main_i < b.main_i);
Braid diff;
diff.N = N;
diff.word.resize(... | ALGO | 0.999864 | 4.49195 |
33a03ab6-20ea-4a0b-b2d5-5e53cd2c4457 | mako666/Eluna-CMaNGOS-Cata | src/game/AI/ScriptDevAI/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp | /* ScriptData
SDName: mob_anubisath_sentinel
SD%Complete: 75
SDComment: Abilities selection needs further improvements. Shadow storm is not properly implemented in core it should only target ppl outside of melee range.
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
#include "AI/ScriptDevAI/include/precompiled.h"
en... | TOOL | 0.96206 | 6.409733 |
8a14145c-0e58-4302-9867-9991971a3de9 | Mohibahmed2001/Data-Structure-and-Algos | 128-longest-consecutive-sequence/longest-consecutive-sequence.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
if(nums.empty()){
return 0;
}
unordered_set<int>mp;
for(auto elm:nums){
mp.insert(elm);
}
int counter=1;
for(int i=0;i<nums.size();i++){
if(mp.find(nums[i]... | ALGO | 0.999961 | 5.661687 |
880ef98b-9cc3-4595-a205-6e3c955e8ea1 | sudiptarathi2020/Problem-Solves | codeforces/Sudipta/Exchange.cpp | #include <bits/stdc++.h>
#define N '\n'
#define ll long long
#define L size()
using namespace std;
void solve()
{
ll i,j,k,l;
ll n,a,b;
cin>>n>>a>>b;
if(a<=b)
{
if(n%a==0)
{
cout<<n/a<<N;
}
else
{
cout<<n/a+1<<N;
}
}
els... | ALGO | 0.994108 | 3.563368 |
61548eaa-5f69-4f48-b95a-a631a81093d2 | Hariamy/projeto_metodosII | biblioteca/eigen/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A;
A << 1, 2, 2, 3;
cout << "Here is the matrix A:\n" << A << endl;
SelfAdjointEigenSolver<Matrix2f> eigensolver(A);
if (eigensolver.info() != Success) abort();
cout << "The eigenvalues of A ... | ALGO | 0.99955 | 3.846247 |
b1a6c015-67df-44fa-b5ab-55e1336d5af1 | LeePenn/CP-congrumen- | Chapter-5/Segment-Tree/POJ2886-2.cpp | #include<cstdio>
#include<cstring>
#include<map>
#include<cmath>
#include<algorithm>
using namespace std;
const int MAXN=5e5+5;
struct node
{
int l,r,num;
}tree[MAXN<<2];
char s[MAXN][11];
int p[MAXN],add[MAXN],n,k;
void table()
{
for(int i=1;i<MAXN;i++)p[i]=1;
for(int i=2;i<MAXN;i++)
for(int j=i;j<... | ALGO | 0.999953 | 3.186516 |
16bad669-cf3c-4a50-8b83-009909bd913d | Pan-Peach/My-code | cpp/luogu/P2888.cpp | #include<bits/stdc++.h>
using namespace std;
const int INF=0x3f3f3f3f;
void Floyd(vector<vector<int>>& adj){
int n=adj.size()-1;
for(int k=1;k<=n;k++){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
adj[i][j]=min(adj[i][j],max(adj[i][k],adj[k][j]));
}
}
... | ALGO | 0.999978 | 4.883767 |
08a96b0b-0608-4a8e-af5e-f9d3f19de3a1 | RPL-CS-UCL/gs_localization | gaussian_splatting/SIBR_viewers/src/core/system/Matrix.cpp | #include "core/system/Transform3.hpp"
namespace sibr
{
Matrix4f perspective( float fovRadian, float ratio, float zn, float zf, const sibr::Vector2f & p)
{
const float yScale = float(1.0)/std::tan(fovRadian/2.0f);
const float xScale = yScale/ratio;
Matrix4f m;
const float dx = 2.0f * p.x() - 1.0f;
const fl... | ALGO | 0.903544 | 5.924917 |
ed559718-1ee5-49db-bb78-11f015f8a2fb | teetangh/competitive-programming-and-dsa | CodeForces/contests/regular/#817-div4/nA.cpp | // Includes
#include <iostream>
#include <iomanip>
#include <string>
#include <bits/stdc++.h>
// Policy Based Data Structures
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
// Defines
#define endl '\n'
#define fastio() ios_base::sync_wit... | ALGO | 0.999785 | 5.32742 |
18e7d848-0497-48a6-a3f1-1ab8a3d1be2b | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4646_2.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> t;
int sz = 0;
const int INF = 2e9;
void build(vector<int> a) {
t.assign(2 * sz + 2, INF);
for (int i = 0; i < sz; i++) {
t[i + sz] = a[i];
}
for (int i = sz - 1; i > 0; i--) {
t[i] = min(t[2 * i], t[2 * i + 1]);
}
}
int get(int v, int tl, int ... | ALGO | 0.99995 | 4.050272 |
b5ed298b-ab1c-47d0-aa60-00dbaf685b0e | Code-Practitioners/Diversified-Programming | Dynamic Programming/longestPalindromicSubstring.cpp | class Solution
{
public:
string longestPalindrome(string s)
{
if (s.empty())
return string();
vector<vector<bool>> dp(s.length(), vector<bool>(s.length(), false));
// memset(dp, 0, sizeof(dp));
int start = 0, max_length = 1;
for (int i = 0; i < s.length(); ... | ALGO | 0.999911 | 5.78454 |
a0c2e599-edf1-4423-a599-d3c297dad859 | nojima/aoj | 1029.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
#define LET(name, value) __typeof(value) name = value
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)... | ALGO | 0.999917 | 3.432992 |
88f113ff-dac7-44b9-8e96-1e6358502a6d | rishabh-bansal/C-Data-Structures-and-Algorithms | Patterns/Inverted Tree Pattern.cpp | #include<stdio.h> // including header file (standard input/output)
int main() // main function starts here(begining)
{
for(int i=1;i<=5;i++) // this loop is used to print rows(upto 5)
{
for(int j=1;j<=9;j++) // this loop is used to print columns
{
if(j>=i&&j<=10-i) //condition to print *
... | ALGO | 0.999879 | 3.813808 |
c8c1bf2d-4cce-42c3-9eaa-7537c0730e67 | chhawinder/leetcode | 0086-partition-list/0086-partition-list.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* partition(L... | ALGO | 0.999997 | 5.302134 |
9d190305-5e66-433e-b91b-0a46a4ae12aa | underscoreanuj/Codes | Hackerearth/Algorithms/Searching/Linear Search/The Normal Type.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long int n = 0, count = 0, distinct_size = 0;
cin >> n;
vector<long long int> A(n, 0);
unordered_map<long long int, long long int> D;
for (int i = 0; i < n; ++i)
{
cin >> A[i];
D.insert({A[i], 0});
}
dist... | ALGO | 0.999927 | 3.997295 |
04e0385a-d16c-4ac6-830c-b383c46da75e | adu2706/DSA_CODES | Meet in The middle/number_of_subset_whose_sum_is_less_than_equal_to_X.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define F first
#define S second
#define INF 10000
int mod = 1e9+7;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
vector<int> generate(vector<int> arr){
int n = arr.size();
vector<int> subVals;
for(int mask = 0; mask < (1 << n)... | ALGO | 0.999857 | 5.15076 |
fa8834d7-05b7-4c16-bcfb-2cbd479a394a | baejunghyun36/Coding_Test | 백준/11656번.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
string s;
string temp[1000];
cin >> s;
for (int i = 0; i < s.size(); i++) {
temp[i] = s.substr(i, s.size());
}
sort(temp, temp + s.size());
for (int i = 0; i < s.size(); i++) {
cout << temp[i] << endl;
}
} | ALGO | 0.999983 | 4.246619 |
2ca481a0-aee8-4e4f-929a-dd3c460c6a6c | kryzp/simple-verlet-physics | src/main.cpp | #include <iostream>
#include <SFML/Graphics.hpp>
#include <random>
#include "ball.h"
#include "chunks.h"
#include "util.h"
#define CHUNK_SIZE 16
float magnitude(const sf::Vector2f& v) {
return std::sqrt((v.x * v.x) + (v.y * v.y));
}
float magnitude_sqr(const sf::Vector2f& v) {
return (v.x * v.x) + (v.y * v.y);
}
... | ALGO | 0.994031 | 4.881926 |
41701168-615b-4ed3-a7c2-1a3a2137c23b | Anubhav12345678/competitive-programming | 227BASICCALCULATORIIVVIMP.cpp | class Solution {
public:
bool isdig(char c)
{
if(c>='0'&&c<='9')
return 1;
return 0;
}
int calculate(string s) {
int n = s.size();
int i,j,k,l;
if(n==0)
return 0;
char sign='+';
stack<int> st;
long long int num=0,res... | ALGO | 0.999983 | 4.461537 |
cce5b835-4bb5-4757-8d63-64a3d5541cc7 | dvaitam/codeforces | 1000-1999/1600-1699/1610-1619/1617/solE.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
constexpr char LF = '\n';
constexpr char SP = ' ';
int get_inv(int v) {
int lg = __lg(v) + 1;
int inv = (1 << lg) - v;
if (inv == v) {
inv = 0;
}
return inv;
}
int m... | ALGO | 0.999936 | 3.826232 |
a54fc4c1-2942-4890-a9c0-a946664954f6 | harshalb7/Computer-Graphics-Assignments | assignment8.cpp | /*
ASSIGNMENT NO - 08
Name :- Harshal Bhimrao Bodhare
SUB :- CGL
ROLL NO:- 09
CLASS :- SE
DIV :- A
*/
#include<iostream>
#include<stdlib.h>
#include<graphics.h>
#include<math.h>
using namespace std;
class POLYGON
{
private:
int p[10][10],Trans_result[10][10],Trans_matrix[10... | ALGO | 0.988596 | 3.137107 |
2e4c0a60-60fd-4073-974a-64f024576156 | LaiXuanHieu/LaiXuanHieu_monC | Chapter 9/Programming Challenges/Challenges_7.cpp | // BT7: Case Study Modification #2
// Sua Program 9.19 theo yeu cau de bai
#include <iostream>
using namespace std;
// Function prototypes
double *dynaAllo(int n);
void arrSelectSort(double *arr, int n);
void showArray(double *arr, int);
void showArrPtr(double *arr, int);
int main()
{
int numDonations; // So luon... | ALGO | 0.999584 | 4.82958 |
ab63351f-a145-4fb1-b631-144f84cc4f89 | rasinhas/Maratona | codeforces/gym/samara/a.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
vector <pair<int,int> > p;
vector <int> ans;
int vis[222222];
int ok[222222];
int main()
{
int n, a, b, c, ans=0;
cin >> n;
for(int i=0;i<n;i++)
{
cin >> a >> b >> c;
p.push_back(make_pai... | ALGO | 0.999985 | 3.578879 |
774f923a-711f-4ac9-82ee-c7101d4be6de | padget11/linetracking | histogram_eq.cpp | #include "Arduino.h"
#include "histogram_eq.h"
// function to histogram equilise an image to increase the contrast of the image
void histogram_eq::equilise(uint8_t (*im)[COLS])
{
// count the number that each pixel value occurs
float histogram[256][4] = { 0 };
for (int x = 0; x < ROWS; x++)
{
for (int y = ... | TOOL | 0.952976 | 3.960288 |
7c22a3ee-cfff-4fbe-9061-003ea01c9fa1 | rishiiiiitaaaaa/Love-Babbar-DSA-sheet- | Arrays/29 Largest Number.cpp | class Solution {
public:
static bool compare(const string &a, const string &b) {
return a + b > b + a;
}
string largestNumber(vector<int>& nums) {
vector<string> strNums;
// Convert all integers to strings
for (int num : nums) {
strNums.push_back(to_strin... | ALGO | 0.999977 | 6.864584 |
16e33e1e-caa0-450a-a4a4-22d11a526c94 | zlskll/small-projects | 三子棋/三子棋/game.cpp | #define _CRT_SECURE_NO_WARNINGS
#include"game.h"//Ǹ3
#include<stdio.h>
#include<Windows.h>
//ʵ:
void game() {
char board[ROW][COL];//ȷһ
//ʼ̣
InitBoard(board, ROW, COL);//ȥ鱾Բ[]
PrintBoard(board, ROW, COL);//ӡ
while (1) {
printf("ߣ>\n");
PlayerMove(board, ROW, COL);//
//עԺܾôˣֻǴݵǿ
//ٴӡһ£ҿ
PrintBoard(board, ... | ALGO | 0.984443 | 3.255475 |
51542204-9d6f-4d1d-80f7-f9b09a15ba28 | xuau34/competitive-programming | codeforces/402/c1.cpp | #include <bits/stdc++.h>
using namespace std;
int T, N, K, Q;
bool visit[200005];
priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > now, after;
void ini(void){
int i, j;
scanf("%d %d", &N, &K);
for(i = 0; i < N; i++){
scanf("%d", &j);
now.push(make_pair(j, i) );
}
for... | ALGO | 0.99992 | 3.002398 |
0862340d-97f0-4420-96f0-7740f23b01e4 | kknaks/study | 코딩테스트/2st_week/2_j_10709_bfs,dfs.cpp | //bfs
//#include <bits/stdc++.h>
//using namespace std;
//
//int a[104][104],h,w,x,y;
//string s;
//
//int main(){
// cin >> h >> w;
// queue<pair<int,int>> q;
//
// for (int i = 0; i < h; i++){
// cin >> s;
// for (int j = 0; j < w; j++){
// if (s[j] == 'c'){
// a[i... | ALGO | 0.999951 | 4.189272 |
1a949477-ad0d-4415-9562-e49bd1f11942 | harungunaydin/Competitive-Programming-Solutions | Programming Challenges/(+)Euclid_Problem.cpp | #include <algorithm>
#include <cstdio>
#define FOR(i,a,b) for(i=a; i<=b; i++)
#define FOR2(i,n) FOR(i,0,n-1)
#define TFOR(i,a,b) for(i=a; i>=b; i--)
#define f first
#define s second
#define pb push_back
#define all(x) x.begin(),x.end()
#define MAXN
using namespace std;
typedef pair < int , int > pii;
int read(){ int r... | ALGO | 0.999813 | 3.237033 |
4b871b00-c1d5-484b-80b0-08565fef66bb | 2044-space-elevator/OnlineJudgeCode | Acwing/树的重心.cpp | #include <bits/stdc++.h>
#define rty printf("Yes\n");
#define RTY printf("YES\n");
#define rtn printf("No\n");
#define RTN printf("NO\n");
#define rep(v,b,e) for(int v=b;v<=e;v++)
#define repq(v,b,e) for(int v=b;v<e;v++)
#define rrep(v,e,b) for(int v=b;v>=e;v--)
#define rrepq(v,e,b) for(int v=b;v>e;v--)
#define stg str... | ALGO | 0.994216 | 3.96878 |
5468ceeb-d9a3-4b8a-9311-e44a9baab62b | sarvex/leetcode-c-- | solution/2600-2699/2641.Cousins in Binary Tree II/Solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999994 | 6.561159 |
6ae85485-5fcd-4a9b-86fb-7925a5408cd0 | Shreyali02/program | day04/towerofhanoi.cpp | // write a program in c++ to implement tower of hanoi .
#include <iostream>
#include <vector>
#include <string>
class TowerOfHanoi {
private:
int numDisks;
std::vector<std::vector<int>> pegs;
void moveDisk(int from, int to) {
int disk = pegs[from].back();
pegs[from].pop_back();
peg... | ALGO | 0.999916 | 6.641528 |
6cc3c88e-60b7-465f-a114-c4f2996d509a | tuvaluhk/gem5_garnet3 | src/systemc/tests/systemc/misc/unit/data/datawidth_unsigned/truncation/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.9685 | 5.331775 |
f4cd9659-0299-4c8d-939e-e152b376f012 | ldx-star/Algorithm | 蓝桥杯13C++(B)/3/main.cpp | #include <iostream>
using namespace std;
typedef long long LL;
int main()
{
// 请在此输入您的代码
LL a,b,n;
cin >> a >> b >> n;
LL res = 0;
LL count = 0;
LL day = 1;
while(1){
if(day % 7 != 0 && day % 7 != 6){
count += a;
}else{
count += b;
}
da... | ALGO | 0.999819 | 3.429042 |
977a152d-8140-4831-a16a-cb600fbe93d4 | wangzhen0520/test | leetcode/ltc_34.cpp | /*
34. 在排序数组中查找元素的第一个和最后一个位置
给定一个按照升序排列的整数数组 nums,和一个目标值 target。找出给定目标值在数组中的开始位置和结束位置。
如果数组中不存在目标值 target,返回 [-1, -1]。
进阶:
你可以设计并实现时间复杂度为 O(log n) 的算法解决此问题吗?
示例 1:
输入:nums = [5,7,7,8,8,10], target = 8
输出:[3,4]
示例 2:
输入:nums = [5,7,7,8,8,10], target = 6
输出:[-1,-1]
示例 3:
输入:nums = [], target = 0
输出:[-1,-1]
提示:
0... | ALGO | 0.999932 | 6.139806 |
9f6be2cd-f833-492e-a246-b6a62dad4dfd | JuliokGuerrero/Quiz-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.998859 | 6.785645 |
a4e89081-76eb-4a44-b2fb-de2ad22eafac | Pranay36/leetcode-problems | 1930-unique-length-3-palindromic-subsequences/1930-unique-length-3-palindromic-subsequences.cpp | class Solution {
public:
int countPalindromicSubsequence(string s) {
vector<int> left(26);
vector<int> right(26);
unordered_set<string> h;
for(int i=0;i<s.size();i++){
right[s[i]-'a']++;
}
for(int i=0;i<s.size();i++){
right[s[i]-'a']--;
... | ALGO | 0.999865 | 6.292541 |
1f554f53-1691-44e9-8c67-29c9ee3a5afa | AdamZettel/cplusplus_reference | 005_while_loop.cpp | #include <iostream>
int main() {
int i = 1;
int max_count = 5;
std::cout << "Max Count: " << max_count << std::endl;
while (i <= 5) {
std::cout << "Count: " << i << std::endl;
++i;
}
return 0;
}
| ALGO | 0.92224 | 3.805542 |
8c48044a-6a35-4257-bb50-36c7f0e96603 | Oginsky/MathStat | source/Stats/twosampleshiftproblem.cpp | #include "twosampleshiftproblem.h"
#include "commonfunc.h"
#include <cmath>
/* Дополнительные заказы */
void medianTestRanksForm(size_t size1, size_t size2, size_t m1, double alpha, OutputData& result);
void pointEstimate(const Sample& data1, const Sample& data2, OutputData& result);
void confidenceInterval(const... | ALGO | 0.99679 | 5.725051 |
e8a22c27-0fd6-4608-92d7-ee86e4ce06c0 | daar/bare-blender | blender-2.74/intern/cycles/bvh/bvh_build.cpp | #include "bvh_binning.h"
#include "bvh_build.h"
#include "bvh_node.h"
#include "bvh_params.h"
#include "bvh_split.h"
#include "mesh.h"
#include "object.h"
#include "scene.h"
#include "curves.h"
#include "util_debug.h"
#include "util_foreach.h"
#include "util_logging.h"
#include "util_progress.h"
#include "util_time.h... | ALGO | 0.950529 | 7.318927 |
6ea29e2e-86af-41bc-a491-5e2be85d8e33 | Sookmyung-Algos/2022algos | algos_assignment/고두영_d0oo0ye/1주차/16234.cpp | #include <iostream>
#include <queue>
#include <string.h>
#define MAX 50
using namespace std;
int n, l, r;
int sum = 0;
int arr[MAX][MAX];
bool visit[MAX][MAX];
int dx[4] = { -1, 0, 1, 0 };
int dy[4] = { 0, 1, 0, -1 };
vector<pair<int, int>> v;
void dfs(int x, int y) {
v.push_back(make_pair(x, y));
visit[x][... | ALGO | 0.999824 | 3.307859 |
ee5e51f5-d57d-4c98-9f8c-06f315776d3a | piyushshrma/Leetcode-Ques | 2215-finding-3-digit-even-numbers/2215-finding-3-digit-even-numbers.cpp | class Solution {
public:
vector<int> findEvenNumbers(vector<int>& digits) {
int freq[10] = {};
for (int digit : digits)
freq[digit]++;
vector<int> res;
for (int i = 1; i <= 9; i++){
if (freq[i] == 0)
continue;
freq[i]--;
... | ALGO | 0.999898 | 6.341849 |
e6aff850-6397-4b8f-a560-c906070ad712 | tiarabun123/Exercise_items | 数组元素逆置2.cpp | #include<iostream>
using namespace std;
int main()
{
int arr[]={1,2,3,4,6,5,7,8,9};
int l=sizeof(arr)/sizeof(arr[0]);
int a=0;
int start=0,end=l-1;
while(start<end)
{
a=arr[start];
arr[start]=arr[end];
arr[end]=a;
start++;end--;
}
for(int i=0;i<l;i++)
{
... | ALGO | 0.999848 | 3.402764 |
59a6842d-472a-4ebf-8a40-c3c3a630760e | cofls6581/hongjangal | 백준_코테연습/시뮬레이션과구현/레벨햄버거/hyejun.cpp | #include <iostream>
using namespace std;
long long d[51];
long long p[51];
long long go(int n, long long x) {
if (n == 0) { // 레벨-0 버거
if (x == 0) return 0;
else return 1;
}
else if (x == 1) { // 번만 먹은 경우
return 0;
}
else if (x <= 1 + d[n - 1]) { // (번 + 레벨 n-1 버거) 이내로 먹은 ... | ALGO | 0.999971 | 4.3801 |
78560030-be68-4bb3-b28b-bdc1a650bd55 | amineAllache/llvm-bolt19 | mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp | #include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/... | ALGO | 0.956775 | 7.708691 |
75b062c9-3a1e-4b71-b77d-5fbec73b9cc4 | kanhaiyagupta9045/Data-Structures-and-Algorithm | First non-repeating character in a stream - GFG/first-nonrepeating-character-in-a-stream.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
string FirstNonRepeating(string A)
{
// Code here
vector<int> freq(26,0);
int n = A.size();
queue<char> q;
string ans ="" ;
for(int i = 0;i<n;i++)
{
... | ALGO | 0.999943 | 5.393831 |
8590cf7d-cf9d-4b2c-9895-62e9c28a96bf | priyanshu1019/LeetCode-Solutions | 38-count-and-say/count-and-say.cpp | class Solution {
private:
string compress(string &chars) {
int ind = 0;
int count = 0;
char ch;
string token = "";
for(int i =0 ; i< chars.size() ; i++){
if( i == 0){
ch = chars[i];
count = 1;
}else{
if( ... | ALGO | 0.999996 | 6.733735 |
735393f4-9a8e-4ffd-99ea-e554b6e9d8c3 | neal2018/oj_env | misc/fhc/2024/r1/a.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
int T;
std::cin >> T;
for (int case_no = 1; case_no <= T; case_no++) {
int n;
std::cin >> n;
std::vector<std::array<i64, 2>> a(n);
for (auto& [x, y] : a) std::cin >> ... | ALGO | 0.999563 | 4.748959 |
178ca060-bbf8-4b2d-adb2-357d8a89d957 | lakshayarora8/SDE-Sheet | 0046-permutations/0046-permutations.cpp | class Solution {
public:
vector<vector<int>> ans;
void solve(int index,vector<int> &nums)
{
if(index == nums.size())
{
ans.push_back(nums);
return ;
}
for(int i=index;i<nums.size();i++)
{
swap(nums[index],nums[i]);
solv... | ALGO | 0.999997 | 6.086293 |
8db32c04-cb92-46c0-932c-da4f884f4dc9 | soban09/DSA-Problems | Sliding Window/1_MaxSumInSubArr.cpp | #include<iostream>
using namespace std;
int MaxSumInSubArr(int *arr, int n, int k){
int i=0,j=0,sum=0,mx=0;
while(j<n){
sum += arr[j];
if(j-i+1 < k) j++;
else if(j-i+1 == k){
mx = max(mx, sum);
sum-=arr[i];
i++;j++;
}
}
return mx;
}
... | ALGO | 0.999702 | 4.773147 |
4e42a6ff-84d7-4b84-882b-49d9b2f138a1 | hymsly/CompetitiveProgramming | arg/contest/drunkard.cpp | #include<bits/stdc++.h>
using namespace std;
int m,n,x,y;
int POT[11];
int cntnodo;
int ini=1;
int M[2000][2];
void graf(){
for(int i=1;i<=cntnodo-2;i++){
M[i + 2*ini][0] = (i+1==cntnodo - 1?1:i + 2*ini +1);
}
int posi = 31 - __builtin_clz(n);
vector<int> v;
M[posi+1 + 2*ini ][1] = cntnodo + 2*ini - 1;
//re... | ALGO | 0.999679 | 3.533071 |
06b8c9cb-5ae8-4755-8b61-960851bb5c36 | DsThakurRawat/Codeforces-divyanshthakur594 | 2123A.cpp | #include<bits/stdc++.h>
using namespace std;
// code by divyansh thakur
int main(){
int t;
cin >> t;
while(t--){
/*
<---- Problem Rough ---->
so always first move is made by alice
for n = 2
0 1
alice chooses => 0 say a =0;
then bob dont have valid move as a + b = 3
so no valid n... | ALGO | 0.999969 | 4.31809 |
750419ac-146c-4344-95fe-0c8f7d501bf9 | GordonHaha/AlgorithmExercises | 数据结构和算法/二叉树/牛客/面试必刷TOP101/BM31.cpp | // https://www.nowcoder.com/practice/ff05d44dfdb04e1d83bdbdab320efbcb
#include <bits/stdc++.h>
using namespace std;
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
TreeNode(int x) :
val(x), left(NULL), right(NULL) {
}
};
class Solution
{
public:
bool isMi... | ALGO | 0.999982 | 5.7882 |
11796e72-8e7b-4eab-ac69-162500248d89 | lkhiem23/lhkhiem_University | DAI HOC/Chuong 5/Untitled15.cpp | #include<iostream.h>
using namespace std;
int main(){
int i,n;
float s;
cout << "\nNhap n = ";
cin >> n;
s = 0;
do{
if(n<1){
cout << "\nSo n phai lon hon 1, vui long nhap lai!";
}
}while(n<1);
for(i=1;i<=n;i++){
s = s + (2*i-1);
}
cout << "\nTong cua S = 1 + 3 + 5 + ... + (2n-1) la:"<< ... | ALGO | 0.996298 | 3.038605 |
6ce490c3-37f2-4259-9197-1dfc34cf7697 | Patman86/x265-Mod-by-Patman | source/common/dct.cpp | #include "common.h"
#include "primitives.h"
#include "contexts.h" // costCoeffNxN_c
#include "threading.h" // BSR
using namespace X265_NS;
#if _MSC_VER
#pragma warning(disable: 4127) // conditional expression is constant, typical for templated functions
#endif
// Fast DST Algorithm. Full matrix multiplication for... | ALGO | 0.998967 | 3.165429 |
1b644603-4d49-4dfa-be1e-42487a47023b | GunioRobot/scribe-dependencies | boost_1_41_0/libs/interprocess/example/doc_vectorstream.cpp | using namespace boost::interprocess;
typedef allocator<int, managed_shared_memory::segment_manager>
IntAllocator;
typedef allocator<char, managed_shared_memory::segment_manager>
CharAllocator;
typedef vector<int, IntAllocator> MyVector;
typedef basic_string
<char, std::char_traits<char>, CharAllocator> ... | TEST | 0.860498 | 3.837096 |
92d77b36-db7f-4f15-9656-3c2551142456 | Dreams-Lp-Old/platform_frameworks_av | media/libstagefright/codecs/mp3dec/src/pvmp3_polyphase_filter_window.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_polyphase_filter_window.cpp
Date: 09/21/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
--------... | ALGO | 0.986114 | 4.600871 |
69151aed-f6ee-4fa5-80cd-bf2306982f15 | 192120030/Rejita.N | Test 4.cpp | #include <stdio.h>
void main( )
{
int arr1[10];
int i,n, sum = 0;
int *pt;
printf("\n\n Pointer : Sum of all elements in an array :\n");
printf("------------------------------------------------\n");
printf(" Input the number of elements to store in the array (max 10) : ");
scanf("%d",&n);
... | ALGO | 0.987699 | 3.765586 |
1087c9ef-4b49-4f4b-bea0-e4e65cc1b96f | ishandutta2007/codeforces | kimjihoon/normal/1381/B.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
vector<int> v;
bool d[4009], td[4009];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int tc; cin >> tc;
for (int ti = 0; ti < tc; ti++) {
int n; cin >> n;
int mx = 0, p = 1;
v.clear();
for (int i = 1; i <= 2 * n; i++) ... | ALGO | 0.999953 | 4.423066 |
39d8d131-e782-4e08-b17e-22b503a124a5 | sloppydomain/College | ai/7/7bestfirst.cpp | #include <bits/stdc++.h>
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n, m;
cin >> n >> m;
string goal = "123456780";
string start = "";
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
i... | ALGO | 0.999998 | 4.860234 |
94e1c6fc-37c1-490a-8006-a45998ae3d3e | zyxmcy/C-- | 数据结构第2版-书中算法(C语言版)/第5章/5.9.cpp | //㷨5.9
#include<iostream>
using namespace std;
//Ķʹ洢ʾ
typedef struct BiThrNode
{
char data; //
struct BiThrNode *lchild,*rchild; //Һָ
int LTag,RTag;
}BiThrNode,*BiThrTree;
//ȫֱpre
BiThrNode *pre=new BiThrNode;
//㷨5.3
void CreateBiTree(BiThrTree &T)
{
//нֵһַʾĶT
char ch;
cin >> ch;
if(ch=='#') T=NU... | ALGO | 0.999974 | 3.582033 |
399cda37-0042-41e9-8297-d84cdc8a2425 | script-beast/DSA_CPP | PlatformQuestions/LeetCode/51 to 100/77. Combinations.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<int>> combine(int n, int k) {
vector<vector<int>> ans;
if(n == 0 || k == 0) return ans;
vector<int> v;
dfs(n, k, 1, v, ans);
return ans;
}
void dfs(int n, int k, int pos, vector<int>&... | ALGO | 0.999985 | 5.51478 |
2f46625b-bba3-4167-89ba-713eb18ad675 | wangsiping97/My-LeetCode-Solutions | 1011.cpp | // A conveyor belt has packages that must be shipped from one port to another within D days.
// The i-th package on the conveyor belt has a weight of weights[i]. Each day, we load the ship with packages on the conveyor belt (in the order given by weights). We may not load more weight than the maximum weight capacity o... | ALGO | 0.999994 | 5.76006 |
1a75dc4c-563a-48ee-a86e-ef449c02af29 | huyinit/Cplusplus-Slide-PTIT | MATRIX/MATRIX/BAI2.cpp | //Bai 2: dua ra cac phan tu giong nhau o tat ca cac hang
#include <bits/stdc++.h>
#define MAX 1001
using namespace std;
//dua ra ket qua 1 test
void Result(int *A[MAX], int n){
cout<<endl;
for(int i=0; i<n; i++){ //duyet theo hang
for(int j=0; j<n; j++) //duyet theo cot
cout<<A[i][j]<<" ";//in ra phan tu
... | ALGO | 0.999941 | 3.463642 |
9de60f22-aa15-4b91-824f-ee143ebb5c3f | ssaannzzhhiikk/PP1 | Lab 6/% of girls Q.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
float n, p;
cin >> n >> p;
cout << (p * 100) / n;
} | ALGO | 0.999498 | 3.613806 |
e7e29157-79a0-4e67-965e-db5ba794e38c | masterboy376/dsa_revisit | stack/balanced_paranthesis.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
bool isValid(string s){
stack<char> st;
for(int i = 0; i<s.length(); i++){
switch (s[i])
{
case '}':
if(st.top()!='{'){
return false;
... | ALGO | 0.998931 | 4.879443 |
4a877c9c-348a-4771-8ffc-9cbd89340370 | NCommander/openbsd-src-with-branches | gnu/llvm/llvm/lib/Transforms/IPO/PartialInlining.cpp | #include "llvm/Transforms/IPO/PartialInlining.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/BlockFrequencyInfo.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/A... | ALGO | 0.998346 | 7.931074 |
700d1939-9afc-4ad3-b816-c185cd3d2885 | Igor1208gabriel/Exercicios-Programacao-Competitiva | Beecrowd/2771.cpp | #include <bits/stdc++.h>
using namespace std;
double resolver(int notas[], int menor, int meio, int maior, vector<double> & a){
double media = (notas[menor]+notas[meio]+notas[maior])/3.0;
a.push_back(media);
if(menor == 0 and meio == menor+1 and maior == meio+1) return 1.0;
else{
if(!menor && m... | ALGO | 0.999816 | 3.794694 |
16a52fdd-4262-43bc-a5d6-f690d69f82b1 | bindaldhara/DSA-Practice | 1155-number-of-dice-rolls-with-target-sum/1155-number-of-dice-rolls-with-target-sum.cpp | class Solution {
public:
long long MOD = 1e9+7;
long long helper(int n, int k, int target, vector<vector<int>> &dp){
if(target < 0)
return 0;
if(n == 0 and target != 0)
return 0;
if(target == 0 and n != 0)
return 0;
if(target == 0 and n == 0)
... | ALGO | 0.999997 | 5.663325 |
f4d7f536-05e5-4aef-9a4c-2d6f4ebc6c1f | Casal2/CASAL2 | CASAL2/source/AdditionalPriors/Common/LogNormal.cpp | /**
* @file LogNormal.cpp
* @author C.Marsh
* @github https://github.com/Zaita
* @date 3/7/2017
* @section LICENSE
*
* Copyright Casal2 Project 2024 - https://github.com/Casal2/
*
*/
// headers
#include "LogNormal.h"
#include "../../Model/Model.h"
#include "../../Model/Objects.h"
// namespaces
namespace niw... | ALGO | 0.896488 | 5.884147 |
8836b10c-fee4-4707-adf3-8a50b45a5c25 | arwalton/advisorBotOOPMidterm | AdvisorBot.cpp | #include "AdvisorBot.h"
#include "OrderBookEntry.h"
#include <iostream>
#include <sstream>
#include <cctype>
#include <algorithm>
#include <cmath>
AdvisorBot::AdvisorBot()
{
}
AdvisorBot::~AdvisorBot()
{
}
void AdvisorBot::init(){
std::vector<std::string> input;
currentTime = orderBook.getEarliestTime()... | ALGO | 0.981969 | 3.994493 |
cecd8ecb-ade0-4c67-8b7d-89e761949c09 | Altu-Bitu-6/Altu-Bitu_YuHyoju | 13_최단경로/도전/합승택시요금.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
const int INF = 1e7 * 2; //n의 최댓값 * 가중치 최댓값
//fares 배열은 한 방향만 제시해준다고 했으므로 다시 그래프를 만들어야 함
vector<vector<int>> makeGraph(int n , vector<vector<int>> &fares){
vector<vector<int>> graph(n+1 , vector<int> (n+1 , INF));
for(int i = 1; i<=... | ALGO | 0.999192 | 4.806268 |
3c7ee9cb-42bb-4403-bbdd-44ac9d2efd0d | MarcusGDaniels/lammps-original | src/ML-IAP/compute_mliap.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Aidan Thompson (SNL)
------------------------------------------------------------------------- */
#include "compute_mliap.h"
#include "mliap_data.h"
#include "mliap_descriptor_snap.h"
#include "mliap... | TOOL | 0.99453 | 6.734229 |
e2f36d47-0c73-472a-a3a3-03cc54855068 | SamyakJain2002/Coding-Solutions | Delete without head pointer - GFG/delete-without-head-pointer.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
/* Link list node */
struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
}*head;
Node *findNode(Node* head, int search_for)
{
Node* current = head;
while (current != NULL)
{
if (curre... | ALGO | 0.999911 | 5.530916 |
3540af9b-506b-49e3-b91a-14819382e9bd | Aditya6688/DSA-Ques | 2163-kth-distinct-string-in-an-array/2163-kth-distinct-string-in-an-array.cpp | class Solution {
public:
string kthDistinct(vector<string>& arr, int k) {
unordered_map<string,int> m;
string ans;
int n = arr.size();
for(int i=0;i<n;i++){
m[arr[i]]++;
}
for(int i=0;i<n;i++){
if(m[arr[i]] == 1){
ans = arr[i];
... | ALGO | 0.999951 | 6.019434 |
4160e82d-4276-4faf-b1b2-24992d077690 | TuringKi/llvm-project-12-wasi | llvm/utils/FileCheck/FileCheck.cpp | #include "llvm/FileCheck/FileCheck.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
#include <cmath>
using namespace llvm;
static cl::extrahelp FileCheckOptsEnv(
"\nOptions are par... | TOOL | 0.857612 | 7.240018 |
d5ae859a-7e01-44d8-af5f-e50402de44d8 | milli9d/Cracking-the-Coding-Interview | Ex01-8.cpp | /*
Zero Matrix: Write an algorithm such that if an element in an MxN matrix is 0, its entire row and
column are set to 0.
Hints:#17, #74, #702
*/
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
class EX_01_8 {
private:
// Helper Pretty Printer
void prettyPrint(vector<vector<int>>& mD... | ALGO | 0.990344 | 6.531242 |
e86c3be9-ab91-4bcf-a810-3df53d654f70 | DeepInMind12345/UEToonShading | Engine/Source/ThirdParty/ICU/icu4c-64_1/source/test/perf/dicttrieperf/dicttrieperf.cpp | #include <stdio.h>
#include <stdlib.h>
#include "unicode/bytestrie.h"
#include "unicode/bytestriebuilder.h"
#include "unicode/localpointer.h"
#include "unicode/ucharstrie.h"
#include "unicode/ucharstriebuilder.h"
#include "unicode/uperf.h"
#include "unicode/utext.h"
#include "charstr.h"
#include "package.h"
#include "t... | TEST | 0.939581 | 6.95557 |
3b774cc8-0f73-4793-ad25-8f3378422514 | payelmiah/Compititive_Programming_URI | Begginer/1014.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
float m;
cin>>n>>m;
cout<<setprecision(3)<<fixed<<n/m<<" km/l"<<endl;
}
| ALGO | 0.993841 | 3.25233 |
8b35f1ed-8533-4dc5-ad62-54010b11cae1 | steventfan/CS10 | Week3/main1.cpp | #include <iostream>
using namespace std;
int main() {
string player1name = "";
int player1yards = 0;
string player2name = "";
int player2yards = 0;
string player3name = "";
int player3yards = 0;
cout << "Enter player 1's name:";
cin >> player1name;
cout << endl;
cout... | ALGO | 0.999655 | 4.170876 |
81832b55-666b-4787-8ccf-6f1c743212ee | sudhanshu-t/DSA | HomePepCodes/Lec38,39,40,41/11_stack_infix.cpp | #include <iostream>
#include <stack>
#include <cmath>
using namespace std;
int eval(int v1, int v2, char op){
int rv = -1;
switch(op)
{
case '^':
rv = pow(v1, v2);
break;
case '*':
rv = v1 * v2;
break;
case '/':
rv = v1 / v2;
break;
case ... | ALGO | 0.999832 | 4.556581 |
d801d52d-c96c-424d-bf41-3532dd5a59d9 | perchuts/CompetitiveProgramming | AtCoder/abc288/e.cpp | #include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
#define endl '\n'
#define pb push_back
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int ll
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ii = pair<int,int>;
us... | ALGO | 0.999942 | 3.866914 |
5f93c55b-566f-4060-a665-5366c4ca74a2 | Shell-Wataru/AtCoder | Codeforces/ECR121/D.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <numeric>
using namespace std;
using ll = long long;
ll add(ll x){
for(int i=0;i<60;i++){
if (1ll<<i >= x){
return (1ll<<i) - x;
}
}
return 0;
}
int... | ALGO | 0.999859 | 4.539071 |
da1bac42-7061-4ad7-a85e-1a53ba66fd86 | jwake/wsclean | wsclean/wgridder/wgriddinggridder_simple.cpp | #include "wgriddinggridder_simple.h"
#include "gridder_cxx.h"
using gridder::detail::CodeLocation;
using namespace std;
WGriddingGridder_Simple::WGriddingGridder_Simple(size_t width, size_t height,
size_t width_t, size_t height_t, double pixelSizeX, double pixelSizeY, size_t nthreads, double epsilon,
size_t verb... | ALGO | 0.992772 | 6.091605 |
fcc1c9a5-2393-46d8-a11a-8abebced6572 | kchu-z/arena | 2022.12.18/uyifewrwwfwiuehfewiufhewiufhweuifhewuifhewuihfeuwi.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, num;
cin >> n;
vector <int> v(n);
stack <int> s;
for (int i = 0; i < n; i++) cin >> v[i];
reverse(v.begin(), v.end());
for (int i = 0; i < n; i++) {
... | ALGO | 0.999984 | 4.551437 |
976c54ae-f79a-4ae6-9559-33670fb1c202 | LordaeronESZ/LeetCode | 0136只出现一次的数字/只出现一次的数字.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int singleNumber(vector<int>& nums) {
int res = nums.front();
for (size_t i = 1; i < nums.size(); i++)
res ^= nums[i];
return res;
}
};
int main() {
Solution S;
vector<int> nums = { 2,2,... | ALGO | 0.999195 | 5.313374 |
79091025-aa36-484c-9a30-7bad557f3cbf | HimKasera/Kasera.cpp | myself/GCD.CPP | #include<iostream>
using namespace std;
int gcd(int a, int b){
if(a==0)
return b;
if(b==0)
return a;
while(a!=b){
if(a>b){
a = a-b;
}
else {
b = b-a;
}
}
return a;
}
int main(){
int a,b;
cout<< "enter tha a and b ";
cin>>a... | ALGO | 0.998715 | 4.041233 |
38e01aff-6f3c-44c6-a95a-39de968880ef | WaveMo/Language | C++/OodleSystem/main.cpp | /**
*@Date : 2018-04-20 10:22:35
*@Author : mohailang (<EMAIL>)
**/
#include <iostream>
#include <string>
#include <vector>
#include <sys/stat.h>
#include <regex.h>
#include <libgen.h>
#include <dirent.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <... | TOOL | 0.989083 | 4.057752 |
4efd489b-9a5e-4a27-8951-395d1ca50d4d | Nurayend/ADS_homeworks | lab8/lab7g.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
char a[101][101];
int cnt = 0;
bool check(int f, int s) {
bool res = true;
if (f < 0 || f >= n || s < 0 || s >= m)
res = false;
return res;
}
int const sz = 4;
int hor[sz] = {0, 1, 0, -1};
int ver[sz] = {1, 0, -1, 0}; //down, right, up, l... | ALGO | 0.999776 | 4.429556 |
9cee688f-afb8-417e-b7ba-d2069f145d8f | zFa3/CP_problems | 282A_CF_Bit++.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, counter = 0;
cin >> n;
while (n--) {
string input;
cin >> input;
if (input[1] == '+'){
counter += 1;
} else {
counter -= 1;
}
}
cout << counter << endl;
return 0;
}
| ALGO | 0.999843 | 4.199341 |
047d8c26-80ce-4f6e-ae1c-388183de43e2 | TuringKi/llvm-project-12-wasi | mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp | #include "mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h"
#include "mlir/Dialect/Linalg/IR/LinalgOps.h"
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
#include "mlir/Dialect/Linalg/Utils/Utils.h"
#include "mlir/Dialect/StandardOps/EDSC/Intrinsics.h"
#include "mlir/Dialect/Utils/StructuredOpsUtils.h"
#include... | ALGO | 0.856422 | 6.761048 |
8391cd54-a925-430b-9eb9-7d45ee49f70a | DaniGarMata/AI-Project | My project/Library/PackageCache/com.unity.ide.visualstudio@2.0.18/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.946468 | 6.933585 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.