| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 121577 | Adhyyan1252 | Brunhilda’s Birthday (BOI13_brunhilda) | C++11 | 710 ms | 41720 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(false); cin.tie(0);
	int m, q; cin>>m>>q;
	vector<int> p(m);
	for(int i = 0; i < m; i++){
		cin>>p[i];
	}
	vector<int> pd;
	for(int i = m-1; i >= 0 && i >= m-10; i--){
		pd.push_back(p[i]);
	}
	vector<int> dp(1e7+1, 1e7*2);
	dp[0] = 0;
	for(int i = 1; i < p.back(); i++) dp[i] = 1;
	for(int i = p.back(); i < dp.size(); i++){
		dp[i] = 1e7*2;
		for(int j : pd){
			dp[i] = min(dp[i], dp[i-i%j]+1);
		}
	}
	for(int i = 0; i < q; i++){
		int j; cin>>j;
		if(dp[j] > 1e7){
			cout<<"oo\n";
		}else{
			cout<<dp[j]<<"\n";
		}
	}
	cout.flush();
}
컴파일 시 표준 에러 (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... | ||||
