QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#520982#8651. Table Tennisgreen_gold_dog#Compile Error//C++201.5kb2024-08-15 19:10:352024-08-15 19:10:35

Judging History

你现在查看的是最新测评结果

  • [2024-08-15 19:10:35]
  • 评测
  • [2024-08-15 19:10:35]
  • 提交

answer

//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,sse,sse2,sse3,ssse3,sse4,abm,popcnt,mmx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;
typedef long double ldb;
typedef complex<double> cd;

constexpr ll INF64 = 9'000'000'000'000'000'000, INF32 = 2'000'000'000, MOD = 1'000'000'007;
constexpr db PI = acos(-1);
constexpr bool IS_FILE = false, IS_TEST_CASES = true;

random_device rd;
mt19937 rnd32(rd());
mt19937_64 rnd64(rd());

template<typename T>
bool assign_max(T& a, T b) {
	if (b > a) {
		a = b;
		return true;
	}
	return false;
}

template<typename T>
bool assign_min(T& a, T b) {
	if (b < a) {
		a = b;
		return true;
	}
	return false;
}

template<typename T>
T square(T a) {
	return a * a;
}

template<>
struct std::hash<pair<ll, ll>> {
	ll operator() (pair<ll, ll> p) const {
		return ((__int128)p.first * MOD + p.second) % INF64;
	}
};

void solve() {
	ll n, m;
	cin >> n >> m;
	cout << "Yes\n";
	cout << "1\n";
	ll num = 2;
	for (ll i = 0; i < m; i++) {
		cout << "01";
		for (ll j = 2; j < num; j++) {
			cout << "0";
		}
		cout << '\n';
		num++;
	}
	for (ll i = 0; i < n - 2 - m; i++) {
		for (ll j = 0; j < num; j++) {
			cout << 11';
		}
		cout << '\n';
		num++;
	}
}

int main() {
	if (IS_FILE) {
		freopen("", "r", stdin);
		freopen("", "w", stdout);
	}
    	ios_base::sync_with_stdio(false);
    	cin.tie(0);
    	cout.tie(0);
	ll t = 1;
	if (IS_TEST_CASES) {
		cin >> t;
	}
	for (ll i = 0; i < t; i++) {
		solve();
	}
}

Details

answer.code:66:35: warning: missing terminating ' character
   66 |                         cout << 11';
      |                                   ^
answer.code:66:35: error: missing terminating ' character
   66 |                         cout << 11';
      |                                   ^~
answer.code: In function ‘void solve()’:
answer.code:66:35: error: expected ‘;’ before ‘}’ token
   66 |                         cout << 11';
      |                                   ^
      |                                   ;
   67 |                 }
      |                 ~                  
answer.code: In function ‘int main()’:
answer.code:75:24: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   75 |                 freopen("", "r", stdin);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~
answer.code:76:24: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   76 |                 freopen("", "w", stdout);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~