We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我写了一个这样的数据生成器:
from cyaron import * test_data = IO(file_prefix="small", data_id=1) n = randint(1, 4000) test_data.input_writeln(n) a = Vector.random(n, [(0, 1000)]) test_data.input_writeln(a) b = Vector.random(n, [(0, 1000)]) test_data.input_writeln(b) k = randint(1, 1000000) test_data.input_writeln(k) test_data.output_gen("./std")
然后把生成出来的数据文件用main.cpp(不是std)读取:
#include<bits/stdc++.h> using i64 = long long; void solve(){ int n; std::cin >> n; std::cout << "n = " << n << '\n'; i64 suma = 0; std::vector<int> a(n + 1); for (int i = 1;i <= n;i ++) { std::cin >> a[i]; suma += a[i]; } std::cout << "A: " << '\n'; for (int i = 1;i <= n;i ++) { std::cout << a[i] << " \n"[i == n]; } i64 sumb = 0; std::vector<int> b(n + 1); for (int i = 1;i <= n;i ++) { std::cin >> b[i]; sumb += b[i]; } std::cout << "B: " << '\n'; for (int i = 1;i <= n;i ++) { std::cout << b[i] << " \n"[i == n]; } int k; std::cin >> k; std::cout << "k = " << k << '\n'; } int main(){ freopen("in.txt","r",stdin); freopen("out.txt","w",stdout); int tt = 1; //cin >> tt; while(tt --) solve(); fclose(stdin); fclose(stdout); return 0; }
但是他的输出是这个样子的:
其中的最后一个数字非0数字98223刚好是用cyaron生成的k值,所以我推测是Vector.random生成的数字数量不够,导致文件读入到了EOF,于是后面的数据都读成了0。
经过测试,n < 1000的规模生成的vector是没问题的,在大于1000左右的时候就会出现这种情况
The text was updated successfully, but these errors were encountered:
是的, 这个vector有问题。
Sorry, something went wrong.
see: #109
No branches or pull requests
我写了一个这样的数据生成器:
然后把生成出来的数据文件用main.cpp(不是std)读取:
但是他的输出是这个样子的:
其中的最后一个数字非0数字98223刚好是用cyaron生成的k值,所以我推测是Vector.random生成的数字数量不够,导致文件读入到了EOF,于是后面的数据都读成了0。
经过测试,n < 1000的规模生成的vector是没问题的,在大于1000左右的时候就会出现这种情况
The text was updated successfully, but these errors were encountered: