text stringlengths 59 71.4k |
|---|
/*
* 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 mas[200004]; long long mas2[200004]; struct ver { long long abs; int number; long long maxabs; int masnumber; ver *l; ver *r; }; void build(ver *v, int l, int r, long long *m) { if (l == r) { v->abs = m[l]; v->nu... |
/**
* 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 n, T, low, mid, high, a[200005], t[200005]; vector<int> ans; scanf( %d%d , &n, &T); for (int i = 1; i <= n; i++) { scanf( %d%d , &a[i], &t[i]); } low = 0; high = n; while (low <= high) { mid = (low + high) / 2... |
#include <bits/stdc++.h> const int dx[] = {1, -1, 0, 0}; const int dy[] = {0, 0, -1, 1}; using namespace std; long long tests; long long n, m, b, MOD, dp[5256][5256], a[5256], ans; void solve() { scanf( %I64d%I64d%I64d%I64d , &n, &m, &b, &MOD); for (int i = 1; i <= n; i += 1) { scanf( %I64d , ... |
// DESCRIPTION: Verilator: Test of gated clock detection
//
// The code as shown generates a result by a delayed assignment from PC. The
// creation of the result is from a clock gated from the clock that sets
// PC. Howevever since they are essentially the same clock, the result should
// be delayed by one cycle.
//
/... |
#include <bits/stdc++.h> using namespace std; int n, m; char c[109][109]; bool ja = 1; bool useless = 1; int main() { cin >> n >> m; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> c[i][j]; if (c[i][j] == . ) { if (i % 2 == 0 && j % 2 == 0 || i % 2... |
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1; s2 = hello ; int i = 0, j = 0, count = 0; int l = s1.length(); while (l) { if (s1[i] != s2[j]) i++; if (s1[i] == s2[j]) { i++; j++; count++; } l--; } ... |
//*****************************************************************************
// (c) Copyright 2008-2010 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
// ... |
#include <bits/stdc++.h> using namespace std; const int maxN = 1000 * 1000 + 5; bool mark[4][maxN]; int n, m, comp; inline void dfs(int x, int y) { if (mark[x][y]) return; mark[x][y] = true; if (x == 0 && y == 1) mark[3][1] = true; if (x == 0 && y == m) mark[1][1] = true; if (x == 1 && y =... |
`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... |
#include <bits/stdc++.h> using namespace std; long long n, A, B; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; while (n--) { cin >> A >> B; cout << A * (long long)log10(B + 1) << endl; } } |
#include <bits/stdc++.h> using namespace std; int dp[5000][5000]; int main() { char a[5000], b[5000]; int ti, td, tr, te; scanf( %d %d %d %d , &ti, &td, &tr, &te); scanf( %s %s , a, b); int n = strlen(a); int m = strlen(b); dp[0][0] = 0; for (int i = 1; i <= n; i++) dp[i][0] = dp[i... |
// part of NeoGS flash programmer project (c) 2014 lvd^NedoPC
//
// reset controller
module reset
(
input wire clk_fpga,
input wire clk_24mhz,
input wire init,
output reg init_in_progress,
output wire zxbus_rst_n,
output reg rom_rst_n,
output reg z80_rst_n,
output reg z80_busrq_n,... |
#include <bits/stdc++.h> using namespace std; long long int M = 1e9 + 7; int sum_digit(int x) { int sum = 0; while (x > 0) { sum += x % 10; x /= 10; } return sum; } int reverse_num(int n) { int tmp = n, ans = 0, r; while (tmp > 0) { r = tmp % 10; ans = ans * 10 ... |
#include <bits/stdc++.h> using namespace std; int dp[2][1 << 16]; char art[7][1008]; int n; int c[5]; vector<int> modi[1008]; void upd(int &x, int y) { x = min(x, y); } int main() { scanf( %d , &n); for (int i = 1; i <= 4; i++) scanf( %d , &c[i]); for (int i = 1; i <= 4; i++) scanf( %s , art... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 23:51:39 11/23/2009
// Design Name:
// Module Name: tetris_tb
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
... |
//
// Copyright 2011 Ettus Research LLC
//
// 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 version 3 of the License, or
// (at your option) any later version.
//
// This program is dis... |
#include <bits/stdc++.h> using namespace std; inline long long read() { long long x = 0, f = 1; char ch = getchar(); while (ch < 0 || ch > 9 ) { if (ch == - ) f = -1; ch = getchar(); } while (ch >= 0 && ch <= 9 ) { x = x * 10 + ch - 0 ; ch = getchar(); } r... |
//----------------------------------------------------------------------------
// Copyright (C) 2009 , Olivier Girard
//
// 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 re... |
/*****************************************************************************
* *
* Module: Altera_UP_PS2_Data_In *
* Description: *
... |
/*
* 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[4]; vector<int> order, to; bool cmp(int x, int y) { return a[x] < a[y]; } int main() { cin >> a[1] >> a[2] >> a[3]; order = {1, 2, 3}; sort(order.begin(), order.end(), cmp); to = order; cout << First << endl; for (;;) { ... |
module KeyboardDecoder(
output reg [511:0] key_down,
output wire [8:0] last_change,
output reg key_valid,
inout wire PS2_DATA,
inout wire PS2_CLK,
input wire rst,
input wire clk
);
parameter [1:0] INIT = 2'b00;
parameter [1:0] WAIT_FOR_SIGNAL = 2'b01;
parameter [1:0] GET_SIGNAL_DOWN = 2'b1... |
#include <bits/stdc++.h> using namespace std; inline int read() { int x = 0, f = 1; char ch = getchar(); for (; !isdigit(ch); ch = getchar()) { if (ch == - ) f = -1; } for (; isdigit(ch); ch = getchar()) { x = x * 10 + ch - 48; } return x * f; } const int mxN = 1e5; co... |
#include <bits/stdc++.h> using namespace std; char s[100100]; char s1[111]; char s2[110]; int main() { scanf( %s%s%s , s, s1, s2); int flag1, flag2; int n = strlen(s); int n1 = strlen(s1); int n2 = strlen(s2); flag1 = flag2 = 0; int i, j; for (i = 0; i < n; i++) { for (j ... |
/**
* 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 law... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; char a[n + 1][n + 1]; int ans[n + 1][n + 1]; for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) { cin >> a[i][j]; ans[i][j] = 0; } for (int i = 1; i <= n; 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... |
#include <bits/stdc++.h> using namespace std; struct data { int x, y; } t[800001]; int n, m, k, x, y, sum, cnt, tot, h[400001], st[400001], f[400001], fa[400001], p[400001], idfn[400001], dfn[400001], low[400001], son[400001], dep[400001], sz[400001], tr[1600001]; char ch[11]; vector<int> v[... |
#include <bits/stdc++.h> using namespace std; long long call(long long n) { if (n == 1) return 1; else return n + call(n / 2); } void fun() { long long n; cin >> n; cout << call(n); } int main() { long long t; cin >> t; while (t--) { fun(); cout << end... |
#include <iostream> #include <iomanip> #include<iterator> // for iterators #include<vector> // for vectors #include <utility> #include <algorithm> #include <set> #include <map> #include <stack> #include <unordered_map> using namespace std; int main() { int t, n, temp; scanf( %d , &t); ... |
#include <bits/stdc++.h> using namespace std; using LL = long long; constexpr int N = 1e5 + 5; void solve() { int a, b; cin >> a >> b; if (a * 2 <= b) cout << a << << a * 2 << n ; else cout << -1 -1 n ; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ... |
#include <bits/stdc++.h> using namespace std; const int N = 3000 * 100 + 5; vector<pair<int, int> > adj[N]; pair<int, int> edge[N]; short d[N]; bool mark[N], edg[N], c[N]; int bad[N], par[N], m, n; void findd(int a, int e, int b) { while (a != b) { edg[e] = 1; if (a == edge[e].first) ... |
/**
* 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 N = 1e5 + 5; const long long INF = 1e10; const int MOD = 1e9 + 7; const double EPS = 1e-7; const double PI = acos(-1.0); pair<long long, long long> p[N]; long long n, k, a[N]; int main() { ios::sync_with_stdio(false); cin.tie(NULL),... |
/**
* 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... |
/**
* 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... |
//---------------------------------------------------------------------------------------
// Generated by WISHBONE Builder. Do not edit this file.
//
// For defines see wb_devices.defines
//
// Generated Tue May 30 10:23:57 2017
//
// Wishbone masters:
// cpu
//
// Wishbone slaves:
// rs2
// baseadr 0x00000000 ... |
/* SRAM Test Bench
*
* Case I:
* Tests the FIFO by writing the FF byte and reading them back.
*
* Created By David Tran
* Version 0.1.0.0
* Last Modified:05-01-2014
*/
`include "sram_fifo.v"
module sram_fifo_tb (
readMode, // Specifies if we want to read to the FIFO
writeMode, // Specifies if we wa... |
/*+--------------------------------------------------------------------------
Copyright (c) 2015, Microsoft Corporation
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 ... |
// Accellera Standard V2.3 Open Verification Library (OVL).
// Accellera Copyright (c) 2005-2008. All rights reserved.
//------------------------------------------------------------------------------
// SHARED CODE
//------------------------------------------------------------------------------
`ifdef OVL_SHARED_CODE... |
/*
Copyright (c) 2014-2018 Alex Forencich
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, merge, publish, distri... |
#include <bits/stdc++.h> using namespace std; int query(vector<int>& v) { cout << ? ; for (auto& x : v) { cout << x << ; } cout << endl; int a; cin >> a; return a; } void solve(int n) { int x = 1; vector<int> v(n, 1); for (int i = n; i >= 2; i--) { for (i... |
#include <bits/stdc++.h> using namespace std; const int Maxn = 2e5; const long long inf = 1e15; inline int read() { char ch = getchar(); int f = 1, x = 0; while (ch > 9 || ch < 0 ) { if (ch == - ) f = -1; ch = getchar(); } while (ch >= 0 && ch <= 9 ) { x = x * 10 + c... |
//
// Generated by Bluespec Compiler, version 2019.05.beta2 (build a88bf40db, 2019-05-24)
//
//
//
//
// Ports:
// Name I/O size props
// RDY_mem_server_request_put O 1 reg
// mem_server_response_get O 256 reg
// RDY_mem_server_response_get O 1 reg
// CLK ... |
/*
* Milkymist SoC
* Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq
*
* 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, version 3 of the License.
*
* This program is distributed in ... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; bool b[4][n][n]; for (int i = 0; i < 4; i++) { for (int j = 0; j < n; j++) { char c[n + 1]; scanf( %s , &c); for (int k = 0; k < n; k++) b[i][j][k] = c[k] == 1 ? 1 : 0; } } int s... |
#include <bits/stdc++.h> using namespace std; int firstt(int* a, int n) { long long l, r, s; for (int i = 0; i <= n - 1; ++i) { l = 0; r = 10000000000; while (l < r - 1) { s = (-l + r) / 2 + l; if (s * n >= a[i] - i) { r = s; } else { l = s; ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 10; char s[maxn]; struct Node { int sum, pmx, lmx, mi, ma, d; Node() {} Node(int a, int b, int c, int d, int e, int f) { sum = a; pmx = b; lmx = c; mi = d; ma = e; d = f; } }; Node segT[m... |
module axi2spi_bridge(
//CLK
input FCLK_CLK0,
//RST
input RST_N,
//AXI INTERFACE
input [31:0] AXI_araddr, // read address address (data)
input [2:0] AXI_arprot, // ???
output [0:0] AXI_arready, // read address ready
input [0:0] AXI_arvalid, ... |
/*
* NAME
* ----
*
* led_ctl - bussed LED control
*
*
* DESCRIPTION
* -----------
*
* 8-bit bar led module suitable for use with a "bus"
* consisting of address, data and control lines.
*
* To write, data must be assigned to the data bus ('data'),
* write must be enabled (write_n=0), read must not be
* ... |
#include <bits/stdc++.h> using namespace std; long long int ma = -1, mi = 1000000000000000; inline long long int gcd(long long int a, long long int b) { return b ? gcd(b, a % b) : a; } inline long long int lcm(long long int a, long long int b, long long int MOD) { return a / gcd(a, b) * b % MOD; } ... |
module top;
reg pass;
real rvar;
wire [3:0] var;
assign var = rvar;
initial begin
pass = 1'b1;
rvar <= 1'b0;
#1 rvar = 1'b1;
#1 rvar = 2'b10;
#1 rvar = 2'b11;
#1 if (pass) $display("PASSED");
end
real_to_bit u1(rvar);
real_to_real u2(rvar);
real_to_real u3[1:0](rvar);
real... |
// megafunction wizard: %FIFO%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: scfifo
// ============================================================
// File Name: small_fifo_test.v
// Megafunction Name(s):
// scfifo
//
// Simulation Library Files(s):
// altera_mf
// ===========================... |
#include <bits/stdc++.h> using namespace std; int main() { int n; long long k; cin >> n >> k; int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i]; sort(arr, arr + n); int prev = arr[0], best = -1, num, left = 0; for (int i = 0; i < n; i++) { k -= (0LL + i - left) * (arr[i] - ... |
/**
* 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 N = 100005, LOG = 25; long long n, f[N][LOG + 5], cnt = 0, head[N], dep[N]; long long size[N]; struct CLANNAD { long long to, nxt; } a[N << 1]; inline void add(long long u, long long v) { a[++cnt].to = v; a[cnt].nxt = head[u]; h... |
#include <bits/stdc++.h> using namespace std; const int N = 200010; const int MOD = 1000000007; const int INF = 0x3fffffff; typedef struct Node { long long v; int p; Node(long long v_, int p_) { v = v_; p = p_; } bool operator<(const Node& other) const { return v < other.... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2011(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// a... |
/**
* 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 a[111111], b[111111]; vector<int> v; long long t[555][555]; int main() { int n; cin >> n; int r, c; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cin >> t[i][j]; if (t[i][j] == 0) { r = i; ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; int main() { int a, b, c, d; scanf( %d%d%d%d , &a, &b, &c, &d); if (a == 0 && b == 0 && c == 0 && d == 0) { printf( 1 n ); } else if (a == 0 && d == 0 && c != 0) { printf( 0 n ); } else if (a != d) { prin... |
#include <bits/stdc++.h> using namespace std; template <class T> ostream &operator<<(ostream &os, const vector<T> &v) { for (T i : v) os << i << , ; return os; } template <class T> ostream &operator<<(ostream &os, const set<T> &v) { for (T i : v) os << i << ; return os; } template <... |
#include <bits/stdc++.h> using namespace std; const long long MOD = 1e9 + 7; long long fpow(long long b, long long x) { long long res = 1; while (x) { if (x & 1) res = (res * b) % MOD; b = (b * b) % MOD; x >>= 1; } return res; } long long c(long long k, long long r) { if ... |
#include <bits/stdc++.h> using namespace std; template <typename T> T gcd(T a, T b) { return (b ? __gcd(a, b) : a); } template <typename T> T lcm(T a, T b) { return (a * (b / gcd(a, b))); } template <class T> ostream &operator<<(ostream &os, vector<T> V) { os << [ ; for (auto v : V) ... |
// (c) Copyright 1995-2015 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 grant ... |
#include <bits/stdc++.h> using namespace std; const int N = 500043; const int K = 750; int a[N]; int sum[K][K]; int main() { int q; scanf( %d , &q); for (int i = 0; i < q; i++) { int t, x, y; scanf( %d %d %d , &t, &x, &y); if (t == 1) { a[x] += y; for (int i = 1... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; string second; cin >> second; int mi = 0, gr = 0, le = 0, ans = 0; for (int i = 0; i < second.length(); i++) { if (second[i] == - ) mi++; ... |
// --------------------------------------------------------------------
// ng_INP Input Buffer Port
// --------------------------------------------------------------------
module ng_INP(
input CLK2, // AGC Main Clock
input NSA, // Stanby, negative logic
input [ 4:0] Keypad, // Keypad 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; const int MAXL = 2000005; string pat[100005]; int beg[2000005]; int bel[2000005]; int id[4200000]; int L = 0; inline void modify(int a, int b, int val, int v = 1, int l = 1, int r = MAXL) { if (b < l || a > r) return; if (a <= l && r <= b) { id... |
/*
Anthony De Caria - June 15, 2014
This module is the structure that interfaces NIOS-II with two AD7264 A-D-Cs.
This is done using SPI protocol.
It takes key signals from NIOS (CPOL, CPHA, ss), and transforms them into SCLK and SS signals.
In addition, it also creates the structures needed to collect and transmit d... |
#include <bits/stdc++.h> using namespace std; #pragma comment(linker, /STACK:36777216 ) #pragma GCC optimize( O2 ) template <class T> inline void RD(T &); template <class T> inline void OT(const T &); inline int RD() { int x; RD(x); return x; } template <class T> inline T &_RD(T &x) {... |
#include <bits/stdc++.h> using namespace std; const int maxn = 300050; int a[maxn << 2]; int ll[maxn], rr[maxn], x[maxn], N, M; void getdown(int cur) { a[cur << 1] = a[cur]; a[(cur << 1) | 1] = a[cur]; a[cur] = 0; } void Insert(int cur, int L, int R, int l, int r, int u) { int mid = (L + R... |
`timescale 1 ps / 1 ps
module system_wrapper
(AC_BCLK,
AC_MCLK,
AC_MUTE_N,
AC_PBLRC,
AC_RECLRC,
AC_SDATA_I,
AC_SDATA_O,
BLUE_O,
DDR_addr,
DDR_ba,
DDR_cas_n,
DDR_ck_n,
DDR_ck_p,
DDR_cke,
DDR_cs_n,
DDR_dm,
DDR_dq,
DDR_dqs_n,
DDR_dqs_p,
DDR_od... |
/*
* Milkymist VJ SoC
* Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq
*
* 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, version 3 of the License.
*
* This program is distributed ... |
#include <bits/stdc++.h> using namespace std; struct Point { int x, y; Point(int x0, int y0) : x(x0), y(y0) {} Point() : x(0), y(0) {} }; int t; int dx[] = {-1, 0, 1, 0, -1, -1, 1, 1}; int dy[] = {0, -1, 0, 1, -1, 1, -1, 1}; int n, m; long long maxx; int d[100005][4]; int a[100005], h[10... |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: bw_clk_gclk_center_3inv.v
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
//
// The above named program is free software; you can redistrib... |
#include <bits/stdc++.h> using namespace std; const double pi = acos(-1.0); template <typename T, typename U> inline void amin(T &x, U y) { if (y < x) x = y; } template <typename T, typename U> inline void amax(T &x, U y) { if (x < y) x = y; } using namespace std; int main() { int 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 la... |
#include <bits/stdc++.h> using namespace std; using Vi = vector<int>; using i64 = long long; using ll = long long; using Pi = pair<int, int>; mt19937 mrand(time(0)); int rnd(int x) { return mrand() % x; } const int N = 500005; const int M = 40005; int main() { ios::sync_with_stdio(false); ci... |
#include <bits/stdc++.h> using namespace std; template <typename X> void MA(X& a, X b) { a = max(a, b); } template <typename X> void MI(X& a, X b) { a = min(a, b); } template <typename X> void clr(X& x, int a) { memset(x, a, sizeof(x)); }; int cond = 0, multi = 0, gcj = 0; int N; c... |
//-----------------------------------------------------------------------------
// The FPGA is responsible for interfacing between the A/D, the coil drivers,
// and the ARM. In the low-frequency modes it passes the data straight
// through, so that the ARM gets raw A/D samples over the SSP. In the high-
// frequency mo... |
/*
* 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 a[25][25], n, m, dp[1 << 22]; char s[25][222]; int main() { scanf( %d%d , &n, &m); for (int i = 0; i < n; ++i) scanf( %s , s[i]); for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) scanf( %d , &a[i][j]); memset(dp, 63, sizeof(dp)), dp[... |
module test_round_robin();
reg[39:0] queue_vfull;
reg icache_ack;
reg[39:0] vacant;
reg clk, rst;
wire fetch_valid;
wire[5:0] pc_select;
round_robin rr(fetch_valid, pc_select, queue_vfull, icache_ack, vacant, clk, rst);
initial begin
clk = 0;
while (1) begin
#2;
clk = ~clk;
end
end
in... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2011(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// a... |
//Legal Notice: (C)2010 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... |
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const int maxn = 110000; int n, m, h; int head[maxn], num; struct road { int to, next; } edge[maxn * 2]; void add(int u, int v) { edge[num].to = v; edge[num].next = head[u]; head[u] = num++; } int dfn[maxn], lo... |
/* This file is part of JT12.
JT12 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 version 3 of the License, or
(at your option) any later version.
JT12 program is distribute... |
module testcache();
reg clk;
reg re, we, we2, we3;
reg [31:0] address, writedata;
wire [31:0] readdatacache,readmissdata;
wire hit, miss, dirty;
// test
memory_system DUT(clk, re, we, we2, we3, address, writedata, readdatacache, hit, miss, dirty);
// generate clock to sequence ... |
#include <bits/stdc++.h> using namespace std; int f[300010][2]; int dp[300010][2]; int Flag[300010]; int main() { int n, k; scanf( %d%d , &n, &k); for (int i = 1; i <= n; i++) scanf( %d , &f[i][0]); for (int i = 1; i <= n; i++) scanf( %d , &f[i][1]); if (k == 1) { for (int ii = 0; ii... |
#include <bits/stdc++.h> using namespace std; long long powmod(long long a, long long b) { long long res = 1; a %= 1000000007; for (; b; b >>= 1) { if (b & 1) res = res * a % 1000000007; a = a * a % 1000000007; } return res; } template <typename T> inline bool chkmin(T &a, cons... |
//Legal Notice: (C)2017 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... |
#include <bits/stdc++.h> using namespace std; long long a, b, n; short ans = 0; int main() { cin >> a >> b; while (b > 0) { if (b == 1) { ans = 0; break; } if (b % a != 0) { ans = 1; break; } ++n; b = b / a; } if (ans == 0) { ... |
#include <bits/stdc++.h> using namespace std; bool isPrime(int n) { if (n <= 1) return false; for (int i = 2; i < n; i++) if (n % i == 0) return false; return true; } int main() { long long int t; cin >> t; while (t--) { long long int n; cin >> n; vector<long long... |
`default_nettype none
module romtest1 (
input wire sysclk,
input wire clk,
input wire rst,
output wire d0,
output wire d1,
output wire d2,
output wire d3,
output wire d4,
output wire d5,
output wire d6,
output wire d7
);
wire [7:0] dout;
reg [3:0] addr;
//-- Instanciar la ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.