text stringlengths 59 71.4k |
|---|
module cameraReader_sim
(
input clk,
input reset_n,
output refclk,
input pclk,
input [7:0] data,
input vsync,
input hsync,
output [15:0] data_out,
output wire wrreq,
output wire wrclk
);
reg wrclk1 = 0;
always@(negedge clk)
wrclk1 <= ~wrclk1;
reg [19:0] pixel_counter;
reg [9:0] wait_counter_hs;
reg... |
// DESCRIPTION: Verilator: Verilog Test module
//
// Copyright 2009 by Wilson Snyder. This program is free software; you can
// redistribute it and/or modify it under the terms of either the GNU
// Lesser General Public License Version 3 or the Perl Artistic License
// Version 2.0.
`ifdef VCS
`define NO_SHORTREAL
`en... |
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y, large = 2000000000, small = -2000000000; string s1, s2; cin >> n; for (int i = 0; i < n; i++) { cin >> s1 >> x >> s2; if ((s1 == > && s2 == Y ) || (s1 == <= && s2 == N )) { if (x >= small) { s... |
#include <bits/stdc++.h> using namespace std; int n, v, t, p, cnt1, cnt2, x; vector<pair<int, int>> k, c; vector<int> ans; void add(bool sm) { v--; if (sm) { x += k[cnt1].first; ans.push_back(k[cnt1++].second); } else { x += c[cnt2].first; ans.push_back(c[cnt2++].second); ... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; vector<string> v; vector<string> res; for (int i = 0; i < n; i++) { string s; cin >> s; v.push_back(s); } bool flag = 0; stri... |
// ==================================================================
// >>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<
// ------------------------------------------------------------------
// Copyright (c) 2006-2011 by Lattice Semiconductor Corporation
// ALL RIGHTS RESERVED
// --------... |
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2016.4 (win64) Build Wed Dec 14 22:35:39 MST 2016
// Date : Sun Jun 04 00:43:50 2017
// Host : GILAMONSTER running 64-bit major release (... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2012 by Iztok Jeras.
// SPDX-License-Identifier: CC0-1.0
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
// counters
int cnt;
int cnt_bit ;
int cnt_byte;
... |
//////////////////////////////////////////////////////////////////////////////////
//
// This file is part of the N64 RGB/YPbPr DAC project.
//
// Copyright (C) 2015-2021 by Peter Bartmann <>
//
// N64 RGB/YPbPr DAC is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public ... |
`include "defines.v"
`include "HRnode.v"
`timescale 1ns/1ps
/*module HRnode
#(parameter addr = 4'b0010)
(
input `control_w port0_i,
input `control_w port1_i,
input `control_w port0_local_i,
input `control_w port1_local_i,
output portl0_ack,
out... |
`timescale 1 ns/1 ps
module divider (
rfd, rdy, divide_by_zero, nd, clk, dividend, quotient, divisor, fractional
)/* synthesis syn_black_box syn_noprune=1 */;
output reg rfd;
output reg rdy;
output reg divide_by_zero;
input nd;
input clk;
input [3 : 0] dividend;
output reg [3 : 0] quotient;
input [3... |
#include <bits/stdc++.h> using namespace std; const int N = 3e2 + 5; int n; long long hx, hy; long long ux, uy; struct line { long long x1, y1; long long x2, y2; line(long long _x1, long long _y1, long long _x2, long long _y2) { x1 = _x1; y1 = _y1; x2 = _x2; y2 = _y2; ... |
#include <bits/stdc++.h> using namespace std; template <class A> void read(vector<A>& v); template <class A, size_t S> void read(array<A, S>& a); template <class T> void read(T& x) { cin >> x; } void read(double& d) { string t; read(t); d = stod(t); } void read(long double& d) { ... |
#include <bits/stdc++.h> using namespace std; template <class T> bool isPrime(T x) { if (x <= 1) return false; T i; for (i = 2; i * i <= x; i++) if (x % i == 0) return false; return true; } template <class T> class Prime { public: vector<T> z; Prime() { z.resize(1e5 + ... |
// megafunction wizard: %LPM_MULT%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsquare
// ============================================================
// File Name: MULT.v
// Megafunction Name(s):
// altsquare
//
// Simulation Library Files(s):
// altera_mf
// ====================================... |
#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... |
/*
* Copyright (c) 2000 Peter monta ()
*
* 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)
* an... |
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 7; vector<pair<int, int> > s; int co[maxn], deg[maxn]; int main() { int n; cin >> n; for (int i = 0; i < n - 1; i++) { pair<int, int> q; cin >> q.first >> q.second; s.push_back(q); } for (int i = 1; i <=... |
//-----------------------------------------------------------------
// RISC-V Core
// V1.0.1
// Ultra-Embedded.com
// Copyright 2014-2019
//
//
//
// License: BSD
//-----------------------... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); int n; cin >> n; map<double, int> mp2; map<string, double> mp1; vector<string> S; while (n--) { string x; cin >> x; S.push_back(x); int plus = 0, ... |
// ZX-Evo Base Configuration (c) NedoPC 2014
//
// CMOS emulator: cmos is needed for zxevo.rom to function correctly
/*
This file is part of ZX-Evo Base Configuration firmware.
ZX-Evo Base Configuration firmware is free software:
you can redistribute it and/or modify it under the terms of
the GNU Gene... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 48; long long s, x, xCopy, sCopy, pos[MAXN][2], result; int n, bitS, bitX; int main() { cin >> s >> x; pos[0][0] = 1; pos[0][1] = 0; n = 0; xCopy = x; sCopy = s; while (x || s) { n++; bitS = s % 2; bit... |
#include <bits/stdc++.h> using namespace std; const int SZ = 200005; vector<int> graph[SZ]; int par[SZ]; int dst[SZ]; int tot; void dfs(int x, int crt) { par[x] = crt; tot++; for (int nxt : graph[x]) { if (par[nxt]) continue; dfs(nxt, crt); } } int main(void) { ios_base... |
module ALU(a_in, b_in, op_in, c_out, overflow);
input [5:0] a_in, b_in;
input [1:0] op_in;
output [11:0] c_out;
output overflow;
wire [5:0] adder_out, suber_out;
wire [11:0] muler_out, diver_out;
/*
* Adder
*/
Adder6 adder(
.a_in(a_in),
.b_in(b_in),
.s_out(adder_out)
);
/*
... |
#include <bits/stdc++.h> using namespace std; int n, m, mon_cost; vector<tuple<int, int, int>> friends; const long long oo = 1LL << 60; void solve() { cin >> n >> m >> mon_cost; friends.resize(n); for (int i = 0; i < n; ++i) { int x, k, num; cin >> x >> k >> num; int mask = 0; ... |
/*
* 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; long long a[300005], ans; int n, num[300005], cnt[2] = {1}, sum[300005]; int change(long long x) { int ans = 0; while (x) { ans += (x % 2); x /= 2; } return ans; } int main() { cin >> n; for (int i = 1; i <= n; i++) { sc... |
#include <bits/stdc++.h> using namespace std; int main() { long long int t; cin >> t; while (t--) { long long int x, k; cin >> x >> k; long long int temp = k % 4; long long int i = 1; while (temp--) { if (x % 2) { x += ((k / 4) * 4) + i; } else { ... |
#include <bits/stdc++.h> unsigned *G[222222], Ga[222222], Gi[222222]; void add(unsigned i, unsigned j) { if (Ga[i] == Gi[i]) { if (!Ga[i]) G[i] = (unsigned *)calloc(Ga[i] = 1, sizeof(unsigned)); else G[i] = (unsigned *)realloc(G[i], (Ga[i] <<= 1) * sizeof(unsigned)); } G[i][G... |
module main;
parameter CACHE_RAM = 128;
parameter ADR_WIDTH = 7;
reg [31:0] buff[0:CACHE_RAM], data_o, data_i;
reg [ADR_WIDTH-1:0] addr;
reg clk, rst, wr;
(* ivl_synthesis_on *)
always @(posedge clk)
if (wr) buff[addr] <= data_i;
(* ivl_synthesis_on *)
always @(posedge clk or ... |
/*
* 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() { int r = 0, c = 0; string str; cin >> str; if (str.length() > 2) { for (int i = 0; i < str.length() - 2; i++) { if (str[i] == Q ) { for (int j = i + 1; j < str.length() - 1; j++) { if (str[j] == A ) r++; ... |
#include <bits/stdc++.h> using namespace std; int main() { long long t; cin >> t; long long k = 0, m = 1; while (t > 0) { if (t % 10 == 4) { k = k + m; } else { k = k + 2 * m; } m = m * 2; t = t / 10; } cout << k; } |
#include <bits/stdc++.h> using namespace std; bool isPrime(long long n) { if (n <= 1) return false; for (int i = 2; i <= sqrt(n); i++) if (n % i == 0) return false; return true; } long long mod = 1000000007; int main() { long long i, j, k = 0, n, m = 0, a[300001], b[300001], t = 0, ans =... |
#include <bits/stdc++.h> template <int MOD> struct Integral { int v_ = 0; template <typename T> Integral(T v) : v_(norm(v)) { static_assert(std::is_integral<T>::value, input should be an integral. ); } Integral() = default; ~Integral() = default; template <typename T> T norm(T... |
#include <bits/stdc++.h> using namespace std; const int MAX_N = 1e5 + 23; const int INF = 1e9 + 23; const int MOD = 1e9 + 7; struct Mada { long long x, h, p; }; Mada mada[MAX_N]; stack<Mada> Dane; int dp[MAX_N]; int n; bool cmp(Mada a, Mada b) { return a.x < b.x; } int main() { ios_base:... |
#include <bits/stdc++.h> using namespace std; int n, k; long long a[200010]; long long b[200010]; int s[200010]; long long ans; bool check(long long val) { memset(s, 0, sizeof(s)); int num = k; for (int i = 1; i <= n; i++) { if (!b[i]) { continue; } long long sum = a[... |
#include <bits/stdc++.h> using namespace std; const int N = 2005, M = N * N; bool vis[N]; char s[N][2][25]; int n, m, dfn[N], low[N], tt, S[N], col[N]; int hd[N], V[M], nx[M], fs[N], q[N], id[N], in[N]; vector<int> e[N]; void add(int u, int v) { nx[++tt] = hd[u]; V[hd[u] = tt] = v; } void ta... |
#include <bits/stdc++.h> using namespace std; int main(){ //freopen( input.inp , r ,stdin); //freopen( output.out , w ,stdout); ios::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while (t--){ int a,b; cin >> a >> b; int ans = 0; ... |
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2016.3 (win64) Build Mon Oct 10 19:07:27 MDT 2016
// Date : Wed Oct 18 11:23:39 2017
// Host : vldmr-PC running 64-bit Service Pack 1 ... |
#include <bits/stdc++.h> using namespace std; const int N = 2019, mod = 998244353; int n, m, ans, f[N << 1][N], g[N << 1][N]; int qpow(int a, int b) { int ret = 1; while (b) { if (b & 1) ret = 1ll * ret * a % mod; a = 1ll * a * a % mod, b >>= 1; } return ret; } int main() { s... |
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7, N = 1e5 + 5; int n, c[N], x; long long dp[N][2]; vector<int> g[N]; void dfs(int v) { dp[v][0] = 1LL; for (int u : g[v]) { dfs(u); (dp[u][0] += dp[u][1]) %= mod; dp[v][1] = (dp[v][1] * dp[u][0] + dp[v][0] * dp[u]... |
#include <bits/stdc++.h> using namespace std; const int N = 5e5 + 10; const int mod7 = 1e9 + 7; const int mod = 1e9 + 7; void read(int &a) { a = 0; int d = 1; char ch; while (ch = getchar(), ch > 9 || ch < 0 ) if (ch == - ) d = -1; a = ch ^ 48; while (ch = getchar(), ch >= 0... |
#include <bits/stdc++.h> using namespace std; long long int a[100005], sg[100005 * 4], lz[100005 * 4], res, x, y, z, n; void lazy(long long int low, long long int high, long long int pos) { sg[pos] += lz[pos]; if (low != high) lz[pos * 2 + 1] += lz[pos], lz[pos * 2 + 2] += lz[pos]; lz[pos] = 0; } ... |
#include <bits/stdc++.h> using namespace std; signed main() { string s; cin >> s; long long n = s.size(); long long an = 0; for (long long i = 0; i < n; i++) { long long r = INT_MAX; for (long long j = i; j <= min((long long)(i + 9), n - 1); j++) { for (long long k = 1; k <= ... |
#include <bits/stdc++.h> using namespace std; const int mod = 998244353; const int maxn = 2e5 + 10; const int inf = 0x3f3f3f3f; const double eps = 1e-6; mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count()); int n; int l[maxn], r[maxn], t[maxn]; struct node { int id; boo... |
#include <bits/stdc++.h> using namespace std; const long long N = 2e3 + 10, big = 1e18, mod = 1e9 + 7; vector<long long> a[N], now, ans; long long n, x, y, m, maxi; bool vis[N], mp[N][N]; void dfs(long long i) { vis[i] = 1, now.push_back(i); for (int j = 0; j < a[i].size(); j++) if (!vis[a[i][... |
`timescale 1 ns / 1 ps
module counter_group
(
input selector,
input incrementor,
input reverse,
input clr,
input wire [15:0]cntr_def_0,
input wire [15:0]cntr_def_1,
input wire [15:0]cntr_def_2,
input wire [15:0]cntr_def_3,
input wire [15:0]cntr_def_4,
input wire [15:0]cntr_def_5,
input wire [15:0... |
#include <bits/stdc++.h> using namespace std; const int N = 3e5; int n, fa[N], p[N], cnt, mk, la[N], size[N]; int getfa(int x) { if (fa[x] == x) return x; return fa[x] = getfa(fa[x]); } void merge(int x, int y) { int fx = getfa(x), fy = getfa(y); if (fx == fy) return; fa[fx] = fy; si... |
#include <bits/stdc++.h> using namespace std; void calc() { long long n, m; cin >> n >> m; vector<pair<long long, long long> > v; vector<long long> a; for (long long i = 0; i < m; i++) { long long ai, bi; cin >> ai >> bi; v.push_back(make_pair(ai, bi)); a.push_back(ai); ... |
#include <bits/stdc++.h> using namespace std; int i, dp[100000], t; string s; int main() { cin >> s; for (i = 0; i < s.size(); i++) if (s[i] >= a ) { dp[i] = dp[i - 1]; t++; } else dp[i] = min(dp[i - 1] + 1, t); cout << dp[s.size() - 1] << endl; return 0; }... |
/*
* 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 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() { double x, y; while (cin >> x >> y) { double l; l = sqrt(x * x + y * y); if (l == (int)l) { cout << black << endl; continue; } int z = (int)l; if (z != l) z++; if (x * y >= 0) { if (... |
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2016.3 (win64) Build Mon Oct 10 19:07:27 MDT 2016
// Date : Thu Sep 14 10:22:21 2017
// Host : PC4719 running 64-bit Service Pack 1 (... |
#include <bits/stdc++.h> int main() { long long n, k; scanf( %lld%lld , &n, &k); if (k < 2) { printf( %lld , n); return 0; } long long s = 1; while (s - 1 < n) s *= 2; printf( %lld , s - 1); } |
// soc_system_mm_interconnect_0_avalon_st_adapter_001.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 16.1 196
`timescale 1 ps / 1 ps
module soc_system_mm_interconnect_0_avalon_st_adapter_001 #(
parame... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2009 by Wilson Snyder.
module t (/*AUTOARG*/);
// IEEE: integer_atom_type
byte d_byte;
shortint d_shortint;
int d_int;
longint d_longint;
integer d_integer;
ti... |
//-------------------------------------------------------------------------
// COPYRIGHT (C) 2016 Univ. of Nebraska - Lincoln
//
// 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 ve... |
#include <bits/stdc++.h> using namespace std; void sublime() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); } int main() { sublime(); long long n, i, j; cin >> n; long long arr[n]; for (i = 0; i < n; i++) cin >> arr[i]; if (n <= 2) { cout << 0 << n ; ... |
/*
* 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() { int hy, ay, dy; int hm, am, dm; int h, a, d; cin >> hy >> ay >> dy; cin >> hm >> am >> dm; cin >> h >> a >> d; int res = 1e9; for (int atk = dm + 1; atk <= 200; ++atk) { for (int def = dy; def <= 100; ++def) { i... |
`timescale 1ns / 1ps
`default_nettype none
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 00:11:22 10/17/2012
// Design Name:
// Module Name: pal_generator
// Project Name:
// Target Devices:
// Tool versions:
// Description... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2003 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
reg [39:0] con1,con2, con3;
reg [31:0] w32;
reg [31:0] v32 [2];
// surefire lint_of... |
module main;
initial begin
if (1.0a != 1.0e-18) begin
$display("FAILED -- 1.0a = %0.19g", 1.0a);
$finish;
end
if (1.0f != 1.0e-15) begin
$display("FAILED -- 1.0f = %0.19g", 1.0f);
$finish;
end
if (1.0p != 1.0e-12) begin
$display("FAILED -- 1.0p = %0.19g", 1.0p);
$finish;
... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2011 by Wilson Snyder.
`begin_keywords "VAMS-2.3"
module t (/*autoarg*/
// Inputs
clk, in
);
input clk;
input [15:0] in;
wreal aout;
integer cyc=0;
real ... |
/*
Distributed under the MIT license.
Copyright (c) 2015 Dave McCoy ()
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, mo... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e5 + 3; struct tree { int l, r, minn, lazy; long long sum; } tre[MAXN << 2]; int n, m; long long a[MAXN]; void build(int i, int l, int r) { tre[i].l = l, tre[i].r = r; tre[i].lazy = 0; if (l == r) { tre[i].minn = a[l... |
/* SPDX-License-Identifier: MIT */
/* (c) Copyright 2018 David M. Koltak, all rights reserved. */
//
// UART ser/des framer for use in SPDR module. Hard coded for 115200,1,1.
//
module spdr_uart_framer
(
input clk_50,
input rst,
output reg tx_busy,
input tx_vld,
input [7:0] tx_data,
output r... |
`include "defines.v"
`include "HRbridge.v"
`timescale 1ns/1ps
/*module connectRouter_nobuffer
#(parameter addr = 4'b0000) //No. 0 connect router, port 0
(
input `control_w port_l0_i,
output `control_w port_l0_o,
input `control_w FIFO_l0_i,
output `control_w FIFO_l0_o,
input bfull_... |
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using vii = vector<int>; using pii = pair<int, int>; template <typename T = vii> using vec = vector<T>; const ll INF = 1e18, MOD = 1e9 + 7; const int MAX = 1e6; int main() { cin.tie(NULL); ios_base::s... |
module automatic_events3();
reg [1:0] Source;
initial begin
Source[0] = 1'b0;
forever begin
#20 Source[0] = 1'b1;
#20 Source[0] = 1'b0;
end
end
initial begin
Source[1] = 1'b0;
#15;
forever begin
#10 Source[1] = 1'bx;
#10 Source[1] = 1'b1;
#10 Source[1] = 1'bx;
#10 Source[1] = 1'b0... |
#include <bits/stdc++.h> using namespace std; long long n, k; void search(int cur) { int tot, c[10]; int ok; if (cur == n) tot++; else for (int i = 0; i < n; i++) { ok = 1; c[cur] = i; } for (int j = 0; j < cur; j++) { if (c[cur] == c[j] || cur - c[cur] ... |
#include <bits/stdc++.h> using namespace std; static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3f; static const double EPS = 1e-10; static const double PI = acos(-1.0); inline int read() { int X = 0; bool flag = 1; char ch = getchar(); while (ch < 0 || ch > ... |
//
// This is a file generated by ARM Cortex-M3 wizard.
// Please do not edit this file!
// Generated time: 12/25/2015 17:05:53
// Version: Primace 7.3.1
// Wizard name: ARM Cortex-M3 1.0a
//
// ============================================================
// File Name: armcm3_v1.v
// IP core : armcm3
// Device name: M7... |
#include <bits/stdc++.h> using namespace std; long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); } const int NCARDS = 8; const int NVALS = 5; const int NSTATE = 495; vector<vector<int> > states; map<vector<int>, int> mp; void genstates(vector<int> &v, int at, int rem) { if ... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k, a[5000] = {0}; cin >> n >> k; for (int i = 1; i <= k; i++) { int la = 0; cin >> la; if (la == 1) { int p, q; cin >> p >> q; a[p] = 1; a[q] = 1; } else if (la == 2) { int p... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2019 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", ... |
// ----------------------------------------------------------------------
// Copyright (c) 2015, The Regents of the University of California All
// rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:... |
/**
* 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... |
// Accellera Standard V2.3 Open Verification Library (OVL).
// Accellera Copyright (c) 2005-2008. All rights reserved.
`include "std_ovl_defines.h"
`module ovl_even_parity (clock, reset, enable, test_expr, fire);
parameter severity_level = `OVL_SEVERITY_DEFAULT;
parameter width = 1;
parameter property... |
Require Export Coq.Program.Tactics.
Require Export Coq.Setoids.Setoid.
Require Export Coq.Classes.Morphisms.
Require Export Coq.Arith.Arith_base.
Require Export Coq.Relations.Relations.
Require Export Coq.Lists.List.
Import EqNotations.
Import ListNotations.
(***
*** Ordered Types = Types with a PreOrder
***)
(* ... |
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; char s[21][100100]; int n, m, ans = 1e9, all, inv, a[100100], bit[1100000], w[1100000], f[1100000]; int power(int a, int k) { int ret = 1; while (k) { if (k & 1) ret = 1ll * ret * a % mod; a = 1ll * a * a % mod; ... |
`timescale 1ps/1ps
`default_nettype none
(* DowngradeIPIdentifiedWarnings="yes" *)
module axi_protocol_converter_v2_1_8_b2s_aw_channel #
(
///////////////////////////////////////////////////////////////////////////////
// Parameter Definitions
//////////////////////////////////////////////////////////////////////////... |
#include <bits/stdc++.h> using namespace std; template <class T> void chmin(T &t, const T &f) { if (t > f) t = f; } template <class T> void chmax(T &t, const T &f) { if (t < f) t = f; } int main() { long long int n, a, c1, c2, m, len = 0, prev = 0, ans = 0, rlow, rlen, rind, ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 10; bool a[maxn]; int main() { int n, k; while (~scanf( %d%d , &n, &k)) { int p = (n - k) / 2 + 1; int t = n / p; while (t--) { for (int i = 0; i < p; i++) { if (i == p - 1) printf( 0 ); ... |
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2017.2
// Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved.
//
// ==============================================================
`timescale 1ns/1ps
... |
/**
* 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; inline long long read() { long long x = 0, f = 1; char c = getchar(); for (; !isdigit(c); c = getchar()) if (c == - ) f = -1; for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48); return x * f; } inline void write(long long... |
/**
* 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; class ST { long long int tree[10000000]; long long int lazy[10000000]; public: void build(int a, int b, int node) { tree[node] = 0; lazy[node] = 0; if (a == b) return; int mid = (a + b + 4000000) / 2 - 2000000; build(a, mi... |
#include <bits/stdc++.h> using namespace std; namespace whatever { int readu() { char ch = getchar(); while (!isdigit(ch)) ch = getchar(); int value = ch - 0 ; ch = getchar(); while (isdigit(ch)) { value = value * 10 + ch - 0 ; ch = getchar(); } return value; } void w... |
#include <bits/stdc++.h> using namespace std; const long long INF = 1 << 28; const long long LINF = 1ll << 61; inline long long getnum() { register long long r = 0; register bool ng = 0; register char c; c = getchar(); while (c != - && (c < 0 || c > 9 )) c = getchar(); if (c == - )... |
#include <bits/stdc++.h> using namespace std; const double pi = 3.141592653589793238463; int a[100009], p[200009]; int main() { cin.tie(0); cin.sync_with_stdio(0); int h; cin >> h; for (int i = (0); i <= (h); i++) cin >> a[i]; bool perfect = true; for (int i = 0; i < (h); i++) ... |
#include <bits/stdc++.h> using namespace std; long long int x2, y2, x3, y3; bool check(long long int x, long long int y) { long long int xx = x3 * x3 + y3 * y3, tx = x2 + x, ty = y2 + y; if (xx == 0) return x == x2 && y == y2; long long int ret1 = tx * x3 + ty * y3, ret2 = tx * y3 - ty * x3; if (r... |
#include <bits/stdc++.h> const int N = 60; int G[N][N], n, m, top; std::vector<int> v[500000]; inline void out() { puts( ); for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { printf( %d , G[i][j]); } puts( ); } puts( ); return; } inline int id(int... |
/**
* 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 = 100000, M = 100000; long long int MOD = 1000000007; void solve() { long long int n; cin >> n; long long int a[n + 1], b[n + 1]; for (long long int i = 0; i < n; i++) cin >> a[i]; for (long long int i = 0; i < n; i++) { b[i... |
#include <bits/stdc++.h> using namespace std; const int INF = numeric_limits<int>::max(); const long long LLINF = numeric_limits<long long>::max(); const unsigned long long ULLINF = numeric_limits<unsigned long long>::max(); const double PI = acos(-1.0); vector<int> ans; void solve(int n, int p, int maxN)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.