code
large_string
generator
large_string
language
large_string
model_family
large_string
authorship
int64
label
int64
def generate_pure_cell_expressions(self, genes: list, num_av: int, cells_to_mix: List[str]) -> Dict[str, float]: average_cells = {} cells_expr = self.cells_expr.loc[genes] for cell in cells_to_mix: cells_selection = self.select_cells_with_subtypes(cell) expressions_matrix...
human
Python
human
0
0
$(document).ready(function () { // Attach event listeners to buttons $('#login').on('click', $.login); $('#forgotPassword').on('click', $.resetPassword); $('#updatePassword').on('click', $.updatePassword); $('#showHideForgot').on('click', function () { showHideForgot($('#forgotPasswordSectio...
mistralai/mistral-7b-instruct-v0.3
JavaScript
mistral
10
1
public virtual DeleteQueryDefinitionResponse DeleteQueryDefinition(DeleteQueryDefinitionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteQueryDefinitionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteQueryDefinitionRespo...
human
C#
human
0
0
package main import ( "context" "log" "net" "github.com/go-redis/redis/v8" "google.golang.org/grpc" "google.golang.org/protobuf/proto" ) type UserService struct { UnimplementedUserServiceServer Cache *redis.Client } type ProductService struct { UnimplementedProductServiceServer Cache *redis.Client } type...
gpt-4o-mini
Go
gpt
9
1
import xarray as xr from dask import array as da def resize_chunks(ds: xr.Dataset, megabytes_per_chunk: float = 100) -> xr.Dataset: mb_to_bytes = 1024 ** 2 chunk_size_bytes = int(megabytes_per_chunk * mb_to_bytes) # Calculate the size of each chunk in bytes def calculate_chunk_size(dims): size = 1 for dim in...
01-ai/yi-coder-9b-chat
Python
01-ai
4
1
import numpy as np from scipy.integrate import quad from scipy.optimize import curve_fit from scipy.interpolate import interp1d class NeutronIntensity: def __init__(self, energy, count_rate): self.energy = np.array(energy) self.count_rate = np.array(count_rate) def normalize(self): ...
microsoft/phi-3-mini-4k-instruct
Python
phi
2
1
n=int(input()) v=input() print(*[v[i] for i in range(n)], sep="") Owner Language Percent Accepted Attempts Submissions friends Python 3 39.30% 3833 9574 Friends Python 3 93.75% 9252 9635<|endoftext|># date : 2021-07-01 n = int(input()) # 26 sum = 0 temp = n while True: sum += temp%10 temp = temp//10...
01-ai/yi-coder-9b
Python
01-ai
4
1
private DataSet.Ensemble ReadEnsemble(Project project, long index) { if (project != null) { if(_cnn == null && _cnn.State != System.Data.ConnectionState.Open) { OpenConnection(project); } DataSet.Ensemble...
human
C#
human
0
0
void addressUpdated(sa_family_t expectedFamily, socklen_t addrlen) { if (getFamily() != expectedFamily) { addressUpdateFailure(expectedFamily); } if (getFamily() == AF_UNIX) { updateUnixAddressLength(addrlen); } }
human
C
human
0
0
#include <stdint.h> int oa_get_render_ctx_id(struct i915_perf_stream *stream) { // Assuming i915_perf_stream has a member or function to get hw cid if it is not cached // Here we simulate that with a hypothetical function const uint32_t hw_cid = get_hw_cid_for_stream(stream); // Cache the hw cid for the lifetime ...
01-ai/yi-coder-9b-chat
C
01-ai
4
1
write integer """ from tools import timing @timing def solve(names): k=int(names[0]) p_list=[int(names[i]) for i in range(1, k+1)] p_s = (p_list[1] + p_list[k]) / 2 marathon=0 for i in p_list: marathon+= (i - p_s) ** 2 return str(marathon) #!/usr/bin/env python """ Let's define a bea...
01-ai/yi-coder-1.5b
Python
01-ai
4
1
function mainDogAnim (e) { if(e.which!=1)return; if($(the_dog).is(':animated')) { _no=true; return; } $(the_dog).animate({ width:520, height:350, top:"+=10px", left:"+=6px" },33,null); }
human
JavaScript
human
0
0
if(n == -1): return "Do not remove testcases" entrada = [] for i in range(n - 1): l = list(map(int, input().split())) entrada.append((l, "")) produccion = Entrada(l, "") produccion.execucion() segun
meta-llama/llama-3.2-3b
Python
meta-llama
3
1
class DirectEvent : public MatrixEvent { public: bool isRoomDirect(std::string roomId) { return true; // Replace with actual logic } std::optional<std::string> getUserIdForRoomId(std::string roomId) { return std::nullopt; // Replace with actual logic } std::vector<std::stri...
ibm-granite/granite-8b-code-instruct-4k
C
ibm-granite
6
1
the result of each case in the new line. void solve(){ int n; cin >> n; vector<int> nums(n); for(int i=0; i<n; i++) cin >> nums[i]; int totalInv=0, ones=0; for(int i=0; i<n; i++){ if(nums[i]==1) ones++; if(nums[i]==0){ int zeroIndx=i; while(zeroIndx<n && nu...
deepseek-ai/deepseek-coder-6.7b-instruct
C++
deepseek
8
1
"Time" here refers to the current speed user has. Here is some of my Non-Submission Code Understand this problem better: /** * * 4 * * 243 306 * 3 570 * 14 492 * 4 521 * * @param s: input string * @return: output string */ public class Solution { public String r...
deepseek-ai/deepseek-coder-6.7b-instruct
Java
deepseek
8
1
public void DrawEllipse(Vector2Int p0, Vector2Int p1, Color32 col, int size) { using (new ProfilerSample("Draw Ellipse")) { Vector2Int center = p1 + p0; center.x /= 2; center.y /= 2; Vector2Int extent = p1 - p0; extent.x = Mathf.Abs(extent.x / 2); extent.y = Mathf.Abs(extent.y / ...
human
C#
human
0
0
using NSubstitute; using NUnit.Framework; using SFA.DAS.LoginService.Application.Invitations.Reinvite; using SFA.DAS.LoginService.Domain.Invitations; namespace SFA.DAS.LoginService.Application.UnitTests.Invitations.Reinvite { [TestFixture] public class When_Reinvite_called_with_valid_invitation { p...
google/gemma-3-12b-it
C#
gemma
5
1
import sys import math import collections import bisect def get_ints(): return map(int, sys.stdin.readline().strip().split()) def get_list(): return list(map(int, sys.stdin.readline().strip().split())) def get_string(): return sys.stdin.readline().strip() for t in range(1): (n, r) = get_ints() arr = get_list() ...
human
Python
human
0
0
def calc_slide_size(segment_time, previous_segment): if not previous_segment: return 0 segment_start, segment_end = segment_time slide_size = np.random.choice(list(range(KEYWORD_INTERVAL_MIN, KEYWORD_INTERVAL_MAX))) previous_start, previous_end = previous_segment if previous_start - ACTIVE_A...
human
Python
human
0
0
static fpga_result vtpPinRegion( _mpf_handle_p _mpf_handle, uint64_t len, void* buf_addr, uint32_t pt_flags ) { fpga_result r; const size_t page_mask_2mb = mpfPageSizeEnumToBytes(MPF_VTP_PAGE_2MB) - 1; const bool preallocated = (pt_flags & MPF_VTP_PT_FLAG_PREALLOC); uint8_t* page = buf_a...
human
C
human
0
0
# Enable or disable the buttons (depending on the boolean variable) # self.some_button.setEnabled(boolean) # Mark the relevant button as true if __name__ == "__main__": app = QtWidgets.QApplication(sys.argv) window = AdditionalSimulationParameterGUI() window.show() sys.exit(a...
gpt-4o-mini
Python
gpt
9
1
public override void RenderControl( HtmlTextWriter writer ) { if ( this.Visible ) { writer.AddAttribute( HtmlTextWriterAttribute.Style, "margin-top:0;" ); writer.RenderBeginTag( HtmlTextWriterTag.H3 ); _lblGroupTypeName.Text = _tbGroupTypeN...
human
C#
human
0
0
import unittest import numpy as np def spatial_smoothing(image, window_size): # Dummy implementation of spatial smoothing # In a real scenario, this function would apply a spatial smoothing filter # Here we just return the image as is for the sake of example return image class TestSpatialSmoothing(uni...
qwen/qwen2.5-72b-instruct
Python
qwen
1
1
synchronized AbstractJPPFSnapshot copy(final AbstractJPPFSnapshot ts) { ts.total = total; ts.latest = latest; ts.min = min; ts.max = max; ts.avg = avg; ts.valueCount = valueCount; return ts; }
human
Java
human
0
0
TEST(velocityControlTest, spg_workaround_necessity) { TRACE_FUNCTION(""); // Prepare auto vc = defaultVelocityControlSetup(); vc.data.robot.position = pose(0, 0, 0); vc.data.target.pos = pose(0, 0, 0.004); vc.data.ppConfig.deadzone.toleranceRz = 0.001; vc.data.vcSetpointConfig.type = Veloci...
human
C++
human
0
0
using System.Diagnostics; using QuickGraph; namespace BefunDebug.Graph { [DebuggerDisplay("{Source.ID} -> {Target.ID}")] public class PocEdge : Edge { public string ID { get; private set; } public PocEdge(string id, PocVertex source, PocVertex target) : base(source, target) { ID = id; } }...
human
C#
human
0
0
no = int(input()) li = [] li2 = [] for i in range(0, no): li.append(int(input())) for i in li: temp = i tl = [] while temp != 0: tl.append(temp % 10) temp = temp // 10 temp = i tl2 = [] while tl != []: if tl[len(tl) - 1] == 0: tl.pop() else: mul = tl[len(tl) - 1] * pow(10, len(tl) - 1) tl2.appen...
human
Python
human
0
0
private void ensureDoesNotExceedLiquidation( final User user, final Market market, final BigDecimal price ) { Position position = positionService.getAndCreate(user, market); if(position.getQuantity().doubleValue() > 0) { if(position.getSide().equals(Ma...
human
Java
human
0
0
public static Parameter createParameter (String name, String value, boolean ignoreUnknown) { ParameterState state = ParameterState.lookup(name); if (state != null) { if (value == null) { return null; } switch (state.getType()) { cas...
human
Java
human
0
0
length = int(input()) string = list(input()) cnt = 1 try: while cnt <= len(string) - 1: if string[cnt] == string[cnt - 1] or string[cnt] == string[cnt + 1]: string.pop(cnt) cnt = 0 cnt += 1 except IndexError: if len(string) == 2: if string[0] == string[1]: string.pop() print(length - len(string))
human
Python
human
0
0
#include<bits/stdc++.h> #define vi vector<int> #define ff first #define ss second #define pb push_back #define ll long long #define pii pair<int, int> using namespace std; const int mxN = 1e6 + 5; const int mod = 1e9 + 7; int n, m, child[mxN][2]; vi a, b; vector<vi> dp, prefix_sum; bool cmp(const pii &a, const pii ...
human
C++
human
0
0
, do not output anything else. This code must run in $1.5s$ at most on input size $n = 5 \cdot 10^5$. Fri Jan 27 15:44:01 2020 ---In the example, moving every figure to one cell of the $5\times5$ board involves $4 \cdot 4=16$ moves: from (11,11) to (11,12) from (11,11) to (10,11) from (11,11) to (12,11) from (11,...
microsoft/phi-3-mini-4k-instruct
Python
phi
2
1
from collections import Counter from collections import defaultdict import math t = int(input()) for _ in range(0, t): (a, b, c, d) = list(map(int, input().split())) m = max(b * c, b * (a - c - 1), a * (b - d - 1), a * d) print(m)
human
Python
human
0
0
t = int(input()) def fucn(n): for i in range(int(floor(n)),0,-1): n = n-(2**i - 1) if n<0: break elif n == 0: #print("global case",n) return 1 for i in range(t): n = int(input()) count = 0 temp = n while(True): if(fuc...
bigcode/starcoder2-15b
Python
bigcode
7
1
namespace ExampleApp.Clients.Services.Messaging { public interface IMessagingService { Task SubscribeAsync(string channelName); Task UnsubscribeAllAsync(); } }
gpt-4o
C#
gpt
9
1
<?php namespace App\Seeder\Development; use Illuminate\Database\Seeder; use DB; use Webpatser\Uuid\Uuid; use App\Model\User; use App\Model\Group; use App\Model\UserGroup; use App\Model\PassportModel\PassportClient; class UserGroupSeeder extends Seeder { /** * Run the database seeds. * * @return voi...
human
PHP
human
0
0
def to_csv(self, path, *, delimiter=","): if not path.endswith(".csv"): path += ".csv" with open(path, mode="w", encoding="utf-8") as f: f.write(f"{delimiter.join(self.columns)}\n") for row in self.data["rows"]: f.write(f"{delimiter.join(f'{i}' for i i...
human
Python
human
0
0
def target_confidence_interval(observed_target, sample_args, level=0.95): q = (1.0 - level) / 2.0 v = observed_target.flatten() s = np.sort(np.random.choice(v, size=(v.size,) + sample_args).mean(1)) lo = np.searchsorted(s, v) + v.size * q - 1 up = np.searchsorted(s, v, 'right') + v.size * (1 - level...
mistralai/mistral-small-24b-instruct-2501
Python
mistral
10
1
import math while 1: (r0, w0, c, r) = map(int, input().split()) if r0 == w0 == c == r == 0: break r1 = w0 * c if r1 <= r0: print('0') else: nw = r1 - r0 print(math.ceil(nw / r))
human
Python
human
0
0
from collections import defaultdict def __starting_point(): (n, T) = [int(_) for _ in input().split()] data = defaultdict(list) for i in range(n): (t, q) = [int(_) for _ in input().split()] data[T - t].append(q) prev_level = [] for level_id in range(1, T + 1): level = sorted(data[T - level_id] + prev_level,...
human
Python
human
0
0
Python # Get the input X, Y, Z, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) # Sort the lists in descending order A.sort(reverse=True) B.sort(reverse=True) C.sort(reverse=True) # Initialize a list to store the sums of delicio...
01-ai/yi-coder-1.5b-chat
Python
01-ai
4
1
// Initialize HTML elements const videoInput = document.getElementById('videoInput'); const selectedVideo = document.getElementById('selectedVideo'); const playerStatus = document.getElementById('playerStatus'); const sourceBuffer = videoInput.srcBuffer; let playing = false; // Handle video file selection videoInput.a...
qwen/qwen2.5-coder-1.5b-instruct
JavaScript
qwen
1
1
function validateDestinations(theForm, numForms, bRequired) { for (let i = 0; i < numForms; i++) { let form = theForm[i]; let fields = Object.keys(form); let valid = fields.some(field => { if (field === 'destination') { return form[field] !== undefined && form[fie...
deepseek-ai/deepseek-coder-1.3b-instruct
JavaScript
deepseek
8
1
testcases = [ #(2, 3, 0, [(2, 1), (1, 3), (3, 4), (4, 1), (1, 3)], 6, [3, (2, 1, 3), (2, 3, 1), 1, (2, 3, 1), (1, 2, 3), 1]), (4, 3, 0, [(2, 1),(1, 3),(3, 4),(4, 1),(1, 2, 3),(2, 3, 1)], 3, [3, 1, 2]) ] import numpy as np from collections import defaultdict from operator import itemgetter n, m = 0, 0 fr...
microsoft/phi-3-mini-4k-instruct
Python
phi
2
1
<?php namespace App\Http\Controllers; use App\Charity; use App\Notifications\AcceptVolunteerRequestNotification; use App\Project; use App\Volunteer; use Illuminate\Http\Request; use Auth; class CharityController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\...
human
PHP
human
0
0
from sys import stdin stdin.readline def mp(): return list(map(int, stdin.readline().strip().split())) def it(): return int(stdin.readline().strip()) for _ in range(it()): (a, b, n, s) = mp() rem = s % n if b >= rem: if s - n * a <= b: print('YES') else: print('NO') else: print('NO')
human
Python
human
0
0
'use strict'; var config = require('../../../config'); var jwt = require('jsonwebtoken'); function initJwt(req, res) { // TODO: Implement user auth. if(!req.body.user || !req.body.password) { return 'Error, cos of reasons'; } var token = jwt.sign( { user: 'guest' }, config.JWT_SECRET, { expir...
human
JavaScript
human
0
0
to 1 second Explanation: Here we are having to solve three things: • Firstly, for $$5$$: count of number we require from $$F$$ class . • Second task is finding total no if element having value of zero .i am printing . • We have two numbers of size a where the elements can occur $$i \leq r . So total combinations = s...
qwen/qwen2.5-coder-1.5b
C++
qwen
1
1
public static final class ActionConflictException extends Exception { private final Artifact artifact; private final Action previousAction; private final Action attemptedAction; public ActionConflictException(Artifact artifact, Action previousAction, Action attemptedAction) { super(Strin...
human
Java
human
0
0
import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.DESKeySpec; import javax.crypto.spec.SecretKeySpec; import java.util.Base64; import java.security.NoSuchAlgorithmException; import java.security.InvalidKeyException; public class DESEncryption { p...
microsoft/phi-3.5-mini-instruct
Java
phi
2
1
D = list(map(int, input().split())) def s(x): return min(abs(x), 24-abs(x)) ans = 0 for i in range(24): tmp = 0 for j in range(N): tmp = max(tmp, s(i-D[j])) ans = max(ans, tmp) print(ans)
ibm-granite/granite-8b-code-base-4k
Python
ibm-granite
6
1
{{% gist 5274298 %}} ''' n,height=map(int,raw_input().strip().split(' ')) temp=raw_input().strip().split(' ') array=[] for i in temp: array.append(int(i)) array.sort() f="0" z=[] for i in array: z.append(str(i)) a=" ".join(z) while a!=a[::-1]: f+="1" print int(f)
01-ai/yi-coder-1.5b
Python
01-ai
4
1
public boolean completeTransaction(TransactionTicket ticket){ boolean user1ConfirmStatus = ticket.getIsUser1Confirmed(); boolean user2ConfirmStatus = ticket.getIsUser2Confirmed(); if (user1ConfirmStatus && user2ConfirmStatus){ ticket.setIsCompleted(true); return true; ...
human
Java
human
0
0
n = int(input()) d = {} for i in range(n): val = int(input()) if val in d.keys(): d[val] += 1 else: d[val] = 1 for i in d.keys(): for j in d.keys(): if i == j: continue if d[i] == d[j]: if d[i] + d[j] == n: print('YES') print(i, j) quit() print('NO')
human
Python
human
0
0
spoonerize = lambda w: (lambda w: ' '.join([w[1][0] + w[0][1:], w[0][0] + w[1][1:]]))(w.split(' '))
human
Python
human
0
0
for _ in range(int(input())): (a, b, c) = [int(o) for o in input().split()] k = abs(a - b) * 2 if a > k or b > k or c > k: print(-1) else: p = (c - 1 + k // 2) % k + 1 print(p)
human
Python
human
0
0
static char *ipifcconnect(struct conv *c, char **argv, int argc) { ERRSTACK(1); char *err; struct Ipifc *ifc; ifc = (struct Ipifc *)c->ptcl; if (ifc->m == NULL) return "ipifc not yet bound to device"; if (waserror()) { wunlock(&ifc->rwlock); nexterror(); } wlock(&ifc->rwlock); while (ifc->lifc) { err =...
human
C
human
0
0
import java.io.*; import java.util.*; public class Codeforces{ static long mod = 1000000007L; // map.put(a[i],map.getOrDefault(a[i],0)+1); // map.putIfAbsent; static MyScanner sc = new MyScanner(); //<----------------------------------------------WRITE HERE----------------------------...
human
Java
human
0
0
class Item { /** * Constructor * * @param {string} name * @param {float|int} [optimistic] * @param {float|int} [pessimistic] * @param {float|int} [mostLikely] */ constructor (name, optimistic, pessimistic, mostLikely) { this.id = uuidv4() this.name = name ...
human
JavaScript
human
0
0
def solve(): n_vectors = int(input()) sum_x = 0 sum_y = 0 sum_z = 0 for _ in range(n_vectors): (x, y, z) = map(int, input().split()) sum_x += x sum_y += y sum_z += z if sum_x == sum_y == sum_z == 0: print('YES') else: print('NO') solve()
human
Python
human
0
0
void kaProjectDataManager::SetCurrentFileData(kaFileInformation fileInfoType, gtString& fileInfo) { kaApplicationTreeHandler* pTreeHanlder = kaApplicationTreeHandler::instance(); GT_IF_WITH_ASSERT(pTreeHanlder != nullptr) { osFilePath filePath; if (pTreeHanlder->GetActiveItemFilePath(filePa...
human
C++
human
0
0
using System; namespace Quizzer.Domain.Exceptions { /// /// Exception thrown when the game was not found /// public class GameNotFoundException : Exception { public GameNotFoundException(ulong id) : base($"Game {id} not found") { } public GameNotFoundException() ...
human
C#
human
0
0
for _ in range(int(input())): n, q = map(int, input().split()) s = input() for _ in range(q): l, r = map(int, input().split()) l -= 1 r -= 1 prev = 0 flag = False for i in range(l): if s[i] == s[l]: prev += 1 flag = ...
meta-llama/llama-3.3-70b-instruct
Python
meta-llama
3
1
python def canSayHello(word): i=0 j=0 while i < len(word) and j < len("hello"): if word[i] == "h": j += 1 elif word[i] in "eli": j += 1 if j > 2: return True i += 1 if j < 2: return False i = 0 j = 0 while i < len(wo...
01-ai/yi-coder-1.5b-chat
Python
01-ai
4
1
class DynamicProgrammingConsecutiveSubarray: def findAllBeautifulSubarrays(self, an_array,k: int): ''' Counts the number of beautiful subarrays in an_array. Args: an_array: the input array k: the sum of the lengths of the subarrays Returns: ...
qwen/qwen2.5-coder-1.5b
Python
qwen
1
1
import java.time.Duration; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Logger; public class WorkflowMonitor { private static final Logger LOGGER = Logger.getLogger(WorkflowMonitor.class.getName...
microsoft/phi-3-mini-4k-instruct
Java
phi
2
1
void acl_mem_destructor_callback(cl_mem mem) { // Assume mem->destructor_callbacks is a linked list of callback structures LockGuard lock(mem->mutex); // Locking the memory object // Pointer to the head of the linked list DestructorCallback* current = mem->destructor_callbacks; DestructorCallback* ...
gpt-4o
C++
gpt
9
1
from django.db import models class GreenhouseData(models.Model): value_id = models.AutoField(primary_key=True) timestamp = models.DateTimeField(auto_now_add=True) light_sufficient = models.BooleanField() ventilator_on = models.BooleanField() humidity_inside = models.IntegerField() temperature_inside = mode...
human
Python
human
0
0
t = int(input()) while t != 0: n = int(input()) txt = input() v = txt.split(' ') if int(v[0]) + int(v[1]) <= int(v[n - 1]): print(1, 2, n) else: print(-1) t -= 1
human
Python
human
0
0
import requests from urllib.parse import urlparse, urlunparse, parse_qs, urlencode def transform_uris_to_urls_with_target_rate(uris_load, target_rate, filters=None): transformed_urls = [] for uri in uris_load: # Parse URI to extract components uri_components = urlparse(uri) # Check ...
microsoft/phi-3-medium-4k-instruct
Python
phi
2
1
n = int(input()) d = dict() for _ in range(n): a = input() d[a] = d.get(a, 0) + 1 s = sorted([(v, k) for (k, v) in d.items()], reverse=True) print(s[0][1])
human
Python
human
0
0
inp = open(1, buffer = 0.2 **385 -896)sys.stdin = lambda : sys for siz, li1t in map(lambda s:(int s in open1('stdin','rt',1)): i+=list(), [] [input_iterator for i] for it)1: for e[input_reader1() for_ in range] if: i[input it for s(liter] s in it] else : [ input] it ...
bigcode/starcoder2-7b
Python
bigcode
7
1
def fetch_config(self, raw_config_key: str, update_cache: bool = True) -> Optional[ConfigData]: request_url = self.generate_url(path=CGI_CONFIG, action='getConfig', name=raw_config_key) response_obj, response_text = self.make_request(request_url) result = self._process_response(response_obj, res...
human
Python
human
0
0
#include<bits/stdc++.h> #define N 100005 using namespace std; typedef pair<int,int> P; typedef long long ll; int n,e,s[2]; vector<int> G[N]; int color[N]; void dfs(int x,int c){ color[x]=c; s[c]++; for(int i=0;i<G[x].size();i++){ int nx=G[x][i]; if(color[nx]!=-1){ if(color[x]==color[...
human
C++
human
0
0
import java.io.*; import java.nio.file.*; import java.util.*; import java.util.stream.*; public class RemovableMediaPackages extends FileSystems { private Map<Path, Set<String>> availablePackages; public RemovableMediaPackages() { this.availablePackages = new HashMap<>(); } public void addPac...
ibm-granite/granite-3.3-8b-instruct
Java
ibm-granite
6
1
private void plan(Facility dst) { if (plan != null && target != null && target.equals(dst)) { return; } target = dst; plan = Planner.plan(this, dst); }
human
Java
human
0
0
def cancel_coupon(coupon_data): """ Cancels a coupon code using the provided organization_id and coupon_data. :param coupon_data: A dictionary containing 'coupon_code' and 'organization_id'. :return: The cancelled coupon code. """ # Assuming there's a function `cancel_coupon_at_organization` th...
ibm-granite/granite-3.2-2b-instruct
Python
ibm-granite
6
1
#include <stdio.h> void print_array(int A[], int size) { int i; for (i=0; i < size; i++) printf("%d ", A[i]); printf("\n"); } void insertion_sort(int A[], int size) { int i, j, key; for (i = 1; i < size; i++) { key = A[i]; j = i - 1; while (j >= 0 && A[j] > key) { ...
deepseek-ai/deepseek-coder-6.7b-instruct
C
deepseek
8
1
#include<bits/stdc++.h> using namespace std; int n; const int maxn = 2e5 + 5; int a[maxn]; int sumleft[maxn]; void solve(){ scanf("%d", &n); for(int i = 1; i <= n; i++){ scanf("%d", &a[i]); sumleft[i] = sumleft[i-1] + a[i]; } int ans = 0; int sumright = 0; for (int i = n; i > 0; i--)...
human
C++
human
0
0
import ( "context" "fmt" "image" "image/color" "math/rand" "time" "golang.org/x/time/rate" ) // NewImage returns a random image based on seed, with the given width and // height. // // NewImage uses the context to create spans that measure the performance of its // internal parts. func NewImage(ctx context.Con...
google/gemma-3-27b-it
Go
gemma
5
1
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
human
C#
human
0
0
def _on_click_f2_next(self): lang = self.ddnGuiLanguage.get() self.pref = list() self.pref_char = list() text = self.txtPrefChar.get(0.0, 9999.9999).strip() text = ' '.join(text.split('\n')) text = ' '.join(text.split('\r')) text = ' '.join(text.split('\f')) ...
human
Python
human
0
0
luck = [4, 7, 47, 74, 447, 474, 477, 744, 747, 774] n = int(input()) for i in luck: if n % i == 0: print('YES') quit() print('NO')
human
Python
human
0
0
public void close() throws TransportException { this.log.debug("Closing amqp connection..."); closeAsync(); try { closeReactorLatch.await(MAX_WAIT_TO_CLOSE_CONNECTION, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { log.warn(...
human
Java
human
0
0
from flask import Flask, request, jsonify from flask_sqlalchemy import SQLAlchemy from marshmallow import Schema, fields, ValidationError from werkzeug.exceptions import NotFound, BadRequest, InternalServerError app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///users.db' db = SQLAlchemy(app) # ...
gpt-4o-mini
Python
gpt
9
1
for this problem is 100. */ #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { int n; cin >> n; vector<string> teams; for (int i = 0; i < n; i++) { string team; cin >> team; teams.push_back(team); } sort(team...
01-ai/yi-coder-1.5b
Python
01-ai
4
1
using System; namespace Interactions { public class MoreMoneyAndGoAwayHandler { /// <summary> /// Handles the moremoney and goaway interaction with the current customer. /// The customer has to subscribe to the events themselves /// </summary> public void HandleInteracti...
meta-llama/meta-llama-3.1-70b-instruct-turbo
C#
meta-llama
3
1
__author__ = 'Ryabchun Vladimir' n = int(input()) line = '' pointer = 1 while len(line) <= n: line += str(pointer) pointer += 1 print(line[n - 1])
human
Python
human
0
0
package com.zto.testcase.controller.basic; import com.zto.testcase.request.LoginRequest; import com.zto.testcase.response.Result; import com.zto.testcase.service.LoginService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import java.util.Map; import javax.annotation.Resource; import o...
human
Java
human
0
0
class Solution: def lastNonEmptyString(self, s: str) -> str: n = len(s) dic = {} max_ = 0 for i, c in enumerate(s): if c not in dic: dic[c] = [1, i] max_ = max(dic[c][0], max_) else: dic[c] = [dic[c][0] + 1, i...
human
Python
human
0
0
arr = list(map(int,input().split())) ind = n//2 arr.sort() if n%2 == 1: ind -= 1 print(arr[ind]) for _ in range(0,n-1): ind1 = arr.index(np.median(arr)) print(np.median(arr[:ind1] + arr[ind1+1:])) arr.pop(ind1)/README.md # AtCoder-Problems  合格した人は見に行きましょう ## AtCoder  nikkei2019本戦(2019山陽高校プログラミングコ...
bigcode/starcoder2-3b
Python
bigcode
7
1
class Solution { public: bool vis[30]; int dfs(vector<int>& a,int len,int n,int stick,int ret) { if(stick==n && ret==0)//ret是代表的是以及一个棒已经拼的长度的 return len;//如果所有的棒都已经用完的话 if(ret==0)//这代表一个已经拼完 ret = len; for(int i=0; i<n; i++) { if(vis[i]) ...
human
C++
human
0
0
#include <iostream> #include <vector> #include <thread> #include <mutex> #include <asio.hpp> using asio::ip::tcp; // Struct to represent game state struct GameState { std::vector<std::string> players; std::mutex mutex; // Protects game state access }; // Class representing the server class GameServer { publi...
gpt-4o-mini
C++
gpt
9
1
. The code will be tested on different inputs and should always produce correct output. """ def solve(s: str) -> str: vowels = set("AaOoYyEeUuIi") result = [] for char in s: if char not in vowels: result.append("." + char.lower()) return "".join(result) print(solve("tour")) # outp...
01-ai/yi-coder-9b-chat
Python
01-ai
4
1
t = int(input()) for i in range(t): n = int(input()) s = str(input()) j = n - 1 ind = 0 while j >= 0: if s[j] != '0': ind = j break else: j = j - 1 sum = 0 count = 0 p = 0 for k in range(ind + 1): if (int(s[k]) + sum) % 2 == 0 and int(s[0:k + 1]) % 2 != 0: p = int(s[0:k + 1]) break else:...
human
Python
human
0
0
required as a contestant, otherwise ignored. #(this is just conjectured to be the solution, it may be wrong) def max_val(a): n = len(a) a.sort() ans = 0 for i in range(n): for j in range(i + 1, n): for k in range(j + 1, n): for l in range(k + 1, n): ...
qwen/qwen2.5-coder-1.5b
Python
qwen
1
1
(n, m) = map(int, input().split()) if n < m: print('-1') elif n == m: print(n) else: num = n // 2 rem = n % 2 if rem == 0: while num % m != 0: num = num + 1 print(num) elif rem > 0: num1 = num + rem while num1 % m != 0: num1 = num1 + 1 print(num1)
human
Python
human
0
0
func parseClass(classes map[string]int, classCounter *int, line []string) int { class := line[categoryPosition] if _, ok := classes[class]; !ok { classes[class] = *classCounter *classCounter++ } return classes[class] }
human
Go
human
0
0
#!/usr/bin/env node // dependencies const assert = require('assert'); /* eslint-disable no-console */ const help = () => { console.log(`Usage: polkadai-js-util <COMMAND> Commands: --help print this help and exit --erc20-slot <address> Display the storage slot for an ER...
ibm-granite/granite-8b-code-instruct-4k
JavaScript
ibm-granite
6
1