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 la... |
#include <bits/stdc++.h> using namespace std; char a[11]; bool ok = true; bool check(char a[]) { for (int i = 0; i < 7; i++) if (a[i] == a[i + 1]) return false; return true; } int main() { for (int i = 1; i <= 8; i++) { scanf( %s , a); ok &= check(a); } if (ok) pu... |
#include <bits/stdc++.h> using namespace std; int main() { long int n, i, t; cin >> n; long int a[n]; for (i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); if (a[0] == 0) a[0] = a[1]; if (n >= 2) { if (a[n - 2] - a[0] < a[n - 1] - a[1]) t = a[n - 2] - a[0]; else ... |
#include <bits/stdc++.h> #pragma comment(linker, /STACK:268435456,268435456 ) using namespace std; int above[41][41], dp[41][41][41][41]; char s[42]; int main() { int n, m, q, s1, s2, s3, s4; scanf( %d %d %d , &n, &m, &q); for (int i = 1; i <= n; i++) { scanf( %s , s + 1); for (int j ... |
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf( %d , &n); char str[1000][1000]; int i; for (i = 0; i < n; i++) { scanf( %[^ n] , str[i]); } int cnt = 0; int j; for (i = 0; i < n; i++) { if (strcmp(str[i], -1 ) == 0) continue; cnt++; ... |
module sdcard_interface(
output sclk,
output mosi,
input miso,
input clk,
input rst,
input [9:0] sram_a,
input [15:0] sram_d_in,
output [15:0] sram_d_out,
input sram_cs,
input sram_oe,
input [1:0] sram_wstrb,
output sram_wait,
output [7:0] dma_data,
output [8:0] dma_addr,
o... |
module alt_vipitc131_common_generic_count
#( parameter WORD_LENGTH = 12,
parameter MAX_COUNT = 1280,
parameter RESET_VALUE = 0,
parameter TICKS_WORD_LENGTH = 1,
parameter TICKS_PER_COUNT = 1
)
(
input wire clk,
input wire reset_n,
input wire enable,
input wire enable_ticks,
... |
/**
* 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... |
///////////////////////////////////////////////////////////////////////////////
//
// Project: Aurora Module Generator version 2.8
//
// Date: $Date: 2007/09/28 12:50:35 $
// Tag: $Name: i+HEAD+134158 $
// File: $RCSfile: chbond_count_dec_gtp.ejava,v $
// Rev: $Revision: 1.2 ... |
#include <bits/stdc++.h> using namespace std; int main() { string s = ; for (int i = 1; i < 1000; i++) { s += to_string(i); } int n; cin >> n; cout << s[n - 1]; return 0; } |
#include <bits/stdc++.h> using namespace std; int main() { int n, i, j, k; string s; while (cin >> n >> s) { int sum = 0; int left = 0, right = 0, up = 0, down = 0; for (i = 0; i < n; i++) { if (s[i] == R ) { if (left == 1) { sum++; left = 0; ... |
#include <bits/stdc++.h> using namespace std; pair<long long, long long> dp[1100][20]; int bitcnt[1100]; long long p10[21]; string a; int n, k; pair<long long, long long> dfs(int bi, int pos, int flag, int leading) { if (pos == -1) return make_pair(0, 1); if (dp[bi][pos].second != -1 && !flag && !... |
#include <bits/stdc++.h> using namespace std; bool comp(pair<long long, long long> a, pair<long long, long long> b) { return a.first > b.first; } long long findBest(vector<pair<long long, long long> >& ps, long long x) { long long res = 0; for (long long i = 0; i < ps.size(); i++) { long long ... |
// Texas A&M University //
// cpsc350 Computer Architecture //
//Alan Achtenberg??
//Project 2//
`define OPCODE_ADD 6'b000000
`define OPCODE_SUB 6'b000000
`define OPCODE_ADDU 6'b000000
`define OPCODE_SUBU 6'b000000
`define OPCODE_AND 6'b000000
`define OPCODE_OR 6'b000000
`define OPCODE... |
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long t, n, k, c = 0, d = 0; cin >> n >> k; map<long long, long long> m; for (int i = 0; i < n; ++i) { cin >> t; m[t]++; } auto it2 = m.begin(); ... |
#include <bits/stdc++.h> using namespace std; bool flag = 0; int work(int a, int n, int p) { int t = a * 1ll * n / p; if (!t) { if (!flag) return a; return max(a, p - a * n); } flag = 1; int a1, n1, p1; a1 = min(p % a, a - (p % a)); n1 = t; p1 = a; if (a * 1ll * n %... |
#include <bits/stdc++.h> using namespace std; set<pair<int, int> > s0, s; int K; long long xx[200010], yy[200010]; void func(long long x, long long y) { while (K > 0 && yy[K - 1] < y) K--; while (K >= 2) { long long tmp = (x - xx[K - 2]) * (yy[K - 1] - yy[K - 2]) - (xx[K - ... |
/*
* 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... |
`define MEM_SIZE 256
`define INIT "../lib/initRegisters.txt"
`define VAL "../lib/regVals.txt"
module im (
input clk,
input [31:0] addr,
output [31:0] data
);
reg [31:0] mem [0:`MEM_SIZE-1];
reg [7:0] test_begin, test_end, regVals_begin, regVals_end;
`ifdef R_TYPE
parameter path = "../program/r_type.... |
#include <bits/stdc++.h> using namespace std; int dis(char a, char b) { if (a > b) swap(b, a); return min(b - a, a + 26 - b); } string tmp = ACTG ; int main() { int n; scanf( %d , &n); string s; cin >> s; int mn = INT_MAX; for (int i = 0; i + 4 - 1 < n; i++) { int now = ... |
#include <bits/stdc++.h> using namespace std; const int Max_n = 2e5 + 10; const int Max_m = 4e5 + 10; int f[Max_n]; struct A { long long val; int pos; bool operator<(const A &a) const { return val < a.val; } } a[Max_n]; struct Edge { int u, v; long long cost; bool operator<(const E... |
#include <bits/stdc++.h> using namespace std; void FAST(); long long int big_mod(long long int val, long long int pow, long long int mod); long long int mod_inverse(long long int val, long long int mod); int main() { FAST(); int m, n; scanf( %d %d , &n, &m); if (m < 2) { printf( 1 ); ... |
#include <bits/stdc++.h> int main() { long int l, r; scanf( %ld %ld , &l, &r); if (l == r) printf( %ld n , r); else printf( 2 n ); return 0; } |
#include <bits/stdc++.h> using namespace std; long long K, statc; int qc; bool query(long long l, long long r) { qc++; assert(qc <= 4499); cout << l << << r << n ; fflush(stdout); string ans; cin >> ans; if (l == r && ans[0] == Y ) { exit(0); } if (ans[0] == B )... |
/**
* 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 <iostream> #include <vector> #include <array> #define vi vector<int> #define pii pair<int, int> #define fst first #define snd second using namespace std; const int SZ = (1 << 19) + 5, INF = (1e9) + 7; int N, ans[200001]; vi idx[200001]; array<int, 4> seg[2][SZ]; int lz[2][SZ... |
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995/2018 Xilinx, Inc.
//
// 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
//
/... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 25.06.2017 19:20:37
// Design Name:
// Module Name: conversor_num_16b
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//... |
#include <bits/stdc++.h> using namespace std; void xx(int *a, int n) { for (int j = 1; j < n; ++j) for (int i = j; i <= n; ++i) if (a[j] < a[i]) { int t = a[i]; a[i] = a[j]; a[j] = t; } } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL)... |
#include <bits/stdc++.h> const int N = 110000; using namespace std; set<pair<int, int> > elements; set<pair<int, int> >::iterator it; int n; int ar[N]; int next_lucky[N], prev_lucky[N]; bool is_lucky[N]; vector<int> luck; long long ans; long long BIN[N]; set<int> banned_set; set<pair<int, int>... |
#include <bits/stdc++.h> using namespace std; long long n, m, z, x, c, sum, a[101][101], us[101][101]; char cc, stl; set<long long> s; void dfs(long long i, long long j) { if (a[i][j] == 0 || us[i][j] == 1 || i > n || j > m || i < 1 || j < 1) return; us[i][j] = 1; if (s.count(a[i][j]) == 0) sum++,... |
/*
* 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 n, m; int a[20]; int main() { cin >> n >> m; for (int t, i = 1; i <= n; i++) { cin >> t; a[t]++; } int ans = 0; for (int i = 1; i <= m; i++) for (int j = i + 1; j <= m; j++) ans += a[i] * a[j]; cout << ans; } |
module project2_top (
input _CLOCK_27,
input _CLOCK_50,
input switch_mute,
output led_switch_mute,
input switch_marquee,
output led_switch_marquee,
input switch_ticking_sound,
output led_switch_ticking_sound,
inout _I2C_SDAT, // I2C Data
output _I2C_SCLK, /... |
// (c) Copyright 1995-2016 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; template <typename T> void MACRO_VAR_Scan(T& t) { cin >> t; } template <typename First, typename... Rest> void MACRO_VAR_Scan(First& first, Rest&... rest) { cin >> first; MACRO_VAR_Scan(rest...); } template <typename T> void MACRO_VEC_ROW_Init(... |
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int mini, c; const int MAXN = 2e3 + 3; long long dp[2][MAXN][MAXN]; long long go(int lft, int cur, bool f) { if (lft == 0 and !f) return 1; if (dp[f][lft][cur] != -1) return dp[f][lft][cur]; long long ret = 0; if (f) { ... |
// 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 14:48:58 2017
// Host : GILAMONSTER running 64-bit major release (... |
#include <bits/stdc++.h> using namespace std; const int maxn = 10005; long long n, m, a[maxn], b[maxn]; int k; long long gcd(long long a, long long b) { if (!b) return a; return gcd(b, a % b); } long long exgcd(long long a, long long b, long long &x, long long &y) { if (!b) { x = 1, y = ... |
#include <bits/stdc++.h> using namespace std; void swap(int ar[], int i, int j) { int aux = ar[j]; ar[j] = ar[i]; ar[i] = ar[j]; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, m; cin >> n >> m; int Ma[n][m]; int Mb[n][m]; for (i... |
#include <bits/stdc++.h> using namespace std; long long arr[330]; set<long long> st; map<long long, bool> mp; int main() { long long t, n, i, j, k, l, m; ios_base::sync_with_stdio(0); cin.tie(0); long long p; cin >> t; while (t--) { cin >> n; for (i = 1; i <= n; i++) cin >>... |
module trng_apbif (
//SFRs read values
output reg sfr_CTRL_ENABLE,
output reg sfr_CTRL_READY,
output reg sfr_CTRL_PP,
output reg sfr_CTRL_FIFO,
output reg [32-1:0] sfr_RNDDAT,
output reg [32-1:0] sfr_PPCONF,
output reg [32-1:0] sfr_SRCCONF,
output reg [128-1:0] sfr_SRCINIT,
output reg [32-1:0] sfr... |
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; pair<char, bool> ar[100][100]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> ar[i][j].first; ar[i][j].second = false; } } for (int i = 0; i < n; i++) { f... |
#include <bits/stdc++.h> using namespace std; long long power(long long x, long long y) { if (y == 0) return 1; else { long long result = power(x, y / 2) % 1000000007; if (y % 2 == 0) return (result % 1000000007 * result % 1000000007) % 1000000007; else return (result... |
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c = 0; cin >> a; for (int i = 0; i < a; ++i) { cin >> b; if (b == 1) { c = 1; } } if (c == 0) { cout << EASY n ; } else { cout << HARD n ; } } |
#include <bits/stdc++.h> using namespace std; int main() { int n, mx = 0, my = (1 << 31) - 1, m2x = 0, m2y = (1 << 31) - 1, a, b; scanf( %d , &n); for (int i = 0; i < n; i++) { scanf( %d %d , &a, &b); mx = max(mx, a); my = min(my, b); } scanf( %d , &n); for (int i = 0; i < ... |
/*
* 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 ... |
`timescale 1 ps / 1 ps
(* CORE_GENERATION_INFO = "system,IP_Integrator,{x_ipVendor=xilinx.com,x_ipLanguage=VERILOG,numBlks=1,numReposBlks=1,numNonXlnxBlks=0,numHierBlks=0,maxHierDepth=0,da_ps7_cnt=1}" *)
module system
(DDR_addr,
DDR_ba,
DDR_cas_n,
DDR_ck_n,
DDR_ck_p,
DDR_cke,
DDR_cs_n,
... |
#include <bits/stdc++.h> using namespace std; char ch[200][200]; int rp[200], cp[200]; int main() { int n; while (cin >> n) { memset(rp, 0, sizeof(rp)); memset(cp, 0, sizeof(cp)); for (int i = 1; i <= n; i++) { scanf( %s , ch[i] + 1); for (int j = 1; j <= n; j++) ... |
// Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2017.3 (lin64) Build Wed Oct 4 19:58:07 MDT 2017
// Date : Tue Oct 17 19:49:31 2017
// Host : TacitMonolith running 64-bit Ubuntu 16.04.3... |
#include <bits/stdc++.h> using namespace std; template <class T> void splitstr(const string &s, vector<T> &out) { istringstream in(s); out.clear(); copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out)); } template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; ... |
#include <bits/stdc++.h> using namespace std; long long Ins, Del, Rep, Exc; string A; string B; int lenA, lenB; long long DP[4001][4001]; int posA[4001][26]; int posB[4001][26]; int main() { ios::sync_with_stdio(false); while (cin >> Ins >> Del >> Rep >> Exc) { cin >> A >> B; A = ... |
/*
* plle2_base.v: Simulates the PLLE2_BASE pll of the xilinx 7 series. This
* is just a wrapper around the actual logic found in pll.v
* author: Till Mahlburg
* year: 2019-2020
* organization: Universität Leipzig
* license: ISC
*
*/
`timescale 1 ns / 1 ps
/* A reference for the interface can be found in Xili... |
#include <bits/stdc++.h> using namespace std; #define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); #define prs(n) cout << fixed << setprecision(n) #define ll long long #define db double #define fo(i,m,n) for(int i = m; i <= n; i++) #define fob(i,m,n) for(int i ... |
//==============================================================================
// File: $URL: svn+ssh:///public/Projects/GateLib/branches/dev/Publications/Tutorials/Publications/EECS150/Labs/ChipScopeSerial/Framework/ParityGen.v $
// Version: $Revision: 26904 $
// Author: Greg Gibeling (http://www.gdgib.com)
// Cop... |
#include <bits/stdc++.h> using namespace std; int main() { int x, y, a = 0; cin >> x >> y; for (int i = 1; i <= x; i++) { if (i % 2 == 0) { if (a == 0) { for (int k = 0; k < y - 1; k++) { cout << . ; } cout << # << endl; a++; }... |
#include <bits/stdc++.h> #pragma comment(linker, /STACK:102400000,102400000 ) using std::bitset; using namespace std; int g[302][302][302], f[302][302]; int s[10]; int n, ans; void updateg(int a, int b, int c) { int i, j, tem, t; for (i = c + 1; i < 300; i++) { g[a][b][i] = 1; g[a][c]... |
/**
* 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... |
/*
* 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; void getint(int &v) { char ch, fu = 0; for (ch = * ; (ch < 0 || ch > 9 ) && ch != - ; ch = getchar()) ; if (ch == - ) fu = 1, ch = getchar(); for (v = 0; ch >= 0 && ch <= 9 ; ch = getchar()) v = v * 10 + ch - 0 ; if (fu) v = -v; } ... |
`include "defines.v"
module regfile(
input wire clk,
input wire rst,
//д¶Ë¿Ú
input wire we,
input wire[`RegAddrBus] waddr,
input wire[`RegBus] wdata,
//¶Á¶Ë¿Ú1
input wire re1,
input wire[`RegAddrBus] raddr1,
output reg[`RegBus] rdata1,
//¶Á¶... |
/*88888888 .d88888b.
888 888 888 d88P" "Y88b
888 888 888 888 888
888 888 888
888 888 888 888 888
888 888 888 888 888
888 888 888 Y88b. .d88P
888 888 "Y88888*/
//////////////... |
/**
* 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 n; vector<pair<int, int> > arr; long long solve1(vector<pair<int, int> > tab) { multiset<int> S; int W = 0; for (int i = 0; i < n; i++) { W += tab[i].first; S.insert(tab[i].second); } for (int j = 0; j < n / 2; j++) { int id... |
// Test implicit casts during procedural continuous (net) assignments.
`ifdef __ICARUS__
`define SUPPORT_REAL_NETS_IN_IVTEST
`define SUPPORT_TWO_STATE_NETS_IN_IVTEST
`endif
module implicit_cast();
real src_r;
bit unsigned [7:0] src_u2;
bit signed [7:0] src_s2;
logic unsigned [7:0] src... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, k; cin >> n >> k; vector<string> notes, names(55); for (int i = 0; i <= n - k; i++) { string m; cin >> m; notes.push_back(m); } for (int 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 law... |
#include <bits/stdc++.h> using namespace std; long long unsigned int n; long long unsigned int val(long long unsigned int x, long long unsigned int k) { if (x >= 1e10) return n + 1; long long unsigned int ans = x * (x - 1); ans /= 2; long long unsigned int kt = k; if (ans > n) return n + 1; ... |
#include <bits/stdc++.h> using namespace std; int32_t main() { long long n, l, r, x; cin >> n >> l >> r >> x; long long c[n]; for (long long i = 0; i < n; i++) cin >> c[i]; long long ans = 0; for (long long i = 0; i < (1 << n); i++) { long long mn = INT_MAX; long long mx = 0; ... |
`include "defines.v"
`timescale 1ns/1ps
module tb(
input `control_w port0_ci,
input `data_w port0_di,
output `control_w port0_co,
output `data_w port0_do,
input `control_w port1_ci,
input `data_w port1_di,
output `control_w port1_co,
output `data_w port1_do,
input `control_w port2... |
/*
* phase_shift_check_tb.v: Test bench for phase_shift_check.v
* author: Till Mahlburg
* year: 2020
* organization: Universität Leipzig
* license: ISC
*
*/
`timescale 1 ns / 1 ps
`ifndef WAIT_INTERVAL
`define WAIT_INTERVAL 1000
`endif
`ifndef DESIRED_SHIFT
`define DESIRED_SHIFT 45
`endif
`ifndef CLK_PERIO... |
#include <bits/stdc++.h> using namespace std; long long n, arr[26], s, k, fuck[19], ans; vector<pair<long long, long long> > v1; map<pair<long long, long long>, long long> maph; void rek(long long x, long long r, long long z, long long o, bool p) { if (x >= r) { if (!p) v1.push_back({z, o});... |
/*
* Read rotary/quadrature encoder using no clock
*
* Implementation of https://github.com/theapi/hdd_rotary_encoder/blob/master/HDDRotaryEncoder/HDDRotaryEncoder.ino
*
*/
module quadrature_decode(
reset,
quadA,
quadB,
count
);
input reset, quadA, quadB;
output [7:0] count;
reg [3:... |
/*
* PicoSoC - A simple example SoC using PicoRV32
*
* Copyright (C) 2017 Claire Xenia Wolf <>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all co... |
//-----------------------------------------------------------------------------
//
// (c) Copyright 2010-2011 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; vector<int> divi[2002]; long long dp[2002][2002]; int main() { int n, k; cin >> k >> n; int i, j; for (i = 1; i <= k; i++) { for (j = i; j <= k; j += i) divi[i].push_back(j); } for (i = 1; i <= n; i++) { for (j = 1; j <= k; j++) {... |
// 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 : Tue Jun 06 02:55:53 2017
// Host : GILAMONSTER running 64-bit major release (... |
#include <bits/stdc++.h> using namespace std; mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count()); #pragma GCC optimize( Ofast ) #pragma GCC optimize( -O3 ) #pragma GCC optmize( sse, sse2, sse3, sse4, avx, abx, avx2, sse4.1 ) #pragma GCC optmize( fast-math ) #pragma GCC optimize( ... |
/**
* 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 Q, cnt = 1; int par[400010][21], nxt[400010][21], len[400010]; long long w[400010], sum[400010][21]; long long mx[400010][21]; int find_first_bigger(int u, int W) { if (mx[u][0] >= W) return u; for (int i = 18; i >= 0; i--) if (mx[u][i + 1] >= ... |
#include <bits/stdc++.h> using namespace std; int x, t, a, b, da, db, i, j, p, ans = 0; int main() { scanf( %d %d %d %d %d %d , &x, &t, &a, &b, &da, &db); i = 0; for (i = 0; i < t; i++) for (j = 0; j < t; j++) { if (a - i * da + b - j * db == x) ans = 1; } for (i = 0; i < t; i+... |
#include <bits/stdc++.h> using namespace std; long long dp[int(1e5 + 2)][2]; int a[int(1e5 + 2)]; vector<int> v[2]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int mod = 998244353; int t; cin >> t; while (t--) { v[0].clear(); v[1].clear(); for (int i... |
////////////////////////////////////////////////////////////////////////////////
// Project Name: CoCo3FPGA Version 3.0
// File Name: 6850RX.v
//
// CoCo3 in an FPGA
//
// Revision: 3.0 08/15/15
////////////////////////////////////////////////////////////////////////////////
//
// CPU section copyrighted by J... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); long long int n, a, b, c, d, e, f, g, h, i, j, x, y, count = 0; cin >> n >> x >> y; n = n / 2; if ((x == n || x == n + 1) && (y == n || y == n + 1)) cout << NO ; else cout << YES ; ... |
`timescale 1ns / 1ps
module MasterDataUnitI2C_tb;
reg WriteLoad, ReadorWrite, ShiftorHold, Select, BaudEnable;
reg [7:0] SentData;
reg StartStopAck, Reset, clock;
reg [19:0] BaudRate;
reg [29:0] ClockFrequency;
wire [7:0] ReceivedData;
wire SCL, SDA;
wire ClockI2C=uut.ClockI2C;
MasterDataUnitI2C uut(BaudRate,... |
module inicial ( botao, aberto, fechado, motor, sentido, ledVerde, ledVermelho, display, clock );
input botao, aberto, fechado, motor, sentido, clock;
output ledVerde, ledVermelho;
output [6:0] display;
reg [1:0] estado;
reg [4:0] entrada;
reg [6:0] tmpDisplay;
reg tmpLedVerde, tmpLedVermelho;
parameter Fech... |
#include <bits/stdc++.h> using namespace std; vector<vector<int64_t>> board, vis, diag1, diag2; int main() { ios::sync_with_stdio(false), cin.tie(nullptr); int64_t n; cin >> n; for (int64_t i = 0; i < n; i++) { vector<int64_t> temp; vector<int64_t> zero; for (int64_t j = 0; j < n... |
#include <bits/stdc++.h> using namespace std; const int maxn = 105; int a[maxn]; long long n, k; bool ok(long long d) { long long ret = 0; for (int i = 0; i < n; ++i) { ret += (a[i] - 1 + d) / d; } return ret * d <= k; } int main() { ios::sync_with_stdio(false); cin.tie(0); ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 1e3 + 5; int n, m, k; int a[maxn], c[maxn]; int ans, tmp, cnt, rt, sum, ma; int flag; char s[maxn]; bool ok[maxn]; vector<int> vc[maxn], vv[maxn]; template <typename T> inline void read(T &X) { X = 0; int w = 0; char ch = 0... |
#include <bits/stdc++.h> using namespace std; int lim; char c[1000]; int g[1000][1000]; int f[1000][1000], pre[1000][1000]; void back(int v, int k) { int p = pre[v][k]; if (p) { back(p, k - 1); printf( + ); } int i1 = p + 1; int j1 = v; for (; i1 < j1; i1++, j1--) i... |
#include <bits/stdc++.h> using namespace std; int lastr, lastc; int n, m, a, b; int row1[10], rcnt, ans; int main() { int i, j, k; while (scanf( %d%d%d%d , &n, &m, &a, &b) != EOF) { if (m == 1) { printf( 1 n ); continue; } lastr = (n + m - 1) / m; lastc = n % m;... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long x, y, n, m, t, q, a, b, count = 0; cin >> n; long long arr[n]; for (x = 0; x < n; x++) cin >> arr[x]; long long cop[n]; for (x = 0; x < n; x++) cop[x] = arr[x]; s... |
//////////////////////////////////////////////////////////////////////
//// ////
//// Generic 32x32 multiplier ////
//// ////
//// This file is part of the OpenR... |
#include <bits/stdc++.h> using namespace std; bool myfunction(int i, int j) { return (i < j); } int main() { int n, a, b, h; cin >> n >> a >> b; vector<int> myvector(n); for (int i = 0; i < n; ++i) { cin >> h; myvector.at(i) = h; } sort(myvector.begin(), myvector.end(), myfunct... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 16:23:37 11/08/2015
// Design Name:
// Module Name: Integradorv2
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
... |
// synthesis translate_off
`timescale 1ns / 1ps
// synthesis translate_on
// synthesis verilog_input_version verilog_2001
// turn off superfluous verilog processor warnings
// altera message_level Level1
// altera message_off 10034 10035 10036 10037 10230 10240 10030
//-------------------------------------------------... |
#include <bits/stdc++.h> int a, b, c, d, n; char s[4 << 20]; void output() { for (int i = 0; i < n; ++i) if (s[i] == 4 ) a--; else b--; for (int i = 0; i < n; ++i) if (s[i] == 4 ) { while (a) { printf( 4 ); a--; } printf( 4 );... |
//*****************************************************************************
// (c) Copyright 2009 - 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
/... |
#include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; #define pii acos(-1) #define sc(n) scanf( %d ,&n) #define sc2(n,x) scanf( %d%d ,&n,&x) #define pr(n) printf( %d ,n) #define scl(n) scanf( %I64d ,&n) #define scl2(n,m) scanf( %I64d%I64d ,&n,&m) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.