QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#732416#8768. Arrested Developmentjiujiu#WA 0ms3624kbC++20566b2024-11-10 14:28:222024-11-10 14:28:25

Judging History

你现在查看的是最新测评结果

  • [2024-11-10 14:28:25]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3624kb
  • [2024-11-10 14:28:22]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
int t,n,m,x,y;

signed main() {
    IOS;
    cin>>n;
    int N=5e3+1;
    vector<int> a(N+1,1e9);
    a[0]=0;
    for(int i=1;i<=n;i++) {
        cin>>x>>y;
        for(int j=N;j>=0;j--) {
            if(j+x<=N)
                a[j+x]=min(a[j],a[j+x]);
            a[j]=a[j]+y;
        }
    }
    int ans=INT_MAX;
    for(int i=0;i<=N;i++) {
        ans=min(ans,a[i]+i);
    }
    cout<<ans<<"\n";
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3624kb

input:

4
100 1
1 90
1 20
1 20

output:

4

result:

wrong answer 1st lines differ - expected: '3', found: '4'