# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
731769 | Trunkty | 걷기 (NOI12_walking) | C++14 | 1 ms | 408 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/extc++.h>
using namespace std;
typedef long long ll;
#define int ll
int l,n,ans;
vector<vector<int>> peeps;
int dp[505];
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> l >> n;
for(int i=1;i<=n;i++){
int a,b;
cin >> a >> b;
peeps.push_back({a,b});
}
sort(peeps.begin(),peeps.end());
for(int i=0;i<peeps.size();i++){
int x = peeps[i][0], y = peeps[i][1];
dp[i] = 1;
for(int j=0;j<i;j++){
if(l*y+peeps[j][0]*peeps[j][1]*y>l*peeps[j][1]+x*peeps[j][1]*y){
dp[i] = max(dp[i],dp[j]+1);
}
}
ans = max(ans,dp[i]);
}
cout << ans << "\n";
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |