text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; long long x; int n, d; struct cmp { bool operator()(pair<int, int> x, pair<int, int> y) { return x.first > y.first; } }; set<pair<int, int>, cmp> que; set<pair<int, int>, cmp>::iterator it; vector<int> num; int a[100005], c[100005]; bool b[... |
// (C) 1992-2012 Altera Corporation. All rights reserved.
// Your use of Altera Corporation's design tools, logic functions and other
// software and tools, and its AMPP partner logic functions, and any output
// files any of the foregoing (including device programming or simulati... |
/*
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f; const int N = 1e6 + 5; int n, m, k; bool vis[N]; int main() { ios::sync_with_stdio(false); cin >> n >> m >> k; int h; for (int i = 1; i <= m; i++) { cin >> h; vis[h] = 1; } bool fg = 0; int bone... |
module wb_stream_writer_ctrl
#(parameter WB_AW = 32,
parameter WB_DW = 32,
parameter FIFO_AW = 0,
parameter MAX_BURST_LEN = 0)
(//Stream data output
input wb_clk_i,
input wb_rst_i,
output [WB_AW-1:0] wbm_adr_o,
output [WB_DW-1:0] wbm_dat_o,
output [WB_DW/8-1:0] wbm_sel_o,
... |
#include <bits/stdc++.h> using namespace std; char aa[100100]; int a[550][550]; int main() { int x, y, x0, y0; cin >> x >> y >> x0 >> y0; for (int i = 1; i <= x; i++) for (int j = 1; j <= y; j++) a[i][i] = 0; a[x0][y0] = 1; int sum = 1; scanf( %s , aa); int len = strlen(aa); ... |
#include <bits/stdc++.h> using namespace std; int n; int a, b, h, w, ans = INT_MAX, f[int(1e5 + 10)]; bool cmp(int x, int y) { return x > y; } void get_answ(long long x, long long y, int d, bool flag) { if (x >= a && y >= b) { ans = min(ans, d - 1); return; } if (d == n + 1) return; ... |
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 50, M = 1e4 + 2, OO = 0x3f3f3f3f; int n, m, A[N], rem; int main() { scanf( %d %d , &n, &m); rem = m; for (int i = 0; i < n; ++i) { scanf( %d , A + i); int ans = 0; if (A[i] >= rem) ans = 1, A[i] -= rem, rem = m; ... |
//Legal Notice: (C)2013 Altera Corporation. All rights reserved. Your
//use of Altera Corporation's design tools, logic functions and other
//software and tools, and its AMPP partner logic functions, and any
//output files any of the foregoing (including device programming or
//simulation files), and any associated do... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2014 - 2017 (c) Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of... |
#include <bits/stdc++.h> using namespace std; long long int s[4]; int main() { long long int x, y; while (scanf( %I64d%I64d , &x, &y) == 2) { s[0] = y; s[1] = y; s[2] = y; sort(s, s + 3); long long int cnt = 0; while (1) { if (s[0] == x && s[1] == x && s[2] == x... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; for (int i = 0; i < t; i++) { int s, tens, sum = 0; cin >> s; for (; s > 0;) { tens = s / 10; s -= tens * 10; s += tens; sum += tens * 10; if (s >= 10 && s <= 18) { ... |
module Data_Memory
(
clk_i,
rst_i,
addr_i,
data_i,
enable_i,
write_i,
ack_o,
data_o
);
// Interface
input clk_i;
input rst_i;
input [31:0] addr_i;
input [255:0] data_i;
input enable_i;
input write_i;
output ack_o;
output [255:0] data_o;
// Memory
reg [255:0] memory [0:... |
#include <bits/stdc++.h> using namespace std; void maximize(int &a, int b) { a = max(a, b); } int absolut(int x) { if (x < 0) return -x; return x; } const int tope = 1 << 19; const int first = 1 << 18; struct elem { int ls, lH, lh, lb; int rs, rH, rh, rb; int sol; }; elem v[tope]; ... |
//////////////////////////////////////////////////////////////////////
//// ////
//// OR1200's reg2mem aligner ////
//// ////
//// This file is part of the OpenR... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2005 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
module t (/*AUTOARG*/
// Inputs
clk
);
parameter PAR = 3;
input clk;
m3 m3_inst (.clk(c... |
#include <bits/stdc++.h> using namespace std; inline int read() { int x = 0, ch; while (!isdigit(ch = getchar())) ; while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar(); return x; } template <typename T> inline T gcd(T a, T b) { return !b ? a : gcd(b, a % b); } ... |
//--------------------------------------------------------------------------------
// filter.vhd
//
// Copyright (C) 2006 Michael Poppitz
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Founda... |
#include <bits/stdc++.h> int main() { static long long N, K, b[1000000] = {}, n, i, t; for (scanf( %lld%lld , &N, &K), n = N, i = 900000; n; n /= 2, i++) n & 1 && (b[i]++, K--); if (K < 0) puts( No ); else { for (i = 999999; K >= b[i]; i--) if (b[i]) while (b[i]) b[... |
#include <bits/stdc++.h> using namespace std; const int oo = 3e5 + 7; unordered_map<int, vector<int>> values[2]; int t, n, q, a[oo], p[oo]; vector<int> ans; int psum(int l, int r) { return p[r] - (l ? p[l - 1] : 0); } int first(vector<int>& list, int val) { int l = 0, r = list.size(); while (l < r... |
// nios_dut_mm_interconnect_0_avalon_st_adapter_004.v
// This file was auto-generated from altera_avalon_st_adapter_hw.tcl. If you edit it your changes
// will probably be lost.
//
// Generated using ACDS version 15.1 185
`timescale 1 ps / 1 ps
module nios_dut_mm_interconnect_0_avalon_st_adapter_004 #(
parameter ... |
`include "bch_defs.vh"
module xilinx_noinv #(
parameter T = 3,
parameter DATA_BITS = 5
) (
input clk_in,
input in,
output reg out = 0
);
`include "bch_params.vh"
localparam P = bch_params(DATA_BITS, T);
localparam IN = `BCH_SYNDROMES_SZ(P) + 2;
localparam OUT = `BCH_SIGMA_SZ(P) + `BCH_ERR_SZ(P) + 2;
wire s... |
#include <bits/stdc++.h> using namespace std; const long long M = 100100 * 5; const long long N = 50005; long long m, b, k; map<long long, long long> fre; int v1[M], mmax; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> m; for (int i = 0; i < m; i++) { ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 7; const int inf = 1e9; const long long inff = 1e18; const long long mod = 1e9 + 7; int a[maxn]; vector<int> v[maxn]; vector<int> tmp; int32_t main() { ios::sync_with_stdio(0); cin.tie(0); int _1 = 0, _2 = 0; int n; ... |
// Copyright 2020-2022 F4PGA 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... |
#include <bits/stdc++.h> using namespace std; int k; bool primes[200000][100]; int okay[5000000]; int okayN; int nLeft[1000]; bool isPrime[1000]; bool used[5000000]; vector<int> ans; bool compare(int a, int b) { if (nLeft[a] > nLeft[b]) return 1; if (nLeft[a] < nLeft[b]) return 0; return... |
// Implements GPIO pins from the PS/EMIO
// Works with 7010 (24 pins) or 7020 (48 pins) and
// either single-ended or differential IO
module parallella_gpio_emio
(/*AUTOARG*/
// Outputs
PS_GPIO_I,
// Inouts
GPIO_P, GPIO_N,
// Inputs
PS_GPIO_O, PS_GPIO_T
);
parameter NUM_GPIO_PAIRS = 24; ... |
/*
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int main() { int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; cout << max(abs(y2 - y1), abs(x2 - x1)); return 0; } |
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf( %d , &n); int a[1010]; for (int i = 0; i < n; i++) { scanf( %d , &a[i]); } sort(a, a + n); if (a[0] == 1) { printf( -1 n ); } else { printf( 1 n ); } } |
#include <bits/stdc++.h> using namespace std; const long long mod = 1000000007; long long rowNum[] = {-1, 0, 0, 1}; long long colNum[] = {0, -1, 1, 0}; int main() { int n, d, h; cin >> n >> d >> h; if (d > n - 1 || d < h || d > 2 * h || (n > 2 && h < 2 && d == h)) { cout << -1 n ; ret... |
#include <bits/stdc++.h> using namespace std; const long long dp = 1e9 + 7; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ; int n, a; cin >> n >> a; vector<int> vec(n); int cnt = 0; for (int i = 0; i < n; i++) { cin >> vec[i]; if (vec... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
//------------------------------------------------------------------------------
// YF32 -- A small SOC implementation based on mlite (32-bit RISC CPU)
// @Taiwan
//------------------------------------------------------------------------------
//
// ... |
module taxicab_distance #(parameter N = 32)(
input [N-1:0] x1, y1, x2, y2,
output [N+1:0] dist
);
wire signed [N:0] dist_x12, dist_x21, dist_xabs, dist_y12, dist_y21, dist_yabs;
/*SUB_1 #(.N(N)) diff_x12 (.A(x1), .B(x2), .S(dist_x12[N-1:0]), .CO(dist_x12[N]));
SUB_1 #(.N(N)) diff_x21 (.A(x2), .B(x1), .S(dist_x21[N-... |
// ********************************************************************/
// Actel Corporation Proprietary and Confidential
// Copyright 2009 Actel Corporation. All rights reserved.
//
// ANY USE OR REDISTRIBUTION IN PART OR IN WHOLE MUST BE HANDLED IN
// ACCORDANCE WITH THE ACTEL LICENSE AGREEMENT AND MUST BE APPROV... |
#include <bits/stdc++.h> using namespace std; int n, m, q, a[501][501], x, y, s, ans; vector<int> v; int main() { ios::sync_with_stdio(false); cin >> n >> m >> q; for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) cin >> a[i][j]; for (int p = 1; p <= q; p++) { cin >> x >> y; ... |
#include <bits/stdc++.h> using namespace std; double dp[110][110][110] = {0}; double c[110][110] = {0}; int a[110], n, m; int main() { scanf( %d%d , &n, &m); for (int i = 1; i <= m; ++i) scanf( %d , &a[i]); for (int i = 0; i <= n + m; ++i) c[i][0] = 1; for (int i = 1; i <= n + m; ++i) fo... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*
* Copyright (c) 2000 Stephen Williams ()
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* ... |
#include <bits/stdc++.h> using namespace std; struct node { int l, r; } ar[300000]; bool compare(node a, node b) { if (a.r != b.r) return a.r < b.r; else return a.l < b.l; } vector<pair<int, int> > vectl, vectn, temp; int main() { int n, i, m, flag = 0; scanf( %d%d , &n, &m... |
/*
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; const long long int maxn = 1e5 + 6; const long long int MOD = 1e9 + 7; vector<int> prim(1000005, 1); int fact[maxn]; long long int binomialCoeff(long long int n, long long int k) { long long int res = 1; if (k > n - k) k = n - k; for (long long int i... |
module t;
/*fifo_s AUTO_TEMPLATE (
.ignored_signal (1'b1),
.out_signal (NC),
.out_bus (out_bus[]),
);
*/
fifo_s data_fifo (
//fifo_s data_fifo (
// Inputs
.clk (fifo_clk),
... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int main() { long long int n, m, t = 0, min, d = 0; cin >> n >> m; int a[n][m]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) cin >> a[i][j]; } vector<vector<int>> b(2, vector<int>(m, -1)); vector<vector<int>> c(n, vector<in... |
// megafunction wizard: %Shift register (RAM-based)%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altshift_taps
// ============================================================
// File Name: Line_Buffer.v
// Megafunction Name(s):
// altshift_taps
//
// Simulation Library Files(s):
// altera_mf... |
// clocker module for simulation
module clocker(
input wire clk1,
input wire clk2,
input wire clksel,
input wire divsel,
output wire clkout
);
/*
êàê áëÿòü òóò ïåðåêëþ÷èòü êëîêè?
ñíà÷àëà clksel ðåñèíõðèì ïî âûõîäíîìó êëîêó, êàê ïðîéä¸ò -
âûõîäíîé êëîê âûêëþ÷èëè
ïîòîì ïî íîâîìó âõîäíîìó êë... |
/*
* NAME
* ----
*
* bar_leds-test.v - test module for 'bar_leds.v'
*
* INTRODUCTION
* ------------
*
* TODO
*
* AUTHOR
* ------
*
* Jeremiah Mahler <>
*
*/
`include "bar_leds.v"
module test;
wire ce;
wire [8:1] data;
wire rw;
wire [8:1] leds;
bar_leds bar_leds1(ce, data, rw, leds);
// reg... |
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 100; string s; int f(int id) { string t; for (int j = id; j < s.size(); j++) { t.push_back(s[j]); } t.push_back( # ); for (int j = 0; j < id; j++) { t.push_back(s[j]); } int mx = 0; vector<int> z(t.s... |
#include <bits/stdc++.h> using namespace std; int main() { int i, count = 1, ans = 0; string input; cin >> input; for (i = 1; i < input.length(); i++) { if (input[i] != input[i - 1]) { ans += (count / 5) + (count % 5 > 0); count = 0; } count++; } ans += (cou... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// megafunction wizard: %RAM: 2-PORT%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: dpram_32_128x16.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// ========... |
`timescale 1ns/1ns
module foc_cmd
(input c,
input udp_cmd_dv,
input [31:0] udp_target_reg,
input [31:0] udp_damping_reg,
input udp_foc_active_reg,
input [31:0] temperature,
input [31:0] temperature_limit,
input ignore_temperature,
input overtemp_rst,
input [7:0] submsg_rxd,
input... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string s; cin >> s; int a[7]; for (int i = 0; i < 6; i++) { a[i] = s[i] - 0 ; } int ans = 3; for (int i = 0; i <= 9; i++) { for (int j = 0; j <=... |
#include <bits/stdc++.h> using namespace std; using ll = long long int; using ii = pair<ll, ll>; using vi = vector<int>; using vii = vector<ii>; using graph = vector<vii>; const int INF = 0x3f3f3f3f; const ll INFL = 0x3f3f3f3f3f3f3f3f; const int MAXN = 2123; const ll mod = 998244353; int seen[MAXN... |
#include <bits/stdc++.h> using namespace std; const int maxn = 6e3 + 5; const int mod = 1e9 + 7; const int inf = 0x3f3f3f3f; int main() { int t, n, k; char x; cin >> t; while (t--) { cin >> n >> k; for (int i = 0; i < n % k; i++) { cout << a ; } for (int i = 0;... |
#include <bits/stdc++.h> using namespace std; template <typename T> istream& operator>>(istream& is, vector<T>& a) { for (T& ai : a) is >> ai; return is; } template <typename T> ostream& operator<<(ostream& os, vector<T> const& a) { os << [ ; for (const T& ai : a) os << ai << ; retu... |
#include <bits/stdc++.h> using namespace std; int d[6][3] = {{1, 0, 0}, {-1, 0, 0}, {0, 1, 0}, {0, -1, 0}, {0, 0, 1}, {0, 0, -1}}; int main() { int k, n, m, sn, sm, ans = 0; cin >> k >> n >> m; string plate[k][n]; bool visited[k][n][m]; for (int i = 0; i < k; i++) for ... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int block[101]; int nuclea[101]; int inst[101][101]; int main() { ios_base::sync_with_stdio(0); int n, m, k; cin >> n >> m >> k; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> inst[j][i]; } } for (int... |
#include <bits/stdc++.h> using namespace std; int main() { int tc; cin >> tc; while (tc-- > 0) { int arr[7]; for (int i = 0; i < 7; i++) { cin >> arr[i]; } cout << arr[0] << << arr[1] << << arr[6] - arr[0] - arr[1] << endl; } } |
#include <bits/stdc++.h> const long long inf = 1ll << 60; const long long maxn = 30010; using namespace std; struct lsg { long long x, y; } a[maxn], b[maxn]; signed n, q, ffa[maxn], ffb[maxn], ban[maxn], x, y; long long f[maxn], w1[maxn], w2[maxn], w3[maxn]; bool pd(lsg a, lsg b) { return a.x < b.x;... |
/* Concrete parameterizations of tapped FIFO for testing.
*
* Copyright (c) 2016, Stephen Longfield, stephenlongfield.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either vers... |
#include <bits/stdc++.h> using namespace std; namespace myrand { mt19937 mt(chrono::system_clock::now().time_since_epoch() / chrono::microseconds(1)); long long Int(long long l, long long r) { return uniform_int_distribution<long long>(l, r)(mt); } } // namespace myrand using namespace m... |
#include <bits/stdc++.h> using namespace std; struct M { int t, x[4]; M(int s, int a, int b, int c, int d = 0) { t = s; x[0] = a; x[1] = b; x[2] = c; x[3] = d; } void p() { printf( %d , t); for (int i = 0; i < (int)(t); ++i) printf( %d , x[i]); printf... |
#include <bits/stdc++.h> using namespace std; long long gcd(int a, int b) { if (!b) return a; return gcd(b, a % b); } bool isprime(long long n) { if (n == 2) { return true; } if (n % 2 == 0) { return false; } for (long long i = 3; i <= sqrt(n); i += 2) { if (n % i =... |
#include <bits/stdc++.h> const int N = 100010; const int inf = 0x3f3f3f3f; using namespace std; int a[N], b[N], c[N], d[N]; int main() { int n, m, k; scanf( %d%d%d , &n, &m, &k); for (int i = 0; i < m; i++) scanf( %d%d%d , a + i, b + i, c + i); long long ret = 0; for (int i = 0; i < k; i++... |
module lsu
(/*AUTOARG*/
// Outputs
issue_ready,
vgpr_source1_rd_en, vgpr_source2_rd_en,
sgpr_source1_rd_en, sgpr_source2_rd_en,
mem_gm_or_lds, tracemon_gm_or_lds,
vgpr_dest_wr_en,
mem_rd_en, mem_wr_en,
sgpr_dest_wr_en,
exec_rd_wfid,
mem_tag_req,
sgpr_source1_addr,... |
#include <bits/stdc++.h> using namespace std; int n, ans, notOK; map<int, int> M; int main() { cin >> n; for (int i = 0, x; i < n; i++) cin >> x, M[x]++; for (map<int, int>::iterator it = M.begin(); it != M.end(); it++) { if (it->first) { if (it->second == 2) ans++; e... |
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long a, b, c, count = 0; scanf( %lld %lld , &a, &b); while (a--) { scanf( %lld , &c); if (c <= b) count++; else count += 2; } printf... |
/*
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; int main() { string s; int n, m; cin >> n >> m; cin >> s; for (int i = 0; i < m; i++) { int l, r; char c1, c2; scanf( %d %d %c %c , &l, &r, &c1, &c2); for (int j = l - 1; j < r; j++) { if (s[j] == c1) { s[j] ... |
#include <bits/stdc++.h> using namespace std; vector<int> v; int main() { v.push_back(0); for (int i = 0; i < int(30); i++) v.push_back(1 << i); while (1) { int hi, lo; int test; string s; cin >> s; if (s == mistake || s == end ) return 0; bool found = 0; f... |
// (c) Copyright 2012-2013 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
// laws.
//
// DISCLAIMER
// This disclaimer is not a license and does not g... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); inline long long int rand(long long int x, long long int y) { ++y; return (rng() % (y - x)) + x; } string to_string(char c) { string second(1, c); return second; } string to_s... |
// This is the Avalon slave for the motor controller
// Registers 0-5 store the direction and on/off switch for each motor
// Registers 8-13 store the respective duty cycle
// The output should be fed to GPIO pins in the SOPC configuration
`include "defines.v"
module slave_controller(input clk, input reset, input chi... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int ans; char s[100]; int main() { cin >> s; for (int i = 0; i < strlen(s); i++) if (s[i] == a || s[i] == e || s[i] == i || s[i] == o || s[i] == u || s[i] == 1 || s[i] == 3 || s[i] == 5 || s[i] == 7 || s[i] == 9 )... |
/*
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; int o, O, f, z, i, d; string t, s[6] = { lios , liala , etr , etra , initis , inites }; int V[ zz ]; int main() { while (cin >> t) { for (i = O = 0; i < 6; i++) if ((d = t.size() - s[i].size()) < 0 ? 0 : t.substr(d) == s[i]) { if (... |
// Basic Components; muxes, flip-flops, etc.
//
// Author: Ivan Castellanos
// email:
// VLSI Computer Architecture Research Group,
// Oklahoma Stata University
//Reduced Full Adder Cell (for CLA, 8 gates instead of 9)
module rfa (sum, g, p, a, b, cin);
output sum;
output g;
output p;
input a;
input... |
#include <bits/stdc++.h> using namespace std; long long int mod = 1000000007; void __print(long long int x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } void __print(unsigned long long x) { cerr << x; } void __print(float x) { cerr << x; } void __pr... |
#include <bits/stdc++.h> using namespace std; long long in() { int32_t x; scanf( %d , &x); return x; } inline long long lin() { long long x; scanf( %lld , &x); return x; } inline void read(long long *a, long long n) { for (long long i = 0; i < n; i++) a[i] = in(); } inline vo... |
// Copyright 2018 Google LLC
//
// 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 w... |
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(NULL); ios_base::sync_with_stdio(false); int N; vector<int> V; cin >> N; int X; for (int i = 0; i < N; i++) { cin >> X; V.push_back(X); } int ans = 100100, t = 0; for (int i = 1; i <= 100; i++) { ... |
//////////////////////////////////////////////////////////////////
// //
// Generic Library SRAM with single write enable //
// //
// This file is part of the Amber project ... |
// file: system_clk_wiz_1_0.v
//
// (c) Copyright 2008 - 2013 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
// laws.
//
// DISCLAIMER
// This disclaimer... |
// -------------------------------------------------------------
//
// File Name: hdl_prj\hdlsrc\controllerPeripheralHdlAdi\Latch_Index_Pulse.v
// Created: 2014-09-08 14:12:09
//
// Generated by MATLAB 8.2 and HDL Coder 3.3
//
// -------------------------------------------------------------
// --------------------... |
// ******************************************************************************* //
// ** General Information ** //
// ******************************************************************************* //
// ** Module : firdecim_m4_n12.v ... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; ; const long long maxn = 1e5 + 7; const long double pi = 3.14159265358979323846; struct pirog { long long r; long long h; long long i; }; long long V[4 * maxn]; pirog A[maxn]; vector<pirog> C; void update(long long v, long long tl, long long ... |
#include <bits/stdc++.h> int main() { int n; std::cin >> n; std::vector<int> a(n); std::vector<int> mn(n); for (int i = 0; i < n; ++i) { std::cin >> a[i]; } mn[n - 1] = a[n - 1]; for (int i = n - 2; i >= 0; --i) { if (a[i] < mn[i + 1]) { mn[i] = a[i]; } else {... |
/**
* Copyright 2020 The SkyWater PDK 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; long long int n, m; long long int power(long long int a, long long int b) { if (b == 0) return 1; long long int sr = power(a, b >> 1); long long int r = sr * sr; if (b & 1) r = a * r; return r; } void solve() { long long int z = power(2, 0)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.