結果

問題 No.710 チーム戦
コンテスト
ユーザー Pulmn
提出日時 2018-07-10 18:31:49
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 27 ms / 3,000 ms
コード長 974 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,085 ms
コンパイル使用メモリ 180,148 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-04-04 05:35:13
合計ジャッジ時間 2,564 ms
ジャッジサーバーID
(参考情報)
judge5_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/memory:71,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/x86_64-pc-linux-gnu/bits/stdc++.h:58,
                 from main.cpp:1:
In function '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = int*; _ForwardIterator = int*]',
    inlined from '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _Sentinel, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = int*; _Sentinel = int*; _ForwardIterator = int*; _Tp = int]' at /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_uninitialized.h:637:37,
    inlined from 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]' at /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/vector.tcc:257:35,
    inlined from 'int main()' at main.cpp:40:6:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_uninitialized.h:273:31: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' writing between 1 and 400020 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
  273 |               __builtin_memcpy(std::__niter_base(__result),
      |               ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  274 |                                std::__niter_base(__first),
      |                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  275 |                                __n * sizeof(_ValT));
      |                                ~~~~~~~~~~~~~~~~~~~~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/x86_64-pc-linux-gnu/bits/c++allocator.h:33,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/allocator.h:46,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

const int M=100005;
int n;

int main(){
	cin>>n;
	vi dp(M,inf);
	dp[0]=0;
	for(int i=0;i<n;i++){
		int A,B;
		cin>>A>>B;
		vi DP(M,inf);
		for(int j=0;j<M;j++) DP[j]=min({dp[j]+B,(j<A?inf:dp[j-A]),inf});
		dp=DP;
	}
	int res=inf;
	for(int i=0;i<M;i++) res=min(res,max(i,dp[i]));
	cout<<res<<endl;
}
0