0_0_20613219_18234.cpp:8:6: error: 'ans' does not name a type
ans;int main(){ int t, n, x, A, B; scanf("%d", &t); while(t--) { memset(num, 0, sizeof(num)); ans.clear(); scanf("%d", &n); for(int i = 0; i < n; ++ i) { scanf("%d",&x); num[x]++; } scanf("%d%d", &A, &B); for(int i = 1; i <= n; ++ i) { for(int j = 0; j <= A; ++ j) { int lie = n-num[i]; if(i-j >= 0 && lie-j >= 0 && (n-(i-j+lie) >= 0 && n-(i-j+lie) <= B)) { ans.push_back(i); break; } } } if((int)ans.size() == 0) printf("impossible\n"); else { int len = ans.size(); for(int i = 0; i < len-1; ++ i) printf("%d ", ans[i]); printf("%d\n", ans[len-1]); } } return 0;}
^
0_0_20613219_18234.cpp: In function 'int main()':
0_0_20613219_18234.cpp:8:97: error: 'num' was not declared in this scope
ans;int main(){ int t, n, x, A, B; scanf("%d", &t); while(t--) { memset(num, 0, sizeof(num)); ans.clear(); scanf("%d", &n); for(int i = 0; i < n; ++ i) { scanf("%d",&x); num[x]++; } scanf("%d%d", &A, &B); for(int i = 1; i <= n; ++ i) { for(int j = 0; j <= A; ++ j) { int lie = n-num[i]; if(i-j >= 0 && lie-j >= 0 && (n-(i-j+lie) >= 0 && n-(i-j+lie) <= B)) { ans.push_back(i); break; } } } if((int)ans.size() == 0) printf("impossible\n"); else { int len = ans.size(); for(int i = 0; i < len-1; ++ i) printf("%d ", ans[i]); printf("%d\n", ans[len-1]); } } return 0;}
^
0_0_20613219_18234.cpp:8:126: error: 'ans' was not declared in this scope
ans;int main(){ int t, n, x, A, B; scanf("%d", &t); while(t--) { memset(num, 0, sizeof(num)); ans.clear(); scanf("%d", &n); for(int i = 0; i < n; ++ i) { scanf("%d",&x); num[x]++; } scanf("%d%d", &A, &B); for(int i = 1; i <= n; ++ i) { for(int j = 0; j <= A; ++ j) { int lie = n-num[i]; if(i-j >= 0 && lie-j >= 0 && (n-(i-j+lie) >= 0 && n-(i-j+lie) <= B)) { ans.push_back(i); break; } } } if((int)ans.size() == 0) printf("impossible\n"); else { int len = ans.size(); for(int i = 0; i < len-1; ++ i) printf("%d ", ans[i]); printf("%d\n", ans[len-1]); } } return 0;}
^
|