text stringlengths 0 26.7k | image imagewidth (px) 16 768 | language stringclasses 32
values |
|---|---|---|
```go
package main
import "fmt"
func main() {
var roomNum, wayNum int
fmt.Scan(&roomNum, &wayNum)
type way struct {
A int
B int
}
rooms = make([]room, roomNum+1)
for i := 0; i < wayNum; i++ {
var a, b int
fmt.Scan(&a, &b)
//ways[i] = way{Ai: a, B: b}
roomA := rooms[a]
if roomA.ID != 0 {
roomA.... | Go | |
```c
/*
* Copyright (c) 2012 Sander van der Burg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, m... | C | |
```c
MaybeHandle<JSGlobalProxy> maybe_global_proxy,
v8::Local<v8::ObjectTemplate> global_object_template);
// Traverses the pointers for memory management.
void Iterate(RootVisitor* v);
// Tells whether bootstrapping is active.
bool IsActive() const { return nesting_ != 0; }
// Support for thread pre... | C | |
```python
from unittest import TestCase
from unittest.mock import patch, MagicMock
import click
import posixpath
from parameterized import parameterized
from samcli.lib.cli_validation.image_repository_validation import (
image_repository_validation,
_is_all_image_funcs_provided,
)
from samcli.lib.providers.pr... | Python | |
```go
package main
import "fmt"
func main() {
var n, m int
fmt.Scan(&n, &m)
hill := make(map[int]int, n)
for a:=0; a<n; a++ {
var t int
fmt.Scan(&t)
hill[a] = t
}
load := make(map[int][]int, n)
for i:=0; i<m; i++ {
var from, to int
fmt.Scan(&from, &to)
load[from] = append(load[from], to)
load[t... | Go | |
```python
# ABC150C - Count Order
from itertools import permutations
def main():
N, *PQ = map(int, open(0).read().split())
P, Q = PQ[:N], PQ[N:]
perms = tuple(permutations(range(1, N + 1)))
ans = abs(perms.index(P) - perms.index(Q))
print(ans)
if __name__ == "__main__":
main()
``` | Python | |
```python
class MyClass(object):
@staticmethod
def staticFunc(a, b):
return a + b
def someFunc(self, a, b):
return a - b
@staticmethod
def raisingFunc():
raise Exception("hello")
def test_kwargs(a, b):
return a - b
def test_dict():
a = { "Hello" : 0,
"World" : 1,
"Yay" : 5 }
... | Python | |
```c
#include<stdio.h>
int main(){
int n,a,b;
scanf("%d%d%d",&n,&a,&b);
printf("%d\n",(n*a>=b?b:n*a));
return 0;
}
``` | C | |
```javascript
$(document).ready(function(){
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
tinymce.init({
menubar: false,
selector:'textarea.richTextBox',
skin: 'actadmin',
min_height: 600,
resize: 'vertical',
plugins: 'l... | JS | |
```yaml
version: '2'
services:
rabbitmq:
image: rabbitmq:3-management
restart: always
ports:
- 15672:15672
logging:
options:
max-size: "10m"
max-file: "10"
config:
environment:
CONFIG_SERVICE_PASSWORD: $CONFIG_SERVICE_PASSWORD
image: marcinu2l/microservices... | YAML | |
```python
# [anchor_count, (y1, x1, y2, x2)]
anchors = []
for i in range(len(scales)):
anchors.append(generate_anchors(scales[i], ratios, feature_shapes[i],
feature_strides[i], anchor_stride))
return np.concatenate(anchors, axis=0)
##########################... | Python | |
```csharp
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class MyProgram
{
public static void Main()
{
int D = int.Parse(Console.ReadLine());
Console.Write("Christmas");
for(int i = 0 ; i < 25-D ; i++)
{
Console.... | C# | |
```
package Volatile13 is
type Index_Map (Length : Natural) is record
Map : String (1 .. Length);
end record;
type Index_Map_Access is access all Index_Map;
pragma Volatile (Index_Map_Access);
type Shared_String (Size : Natural) is limited record
Length : Natural := 0;
Index_Map :... | PlainText | |
```kotlin
import java.lang.Math
fun main(args: Array<String>) {
val n = readLine()!!.toLong()
// 2 <=n <=10**12 1000000000000
var ans = n - 1
val sqrt = Math.sqrt(n.toDouble())
for (x in (1..(1 + sqrt.toInt())).reversed()) {
if (n % x == 0L) {
val y = n / x
ans = ... | Kotlin | |
```cpp
/**
* @file
* @brief Functions for blood, chunk, & corpse rot.
**/
#include "AppHdr.h"
#include "rot.h"
#include <algorithm>
#include "butcher.h"
#include "delay.h"
#include "english.h"
#include "env.h"
#include "item-prop.h"
#include "items.h"
#include "player-equip.h"
#include "religion.h"
#include "sho... | C++ | |
```javascript
"use strict";
function main(input) {
input = input.trim().split("\n");
const T = parseInt(input[2]);
const line_one = input[0].split(" ");
const line_two = input[1].split(" ");
let A = parseInt(line_one[0]);
let B = parseInt(line_two[0]);
// for (let i = 0; i < T; i++) {
// A = A + par... | JS | |
```python
from collections import Counter
n = int(input())
v = list(map(int,input().split()))
ac = Counter(v[::2]).most_common(2)
bc = Counter(v[1::2]).most_common(2)
if ac[0][0] != bc[0][0]:
ans = n - ac[0][1] - bc[0][1]
else:
if len(bc) == 1 or len(ac) == 1:
... | Python | |
```kotlin
package com.shvatov.prices.service
import com.shvatov.prices.data.Good
import com.shvatov.prices.data.Shop
/**
* @author shvatov
*/
interface ShopPriceParser {
/**
* Shop this parser is used to fetch data from.
*/
val shop: Shop
/**
* Parses the data from the site according to ... | Kotlin | |
```java
* Sets (as xml) the "messageLayer" element
*/
public void xsetMessageLayer(org.apache.xmlbeans.XmlString messageLayer)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlString target = null;
target = (org.apache.xmlbeans.XmlStr... | Java | |
```cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{
string n;
cin >> n;
for (int i = 0; i < n.length(); i++)
{
if (n.at(i) == '7')
{
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}
``` | C++ | |
```
/*!
* jQuery SmartWizard v5
* jQuery Wizard Plugin
* http://www.techlaboratory.net/smartwizard
*
* Created by Dipu Raj
* http://dipu.me
*
* Licensed under the terms of MIT License
* https://github.com/techlab/jquery-smartwizard/blob/master/LICENSE
``` | PlainText | |
```go
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
var sc = bufio.NewScanner(os.Stdin)
func nextStr() string {
sc.Scan()
return sc.Text()
}
func nextInt() int {
sc.Scan()
i, e := strconv.Atoi(sc.Text())
if e != nil {
panic(e)
}
return i
}
func main() {
sc.Split(bufio.ScanWords)
s ... | Go | |
```cpp
TCLAP::CmdLine cmd("Track on video stream.", ' ', "0.9");
TCLAP::ValueArg<std::string> detectorArg("d", "detector", "Detector to provide initial bounds.", true, "classifier.xml", "XML file", cmd);
TCLAP::ValueArg<std::string> trackerArg("t", "tracker", "Tracker to align landmarks based i... | C++ | |
```javascript
load("bf4b12814bc95f34eeb130127d8438ab.js");
load("93fae755edd261212639eed30afa2ca4.js");
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 15.4.4.14-5-28
description: >
Array.prototype.indexOf - side ef... | JS | |
```dockerfile
FROM centos:7.6.1810
RUN yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo \
&& yum install -y epel-release \
&& yum install -y redis luajit openresty git \
&& git clone https://github.com/SinaMSRE/ABTestingGateway \
&& /bin/cp -rf /usr/local/openresty/... | Dockerfile | |
```c
/*
* Wi-Fi Protected Setup - internal definitions
* Copyright (c) 2008-2012, Jouni Malinen <j@w1.fi>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
*/
#ifndef WPS_I_H
#define WPS_I_H
#include "wps.h"
#include "wps_attr_parse.h"
struct wps_nfc_pw_tok... | C | |
```javascript
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
window.Vue = require('vue');
/**
* The following block o... | JS | |
```c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
intmain(void)
{
char num_str[1002];
int num;
long sum =0;
int i;
char tmp;
while (1)
{
fgets(num_str, sizeof(num_str), stdin);
if (num_str[0] == '0') break;
for(i = 0; i < strlen(num_str)-1; i++)
{
tmp = num_str[i];
num = atoi(&tmp)... | C | |
```yaml
---
name: SalesNexus, LLC
description: Welcome to SalesNexus! We are the leading CRM Company that helps you
with effective lead generation and lead management plus sales automation with the
utmost ease.
image: ""
created: "2021-02-04"
modified: "2021-02-04"
specificationVersion: "0.14"
x-rank: "7"
x-alexaR... | YAML | |
```
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DIMENSION WSAVE(*)
IF (N .EQ. 1) RETURN
IW1 = N+N+1
IW2 = IW1+N+N
CALL CFFTI1 (N,WSAVE(IW1),WSAVE(IW2))
RETURN
END
``` | PlainText | |
```go
package golinters
import (
"honnef.co/go/tools/staticcheck"
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
)
func NewStaticcheck() *goanalysis.Linter {
analyzers := analyzersMapToSlice(staticcheck.Analyzers)
setAnalyzersGoVersion(analyzers)
return goanalysis.NewLinter(
"staticcheck",
"S... | Go | |
```ruby
value :UNKNOWN, 1
value :URL_CRAWL_ERROR, 2
value :INVALID_VALUE, 3
end
end
end
module Google
module Ads
module GoogleAds
module V2
module Errors
KeywordPlanIdeaErrorEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v2.errors.K... | Ruby | |
```
# -*- Makefile -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2018 all rights reserved
#
# project defaults
include opal.def
# package name
PACKAGE = html
# the python modules
EXPORT_PYTHON_MODULES = \
Element.py \
ElementContainer.py \
Literal.py \
__init__.py
# standard targets
all: expor... | PlainText | |
```c
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... | C | |
```rust
Penny,
Nickel,
Dime,
Quarter(UsState),
}
fn value_in_cents(coin: Coin) -> u8 {
// This seems very similar to an expression use with if,
// but there's a big difference: with if,
// the expression needs to return a Boolean value,
// but match, it can be any type.
match coin {
... | Rust | |
```
"poly_trinity_spoly",
``!(r s):'a ring. s <= r ==> !a b c. Poly s (trinity a b c)``,
rw_tac std_ss[poly_X_spoly, poly_exp_spoly, poly_add_spoly, poly_sub_spoly]);
(* Theorem: Ring r ==> !x. x IN R ==> !a b c. eval (trinity a b c) x = x ** a + x ** b - x ** c *)
(* Proof:
eval (trinity a b c) x
= eval (... | PlainText | |
```
###########################################################################
# #
# Copyright 2019 INTERSEC SA #
# #
# Licensed u... | PlainText | |
```python
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright not... | Python | |
```scala
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | Scala | |
```haskell
module Main where
import Debug.Trace
data Section = Load1 | Load2 | Load3
main :: IO [()]
main = do
[n, vertexX, vertexY] <- map read . words <$> getLine
let numList = [1 .. n-1]
let combList =[(i,j) | i<-numList, j<-[i+1..n] ]
let shortestList =
foldl (\acc x -> ac... | Haskell | |
```yaml
uuid: e47839cc-9fdb-4c0a-8184-f97ef2c19fce
langcode: zh-hans
status: true
dependencies:
module:
- user
_core:
default_config_hash: TGTlmpYAtXxjtYMFA_A0vosE2c4R5MCQwLviIA5HUM0
id: user.user
targetEntityType: user
bundle: user
types:
- 'schema:Person'
fieldMappings:
name:
properties:
- 'sche... | YAML | |
```cpp
#include<bits/stdc++.h>
using namespace std;
string s, t;
string a[3001];
int f[3001][3001], id, mids, midt;
int main()
{
//freopen("test.inp","r",stdin);
//freopen("test.out","w",stdout);
cin>>s>>t;
s=' '+s;
t=' '+t;
for(int i=1;i<s.size();i++)
for(int j=1;j<t.size();j++)
... | C++ | |
```ruby
require 'spec_helper_acceptance'
tmpdir = default.tmpdir('tmp')
describe 'hocon_setting resource' do
after :all do
shell("rm #{tmpdir}/*.conf", acceptable_exit_codes: [0, 1, 2])
end
shared_examples 'has_content' do |path, pp, content|
before :all do
shell("rm #{path}", acceptable_exit_cod... | Ruby | |
```javascript
'use strict';
/**
* Module dependencies
*/
var acl = require('acl');
// Using the memory backend
acl = new acl(new acl.memoryBackend());
/**
* Invoke Tags Permissions
*/
exports.invokeRolesPolicies = function () {
acl.allow([{
roles: ['admin'],
allows: [{
resources: '/api/tags',
... | JS | |
```kotlin
plugins {
id("org.metaborg.spoofax.gradle.langspec")
id("de.set.ecj") // Use ECJ to speed up compilation of Stratego's generated Java files.
`maven-publish`
}
spoofax {
createPublication = true
}
ecj {
toolVersion = "3.20.0"
}
``` | Kotlin | |
```c
*/
#ifndef _RLCMode_H_
#define _RLCMode_H_
#include "asn_application.h"
/* Including external dependencies */
#include "NativeEnumerated.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum RLCMode {
RLCMode_rlc_am = 0,
RLCMode_rlc_um_bidirectional = 1,
RLCMode_rlc_um_unidirectional_u... | C | |
```cpp
// LAST EDIT:
//-----------------------------------------------------------------------------
// name: Mixed Integer Rounding Cut Generator
// authors: Joao Goncalves (jog7@lehigh.edu)
// Laszlo Ladanyi (ladanyi@us.ibm.com)
// date: August 11, 2004
//-------------------------------------------------... | C++ | |
```javascript
var CANNON = require('cannon');
require('./src/components/math');
require('./src/components/body/dynamic-body');
require('./src/components/body/static-body');
require('./src/components/constraint');
require('./src/system');
module.exports = {
registerAll: function () {
console.warn('registerAll() ... | JS | |
```
position: absolute;
top: 0;
left: 0;
}
#stars {
width: 1px;
height: 1px;
background: transparent;
``` | PlainText | |
```cpp
#include <bits/stdc++.h>
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(... | C++ | |
```python
#!/usr/bin/env python3
'''
Copyright (c) 2018 Modul 9/HiFiBerry
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy... | Python | |
```javascript
import React from "react";
import ToggleFeedPostHook from "../../customHooks/toggleFeedPostHook";
import CommentPostHook from "../../customHooks/commentPostHook";
import PostModal from "../PostModal/PostModal";
import useModal from "react-hooks-use-modal";
import "./AdminPostCard.css";
const AdminPostCar... | JS | |
```python
from django.conf.urls import url, include
from django.conf.urls.static import static
from .import views
urlpatterns = [
url(r'^register/', views.register_customer, name='registercustomer'),
]
``` | Python | |
```cpp
template<typename Impl, typename... Ins>
struct scratch_helper<true, Impl, Ins...>
{
// Init
template<int... IIs>
static void help_init_impl(const cv::GMetaArgs &metas,
const cv::GArgs &in_args,
gapi::fluid::Buffer &scratch_buf,
... | C++ | |
```csharp
[Key]
public int Id { get; set; }
[Column("name")]
[StringLength(100)]
[Required]
public string Name { get; set; }
[Column("slug")]
[StringLength(50)]
[Required]
public string Slug { get; set; }
[Column("create_at")]
[R... | C# | |
```
import sequtils, strutils, algorithm, math, future, sets, tables, hashes
let read = iterator : string {.closure.} = (while true : (for s in stdin.readLine.split : yield s))
proc solve() =
var
a,b,k = read().parseInt
var sum = a + b
echo max(0, a - k)," ",max(0, b + min(0, a - k))
s... | PlainText | |
```javascript
var assert = require('assert')
var fromArray = require('../fromArray')
var fromFunction = require('../fromFunction')
var toArray = require('../toArray')
var slice = require('../slice')
var mirror = require('../mirror')
var map = require('../map')
describe('fromFunction', function () {
it('should create ... | JS | |
```ruby
a = gets.to_i
b = gets.to_i
if a > b
puts 'GREATER'
elsif a < b
puts 'LESS'
else
puts 'EQUAL'
end
``` | Ruby | |
```php
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database driver. e.g.: mysqli.
| Currently supported:
| cubrid, ibase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] Y... | PHP | |
```cpp
const long long external_edge_pos = internal_edge_pos + _process_shift;
edge_op(src_id, dst_id, local_edge_pos, external_edge_pos, vector_index);
}
if(position_in_virtual_warp == 0)
vertex_postprocess_op(src_id, frontier_pos, connections_count);
}
}
////////////////... | C++ | |
```dockerfile
ADD ./docker/nginx/nginx.conf /etc/nginx/nginx.conf
ADD ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf
# Make Directory - Workspace
RUN mkdir -p /var/www/html
# ADD and set Group
RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel
# Set Group to Workspace
RUN... | Dockerfile | |
```go
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | Go | |
```python
from abc import ABC, abstractmethod
import time
from pathlib import Path
class Module(ABC):
def __init__(self, threaded=False, update_interval: float = 0.5,
should_save: bool = False, name: str = "module", **kwargs):
self.threaded = threaded
self.update_interval = update... | Python | |
```cpp
case PhysicalType::INT16:
return MergeUpdateLoop<int16_t>;
case PhysicalType::INT32:
return MergeUpdateLoop<int32_t>;
case PhysicalType::INT64:
return MergeUpdateLoop<int64_t>;
case PhysicalType::UINT8:
return MergeUpdateLoop<uint8_t>;
``` | C++ | |
```javascript
999,
"number");
a[i++] = new TestObject(
"dt.setInteger( MyOtherFunction )",
"dt.PUB_INT",
"dt.getInteger()",
"typeof dt.getInteger()",
999,
"number");
for ( i = 0; i < a.length; i++ ) {
new TestCase(
a[i].description +"; "+ a[i].javaFieldName,
a[i].jsValue,
a[i].javaFieldVal... | JS | |
```python
self.check_state_exist(observation)
# action selection
if np.random.uniform() < self.epsilon:
# choose best action
state_action = self.q_table.loc[observation, :]
# some actions may have the same value, randomly choose on in these actions
action ... | Python | |
```c
#include <stdio.h>
int main(void)
{
int a,b;
scanf("%d%d",&a,&b);
if(a>=b+2)printf("%d\n",2*a-1);
else if(a+2<=b) printf("%d\n",2*b-1);
else if(a+1==b || b+1==a) printf("%d\n",a+b);
else printf("%d\n",2*a);
return 0;
}
``` | C | |
```typescript
import { query } from 'faunadb';
import { NextApiRequest, NextApiResponse } from 'next';
import { getSession } from 'next-auth/client';
import { fauna } from '../../services/fauna';
import { stripe } from '../../services/stripe';
type User = {
ref: {
id: string;
};
data: { stripe_customer_id: s... | TS | |
```ruby
require './config/environment'
class ClientsController < ApplicationController
#bring the index website of the object
get "/clients" do
@photographers = Photographer.all
@sessions = Session.all
@clients = Client.all
@success_message = session[:success_message]
sessio... | Ruby | |
```scala
package com.getbootstrap.savage.server
import akka.actor.Actor
import akka.actor.ActorLogging
trait ActorWithLogging extends Actor with ActorLogging
``` | Scala | |
```php
* @see "/static/php/get_selectedcolor.php"
* @since 01_01
* @author Stefano Zenaro (https://github.com/mario33881)
* @license MIT
* @todo Per migliorare la leggibilita' e manutenibilità del codice sarebbe opportuno
* richiamare get_colors() di get_selectedcolor.php, non usare $color de... | PHP | |
```kotlin
package top.bilibililike.mvp.utils
import android.content.Intent
import android.os.Bundle
import android.os.Parcelable
import java.io.Serializable
import java.lang.Exception
object IntentUtils{
fun fillIntentArguments(intent: Intent, params: Array<out Pair<String, Any?>>) {
params.forEach {
... | Kotlin | |
```python
n, m, x = map(int, input().split())
C = []
A = []
ans = float("inf")
for _ in range(n):
tmp = list(map(int, input().split()))
C.append(tmp[0])
A.append(tmp[1:])
for i in range(2**n):
now = [0] * m
ns = 0
for j in range(n):
if i&(2**j):
ns += C[j]
for ... | Python | |
```python
callback = OptimizerCallback(metric_key="loss", use_fast_zero_grad=True)
loss1 = criterion(model(inp), target)
loss1_value = loss1.detach().item()
runner = DummyRunner(loss1, optimizer)
callback.on_stage_start(runner)
callback.on_epoch_start(runner)
callback.on_batch_end(runner)
... | Python | |
```java
import java.util.*;
class Main {
public static void main(String[] args) {
new Solver().run();
}
}
class Solver {
public void run() {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] a = new int[N];
for (int i= 0; i < N; i++) {
a... | Java | |
```python
n = int(input())
list = [int(x) for x in input().split(" ")]
result = 'DENIED'
for i in range(len(list)):
print(list[i],list[i]%2,list[i]%3,list[i]%5)
if list[i]%2 != 0:continue
if list[i]%3!=0 and list[i]%5!=0:
break
else:
result = 'APPROVED'
print(result)
``` | Python | |
```java
/**
* Copyright © Microsoft Open Technologies, Inc.
*
* All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
... | Java | |
```cpp
{
Orientacja = MacObrot;
}
void Prostopadloscian::get_global_wspolrzedne (Wektor3D wspolrzedne[])
{
Wektor3D tmp = Orientacja * PozycjaSrodka;
Wektor3D X (A,0,0);
Wektor3D Y (0,B,0);
Wektor3D Z (0,0,C);
Wektor3D OrX = Orientacja * X;
Wektor3D OrY = Orientacja * Y;
Wektor3D OrZ ... | C++ | |
```php
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBun... | PHP | |
```yaml
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
# Required to run your project under the correct environment.
language: php
# Versions of PHP you want your project run with.
php:
- 5.6
- 7.0
- hhvm
- nightly
# Commands to be run before your environment runs.
before_script:
... | YAML | |
```kotlin
package com.github.kornilova203.flameviewer
interface FlameIndicator {
fun checkCanceled(): Unit
}
``` | Kotlin | |
```ruby
# frozen_string_literal: true
require 'dry/system/constants'
require 'dry/system/plugins/dependency_graph/strategies'
module Dry
module System
module Plugins
# @api public
module DependencyGraph
# @api private
def self.extended(system)
super
system.use(:n... | Ruby | |
```julia
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)
function main()
n,l=parseMap(split(readline()))
apple=[l+i-1 for i in 1:n]
MIN=100000
for i in apple
if abs(i)<abs(MIN)
MIN=i
end
end
println(sum(apple)-MIN)
end
main()
``` | Julia | |
```java
/*
* Copyright 2012 Esri.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | Java | |
```java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if (a < b) {
System.out.println("a < b");
} else if (a == b) {
System.out.println("a == b");
} else {
System.out.println... | Java | |
```yaml
ullam, culpa odio.
social:
- icon: ti-facebook
link: "#"
- icon: ti-twitter-alt
link: "#"
- icon: ti-linkedin
link: "#"
- icon: ti-dribbble
link: "#"
- name: Mo. Kha. Alamgir
image_webp: images/team/team-4.webp
image: images/team/team-4.jpg
designation: ... | YAML | |
```
/* Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable la... | PlainText | |
```cpp
#include<bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
int main(void){
int n;
cin>>n;
vector<int> v(n);
rep(i, n){
cin>>v[i];
}
int ans = 0;
rep(i, n){
if((i+1)%2==1 && v[i]%2 == 1) ans++;
}
cout<<ans<<end... | C++ | |
```cpp
/*=============================================================================
Copyright (c) 2011-2019 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.... | C++ | |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>Lab5_AndresCruz</name>
<source-roots>
... | XML | |
```python
import heapq
n,m=map(int,input().split())
ab=[]
for i in range(m+1):
ab.append([])
for i in range(n):
a,b=map(int,input().split())
ab[a].append(-b)
h = []
s=0
for i in range(1,m+1):
for v in ab[i]:
heapq.heappush(h,v)
if len(h)!=0:
s-=heapq.heappop(h)
print(s)
``` | Python | |
```php
use Illuminate\Database\Eloquent\Model;
class documentdetail extends Model
{
use HasFactory;
}
``` | PHP | |
```python
N = int(input())
L = list(map(int, input().split()))
l =sorted(L,reverse = True)
t = 0
for i in range(N-2):
for k in range(i+1,N-1):
for m in range(k+1, N):
if l[i] < l[k] + l[m]:
t += 1
else:
break
else:
continue
break
print(t)
``` | Python | |
```go
package main
import (
"fmt"
"github.com/spf13/cobra"
)
func init() {
app.AddCommand(versionCmd)
}
const version = "1.0.0"
var (
app = &cobra.Command{
Use: "secretstore",
Short: "Manage secrets and protect sensitive data",
Long: `Secretstore is a secrets management engine that allows you
to quickly... | Go | |
```python
axis_1 = '0154' * 2 # 2 -> 3
axis_2 = '0253' * 2 # 4 -> 1
axis_3 = '3124' * 2 # 0 -> 5
right = [axis_3, axis_2[::2], axis_1, axis_1[::-1], axis_2, axis_3[::-1], ]
a = list(map(int, input().split()))
n = int(input())
for _ in range(n):
top, front = map(a.index, map(int, input().split()))
x = '%d%d'... | Python | |
```python
n = int(input())
p = list(map(int, input().split()))
m = 200001
ans = 0
for i in range(n):
if p[i] <= m:
m = p[i]
ans += 1
print(ans)
``` | Python | |
```cpp
#include "server/config_validation/cluster_manager.h"
#include "envoy/config/bootstrap/v3alpha/bootstrap.pb.h"
#include "envoy/config/core/v3alpha/config_source.pb.h"
#include "common/common/utility.h"
namespace Envoy {
namespace Upstream {
ClusterManagerPtr ValidationClusterManagerFactory::clusterManagerFro... | C++ | |
```rust
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LI... | Rust | |
```ruby
ary = gets.chomp.split(' ').map(&:to_i)
ary_1 = ary.slice(0,2)
ary_2 = ary.slice(2,2)
multiples = []
ary_1.each do |i|
ary_2.each do |j|
multiples << i * j
end
end
p multiples.max
``` | Ruby | |
```python
import time
from collections import Counter
import logging
import numpy as np
import os
import typing
import warnings
from string import punctuation
from typing import Any, Dict, List, Optional, Text
from rasa.nlu import utils
from rasa.nlu.config import RasaNLUModelConfig
from rasa.nlu.featurizers import F... | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.