满脸疑问
查看原帖
满脸疑问
1334925
The_foolishest_OIer楼主2024/8/31 12:59
#include <iostream>
#include <vector>
using namespace std;
const int mod = 1333333;
int t,n,x,flag;
vector <int> link[mod + 5];
int main(){
    cin >> t;
    while (t--){
    	cin >> n;
    	for (int i = 0 ; i < mod ; i++) link[i].clear();
    	for (int i = 1 ; i <= n ; i++){
    		cin >> x;
    		flag = 1;
    		for (int j = 0 ; j < (int)link[x % mod].size() ; j++){
    			if (link[x % mod][j] == x){
    				flag = 0;
    				break;
				}
			}
			if (flag){
				cout << x << ' ';
				link[x % mod].push_back(x);
			}
		}
		puts("");
	}
    return 0;
}

为何 RE?(P4305)

2024/8/31 12:59
加载中...