Source stringclasses 1
value | Date int64 2.01k 2.02k | Text stringlengths 22 783k | Token_count int64 20 394k |
|---|---|---|---|
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
# define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll N;
cin>>N;
typedef pair<ll,ll> P;
vector<P> A(N);
rep(i,N){
ll a;
cin>>a;
A[i] = P{i,a};
}
sort(A.... | 302 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;... | 882 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define mod 1000000007
#define mod1 998244353
#define lli long long int
#define plli pair<lli,lli>
#define REP(i,a,b) for(lli i=a;i<b;i++)
#define REPI(i,a,b) for(lli i... | 2,207 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define R register
#define mp make_pair
#define ll long long
#define pii pair<int, int>
using namespace std;
const int mod = 998244353, N = 2100;
int n, a[N];
pii b[N];
ll f[N][N];
inline int addMod(int a, int b) {
return (a += b) >= mod ? a - mod : a;
}
inline ll quickpow(ll base, ll pw) {... | 486 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);++i)
using ll = int_fast64_t;
using pll = pair<ll,ll>;
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T>vector<T> vec(size_t a){return vector<T>(a);}
template<class T, ... | 359 |
Project_CodeNet | 2,020 | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
//priority_queue<long long, vector<long long>, greater<long long>> pq;
... | 519 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
ll dp[2001][2001];
int main(){
ll n,A[200001];
cin>>n;
rep(i,n) cin>>A[i];
vector<P> B;
r... | 186 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using pll = pair<ll, ll>;
#define rep(i, n) for (ll i = 0, xxx_rep_end = (n); i < xxx_rep_end; ++i)
#define all(x) (x).begin(), (x).end()
template <class T1, class T2>
inline bool chmax(T1 &a, const T2 &b) {
if (a < b) {
... | 447 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef pair<long long, int> Pair;
const int maxn = 2000 + 7;
int n;
vector<Pair> o;
long long f[maxn][maxn];
long long dp(int x, int y) {
if (x > y) return 0;
if (f[x][y] != -1) return f[x][y];
int u = y - x;
f[x][y] = max(o[u].first * abs(o[u].second - ... | 243 |
Project_CodeNet | 2,020 | /**
* author: otera
**/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bi... | 711 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
#define sz(x) ((int)x.size())
#define pb push_back
#define ii pair<int,int>
#define ppb pop_back
#define orta ((bas+son)>>1)
#define st first
#define nd second
#define ll long long
#define N 2005
#define inf 100000000000000ll
#define MOD 998244353
#define LOG 31
#define EPS 0.000000001
#define M... | 416 |
Project_CodeNet | 2,020 | ///////////////////////////////////////////////////////////////////////////////
#include <bits/stdc++.h>
#include <unistd.h>
#include <time.h>
#include <sys/time.h>
using namespace std;
///////////////////////////////////////////////////////////////////////////////
#define DEBUG 0
#define pb push_back
#define V ve... | 7,677 |
Project_CodeNet | 2,020 | #include<iostream>
#include<queue>
#include<algorithm>
#include<functional>
using namespace std;
typedef long long ll;
int n;
pair<ll, int> A[2000 + 10];
ll dp[2000 + 10][2000 + 10];
int main() {
cin >> n;
for (int i = 0; i < n; i++)cin >> A[i].first, A[i].second = i;
sort(A, A + n, greater<pair<ll, int>>());
... | 348 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0)
#define endl "\n";
#define pb push_back
#define f first
#define s second
#define all(a) a.begin(),a.end()
#define int long long
const int MOD=1e9+7;
const int N=2e3+10;
int dp[N][N];
vector<pair<int,int> >v;
int go(int... | 282 |
Project_CodeNet | 2,020 | /*
ॐ त्र्यम्बकं यजामहे सुगन्धिं पुष्टिवर्धनम् |
उर्वारुकमिव बन्धनान्मृत्योर्मुक्षीय माऽमृतात् ||
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long int
#define F ... | 875 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define debug2(x,... | 597 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/indexed.hpp>
#define FOR(i,k,n) for(int i = (k);i < (n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) begin(x),end(x)
using namespace std;
using namespa... | 342 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using P = pair<lint, lint>;
lint dp[2123][2123];
template<class T> void chmax(T &a, T b) { a = max(a, b); }
int main() {
lint n;
cin >> n;
vector<P> a(n);
for(lint i=0; i<n; i++) {
lint x;
cin >> x;
a.e... | 274 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS... | 681 |
Project_CodeNet | 2,020 | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007... | 558 |
Project_CodeNet | 2,020 | #include <iostream>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <stdlib.h>
#include <tuple>
#include <iomanip>
#include <iterator>
#include <stdio.h>
#include <fstream>
#include <t... | 1,324 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(co... | 1,028 |
Project_CodeNet | 2,020 | #include <iostream>
#include <vector>
#include <utility>
#include <cstdint>
#include <algorithm>
#include <functional>
template<typename F>
constexpr decltype(auto) fix(F&& f) {
return[f = std::forward<F>(f)](auto&&... args) {
return f(f, std::forward<decltype(args)>(args)...);
};
}
using i64 = std::int64_t;
int... | 364 |
Project_CodeNet | 2,020 | /*temp2*/
//
//
//
//
//
//
//
//
//
// //をuse_ooに置き換える
//#undef _DEBUG
//#pragma GCC optimize("Ofast")
//不動小数点の計算高速化
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#include <boost/multiprecision/cpp_int.hpp>
#ifdef _DEBUG
#include "template.h"/*プリコンパイル済みヘッダ*/
#else
#if __cplusplus >... | 68,813 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
#define TASK "ABC"
//freopen(TASK".inp", "r", stdin); freopen(TASK".out", "w", stdout);
ios_base::sync_with_stdio(0);
int n;
cin >> n;
vector < pair < int, int > > a(n);
for (int i = 0; i < n; ++i) {
int x;
... | 366 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int mo = 1e9+7;
constexpr int inf = 1<<30;
constexpr ll infl = 1ll<<60;
constexpr ll mo2 = 998244353;
const double PAI = acos(-1);
constexpr long double eps = 1e-9;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
... | 337 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
# define ll long long
# define int long long //comment it out when MLE
//# define endl "\n"
#define gok ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
# define mo 1000000007
# define mm 1000000007
# define pi acos(-1)
# define fi first
# define se second
using namesp... | 307 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"
template<typename T> inline bool chmax(T &a, T b){... | 656 |
Project_CodeNet | 2,020 | #pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<l... | 1,280 |
Project_CodeNet | 2,020 | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()
int const N = 2001;
int n, v[N];
ll dp[N][N];
vector<pair<int,int> > x;
bool srt(pair<int,int> a, pair<int,int> b){
if(a.first > b.first)return true;
return a.first == b.fir... | 310 |
Project_CodeNet | 2,020 | #include <limits>
#include <initializer_list>
#include <utility>
#include <bitset>
#include <tuple>
#include <type_traits>
#include <functional>
#include <string>
#include <array>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
... | 1,000 |
Project_CodeNet | 2,020 | #include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;
typedef long long ll;
#define db(x) cerr << #x << ": " << x << '\n';
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(... | 700 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define rep(i,s,n) for (int i=s;i<n;++i)
#define drep(i,s,n) for (int i=n;i>=s;--i)
#define all(x) (x).begin(),(x).end()
#define rall(a) (a).rbegin(),(a).rend()
#define print(x) cout<<(x)<<endl
using namespace std;
typedef long long ll;
int gcd(int a,int b)
{if (a%b == 0) return(b);
else ... | 532 |
Project_CodeNet | 2,020 | #include <iostream>
#include <algorithm>
#include <functional>
using ll=long long int;
using P=std::pair<ll,ll>;
constexpr int MAX=2010;
int n;
P p[MAX];
ll dp[MAX][MAX];
int main() {
std::cin>>n;
for(int i=1;i<=n;++i){
int a;
std::cin>>a;
p[i]=P(a,i);
}
std::sort(p+1,p+... | 429 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define fi first
#define se second
template<typename T>
void selfmax(T &a, T b){
if(b>a) a=b;
}
int n;
int main(){
//
//freopen("input.txt", "r", stdin);
//
ios::sync_with_stdio(0);
cin.tie(0);
int n;
... | 356 |
Project_CodeNet | 2,020 | //BUGSBUNNY
//IIT ROORKEE
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define ll long long
#define double long double
#define ld long double... | 735 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 2000;
int N;
pii A[MAXN+10];
ll dp[MAXN+10][MAXN+10];
ll solve(int l, int r)
{
ll &ret=dp[l][r];
if(ret!=-1) return ret;
ret=0;
int t=l+N+1-r+1;
if(t==N+1) return ret=0;
... | 253 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
#define hackcyborg shresth_walia
#define ll long long int
#define ld long double
#define For(i,a,b) for (ll i = (a); i!=(b); i = (a)<(b)? i+1 : i-1)
#define pb push_back
#define mod 1000000007
ll dp[2002][2002];
int main()
{
ll n;
cin>>n;
ll a[n+1];
memset(dp... | 351 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<pair<int64_t,int>> p(n);
for(int i=0;i<n;++i){
cin>>p[i].first;
p[i].second=i;
}
sort(p.begin(),p.end(),greater<pair<int64_t,int>>());
//上から左にl個、右にr個振り分けた時の最大値f[l][r];
vector<vector<int64_t>> f(n+1,vector<int64_t>(... | 340 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAX = 510000;
const int MOD = 1000000007;
signed main(){
int n;
cin>>n;
pair<int,int> a[n];int b;
for(int i=0;i<n;i++){
cin>>b;
a[i]=make_pair(b,i);
}
... | 472 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(V) V.begin(),V.end()
#define MOD 1000000007
ll dp[2010][2010];
void chmax(ll& a, ll b) {
a = max(a, b);
}
int main() {
for (int i = 0;i < 2010;i++) {
for (int j = 0;j < 2010;j++) {
dp[i][j] = 0;
}
}
ll N, X;
cin >> N;
vector<... | 323 |
Project_CodeNet | 2,020 | // JAI SHREE RAM
typedef long long int ll;
typedef unsigned long long int ull;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define FOR(i,n) for(int i=0;i<n;i++)
#define MOD 1000000007
#define sz(a) int((a).size())
#define forn(i, n) for (int i = 0; i < (n); ++i)
#define fore(i, l, r) for (int i = int... | 559 |
Project_CodeNet | 2,020 | #include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <stack>
#include <set>
#include <bitset>
#include <functional>
#include <cassert>
using namespa... | 1,074 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2007;
int dp[N][N], val[N], pos[N];
pair<int,int> a[N];
signed main(){
int n;
cin >> n;
for(int i=1;i<=n;++i){
cin >> a[i].first;
a[i].second = i;
}
sort(begin(a)+1,begin(a)+n+1);
reverse(begi... | 284 |
Project_CodeNet | 2,020 | #include <cstdio>
#include <algorithm>
#define maxn 2005
#define LL long long
using namespace std;
LL dp[maxn][maxn];
struct node{
int seq,val;
}a[maxn];
int cmp(node a,node b){
return a.val<b.val;
}
int main(){//大的值最后放
int i,j,len,n;
scanf("%d",&n);
for(i=1;i<=n;i++)scanf("%d",&a[i].val),a[i].seq=i;
sort(a+1,a+1... | 273 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
using namespace std;
using ll = long long;
using ld = long double;
int main(){
ios_base::sync_with_stdio(false);cin.tie(0)... | 331 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define int long long
#define f first
#define s second
using namespace std;
const int N=2009,inf=1e18;
pair <int,int> ar[N];
int n,dp[N][N];
int f(int p,int x){
if(p<x or x<0)return -inf;
if(p==0)return 0;
if(dp[p][x]!=-1)return dp[p][x];
int r=max(ar[p].f*abs(ar[p].s-x)+f(p-1,x... | 266 |
Project_CodeNet | 2,020 | #include <iostream>
#include <utility>
#include <algorithm>
#include <cstdlib>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
pii ai[n];
for (int i = 0; i < n; i++) {
cin >> ai[i].first;... | 286 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
const int MAX_N=2e3;
typedef pair<ll,ll> P;
ll N;
P A[MAX_N];
ll memo[MAX_N][MAX_N];
ll dfs(ll n,ll lft,ll rig){
if(n==N)return 0;
if(memo[n][lft]!=-1){
return memo[n][lft];
}
... | 249 |
Project_CodeNet | 2,020 |
#include <iostream>
using namespace std;
#define int long long
#define f(i,n) for(int i=0;i<n;i++)
#define pll pair<long,long>
#define S second
#define F first
signed main(){
int n;
cin>>n;
pll a[n+1];
int dp[n+1][n+1];
f(i,n+1) f(j,n+1) dp[i][j]=0;
for(int i=1;i<n+1;i++){
cin>>a[i].F; //so that it can be ... | 341 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<pair<ll,ll>> a(n);
rep(i,n) {
... | 346 |
Project_CodeNet | 2,020 | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
using ll = long long;
#define in(v) v; cin >> v;
#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define all(f,c,...) (([&](decltype((c)) cccc) { return (f)(begin(cccc), end(cccc), ## __VA_ARGS__); })(c))
template<class T>b... | 301 |
Project_CodeNet | 2,020 | #pragma GCC optimize ("O3")
// #pragma GCC target ("avx")
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>
usin... | 522 |
Project_CodeNet | 2,020 | /*"Success isn't permanent, failure isn't fatal,
it's the courage to continue that counts"*/
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<int, nul... | 564 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);
int main() {
int n;
ll val;
cin >> n;
vector<ve... | 388 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) ... | 514 |
Project_CodeNet | 2,020 | #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#define rep(i, n) for(long i = 0; i < (n); i++)
using namespace std;
using P = pair<long, long>;
long mod = (long) 1e9 + 7;
long ans[2001][2001] = {};
int main(){
long n;
cin >> n;
set<P> s;
... | 334 |
Project_CodeNet | 2,020 | /*
author: madhav_1999 aka orthodoxparadox
19 April 2020 at 6:29 PM
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define dbl long double
#define int ll
#defin... | 1,248 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end... | 416 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
long long dp[2005][2005];
int main()
{
int n;
pair<int, int>a[2005];
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a[i].first;
a[i].second = i;
}
sort(a, a + n, [&](pair<int, int> x, pair<int, int> y) {return x.first > y.first; });
int p;
for (int i = 0; i... | 293 |
Project_CodeNet | 2,020 | //ヘッダー
#include<bits/stdc++.h>
using namespace std;
//型定義
typedef long long ll;
//定数
const int INF=1e+9;
const int MOD=1e+9+7;
//REPマクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REP2(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define REPD2(i,a,b) for(ll i=a;i>(ll)(b);i--)
// ... | 481 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;
typedef vector< vector< vector<ll> > > vvvint;
typedef vector<string> vstring;
typedef vector< vector<string> > vvstring;
typedef ve... | 649 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n) ; ++i)
#define orep(i,n) for(int i = 1; i <= (n); ++i) // one rep
#define drep(i,n) for(int i = (n)-1; i >= 0; --i) // down rep
#define srep(i,s,t) for(int i = (s); i < (t); ++i) // set rep
#define rng(x) (x).begin(),(x).end() // range
#defin... | 590 |
Project_CodeNet | 2,020 | #include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#... | 751 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
#pragma region Macros
#define ll long long
#define ld long double
#define FOR(i,l,r) for(ll i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(ll i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)... | 1,136 |
Project_CodeNet | 2,020 | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <functional>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cassert>
#define InfL 1000000000
#define InfLL 1000000000000000000LL
#define mod 1000000007
#define rep(i,n) for(int (i)=0;(i)<(n)... | 436 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define repA(i, a, n) for(ll i = a; i <= (n); ++i)
#define repD(i, a, n) for(ll i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (long long) (x).size()
#define fill(a) mem... | 539 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define rep(i,n) for(long long i=0;i<n;i++)
using namespace std;
using ll = long long ;
using P = pair<ll,ll> ;
const int INF = 1e9;
const int MOD = 1000000007;
int main(){
ll n;
cin >> n;
vector<P> a(n);
rep(i,n){
cin >> a[i].first ;
a[i].second = i;
}
... | 403 |
Project_CodeNet | 2,020 | #pragma region kyopro_template
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define each(x, v) for (auto &x : v)
#define all(v) (v).begin(), (v).end()
#define sz(v) ((int)(v).size())
#define mem(a, val) memset(a, val, sizeof(a))
#define ini(...) \
int __VA... | 1,880 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
#if !ONLINE_JUDGE
#define debug
#endif
using namespace std;
/******* All Required define Pre-Processors and typedef Constants *******... | 1,185 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#if __has_include(<boost/multiprecision/cpp_int.hpp>)
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
using bll = boost::multiprecision::cpp_int;
using bdouble = boost::multiprecision::cpp_dec_float_100;
using namespace boo... | 2,258 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
ll dp[2001][2001];
int main(void){
ll n;
cin>>n;
vector<pair<ll,ll>>p(n);
rep(0,i,n){
cin>>p[i].first;
p[i].second=i;
}
sort(p.rbegin(),p.rend());
rep(0,i,n+1)rep(0,j,n+... | 248 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
/*
DP[left][right]
leftに何個はいったか、rightに何個入ったか、で管理すればいいか
*/
int main(){
ll N; cin>>N;
vector<pair<ll,ll>> K(N,make_pair(0,0));
vector<vector<ll>> DP(N+1,vector<ll>(N+1,0));
for(int i=0; i<N; i++){
ll A; cin>>A;
K[i].first=A;
K[i].second... | 357 |
Project_CodeNet | 2,020 | /* -*- coding: utf-8 -*-
*
* e.cc: E - Active Infants
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#includ... | 430 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define vt vector
#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define fi first
#define se second
using ll = long long;
using pii = pair<int, int>;
void solve() {
... | 415 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h> // ver2.6.3
//#include <complex.h> // FFT用
//#include <boost/math/tools/minima.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
//using boost::math::tools::brent_find_minima;//fmin(f,L,R,100)で最小値をmp(x,min)で取得
//using boost::multiprecision::cpp_int;//cpp_int (任意の長さのint)
#define fmin brent_find... | 2,029 |
Project_CodeNet | 2,020 | //Optional FAST
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native")
//Required Libraries
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_... | 866 |
Project_CodeNet | 2,020 | #include <iostream>
#include <cmath>
#include <cstdio>
#include <stdio.h>
#include <algorithm>
using namespace std;
const double pi = acos(-1);
typedef long long ll;
const int maxn = 2005;
struct pp{
ll v;
int id;
bool operator<( const pp &o )const{
if( v != o.v )return v > o.v;
return id ... | 465 |
Project_CodeNet | 2,020 | //#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;
ll MOD=1000000007;
ll mod=998244353;
int inf... | 328 |
Project_CodeNet | 2,020 | #include<iostream>
#include<algorithm>
using namespace std;
int N;
pair<long,int>A[2000];
long dp[2001][2001];
main()
{
cin>>N; for(int i=0;i<N;i++)
{
cin>>A[i].first;
A[i].second=i;
}
sort(A,A+N);
reverse(A,A+N);
for(int i=0;i<N;i++)
{
for(int j=0;j<=i;j++)
{
int k=N-(i-j);
dp[... | 217 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=(b);++i)
#define per(i,a,b) for(int i=a;i>=(b);--i)
#define mem(a,x) memset(a,x,sizeof(a))
#define pb push_back
#define mk make_pair
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
const double pi=acos(-1);
const int N=2e3... | 358 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
return vector<decltype(make_vec<T>(ts.... | 507 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define sync ios_base::sync_with_stdio(false); cin.tie(NULL)
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#define mod 1000000007
#define F first
#define S second
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_po... | 398 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ld long double
#define dd double
#define ff first
#define ... | 622 |
Project_CodeNet | 2,020 | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod =1e9+7;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,a,b) for(int i=(a);i<(b);++i)
template<class T> T maxt(T x,T y) {if (x>y) return x;else return y;}
template<class T> T mint(T x,T y) {if (x>y) return y;... | 1,241 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct node{
ll p;
ll v;
}a[2010];
ll dp[2010][2010]; //dp[i][j] i表示移左边数量 j表示移右边数量
bool cmp(node x,node y){
if(x.v==y.v) return x.p<y.p;
return x.v>y.v;
}
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i]... | 280 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep2(i, i0, n) for (int i = i0; i < n; ++i)
int main() {
ll n;
cin >> n;
vector<pair<ll, int>> a(n);
rep(i, n) {
cin >> a[i].first;
a[i].second = i;
}
sort(a.begin(), a.end(), ... | 327 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using ll = long long;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<clas... | 503 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vl = vector<ll>;
int main() {
ll n;
cin >> n;
vector<P> p(n);
rep(i, n) {
int a;
cin >> a;
p[i] = {a, i... | 292 |
Project_CodeNet | 2,020 | #include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#in... | 1,301 |
Project_CodeNet | 2,020 | #define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:512000000")
#include<utility>
#include<iostream>
#include<fstream>
#include<vector>
#include<array>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<functional>
#include<random>
#include<climits>
#include<queu... | 747 |
Project_CodeNet | 2,020 | #define LOCAL
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include... | 937 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll INF = 1e17;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n;
cin >> n;
vector<ll> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
vector<int> ids(n);
iota(ids.begin(), i... | 362 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
usi... | 831 |
Project_CodeNet | 2,020 | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
long long f[2010][2010], p[2010], a[2010], ji[2010];
struct Node {
long long v, p;
}b[2010];
bool cmp(const Node &t1, const Node &t2) {
return t1.v > t2.v;
}
int main() {
int n, m = 1;
scanf("%d", &n);
for(int i = 1; i... | 386 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
int n;
const int N = 2001;
ll dp[N][N];
int a[N];
int p[N];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
iota(p, p + n, 0);
sort(p, p + n, ... | 336 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
return (b < a) ? (a = b, 1) : 0;
}
int main(... | 418 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define map unordered_map
#define set unordered_set
using namespace std;
const ll MOD = 1000000007;
const ll INF = (1LL << 62);
ll dp[2005][2005];
int main() {
ll N;
scanf("%lld", &N);
vector<pair<... | 435 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define ... | 507 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)
#define repitr(itr,a) for(auto itr=a.begin();itr!=a.end();++itr)
const int MOD=1e9+7;
int... | 328 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.