提交记录 10210


用户 题目 状态 得分 用时 内存 语言 代码长度
Nartsam noip18b. 【NOIP2018】货币系统 Accepted 100 18.587 ms 132 KB C++ 523 B
提交时间 评测时间
2019-08-22 10:44:34 2020-08-01 02:03:10
#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN=100+7,MAXA=25000;
int a[MAXN],vis[MAXA+7],n,m,T;
int main(){
	scanf("%d",&T);
	while(T--){
		m=0; memset(vis,0,sizeof(vis));
		scanf("%d",&n);
		for(int i=1;i<=n;++i) scanf("%d",&a[i]);
		sort(a+1,a+1+n);
		vis[0]=1;
		for(int i=1;i<=n;++i){
			if(vis[a[i]]) continue;
			++m;
			for(int j=0;j<=MAXA-a[i];++j){
				if(vis[j]){
					vis[j+a[i]]=1;
				}
			}
		}
		printf("%d\n",m);
	}
	return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1641.52 us132 KBAcceptedScore: 5

Testcase #2617.05 us132 KBAcceptedScore: 5

Testcase #3622.61 us132 KBAcceptedScore: 5

Testcase #4992 us132 KBAcceptedScore: 5

Testcase #5872.4 us132 KBAcceptedScore: 5

Testcase #6858.2 us132 KBAcceptedScore: 5

Testcase #71.146 ms132 KBAcceptedScore: 5

Testcase #81.208 ms132 KBAcceptedScore: 5

Testcase #91.385 ms132 KBAcceptedScore: 5

Testcase #101.346 ms132 KBAcceptedScore: 5

Testcase #111.415 ms132 KBAcceptedScore: 5

Testcase #121.426 ms132 KBAcceptedScore: 5

Testcase #131.388 ms132 KBAcceptedScore: 5

Testcase #141.913 ms132 KBAcceptedScore: 5

Testcase #152.085 ms132 KBAcceptedScore: 5

Testcase #161.826 ms132 KBAcceptedScore: 5

Testcase #1717.402 ms132 KBAcceptedScore: 5

Testcase #1818.245 ms132 KBAcceptedScore: 5

Testcase #1917.936 ms132 KBAcceptedScore: 5

Testcase #2018.587 ms132 KBAcceptedScore: 5


Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:31:42 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠