Submission #1314994

#TimeUsernameProblemLanguageResultExecution timeMemory
1314994baodatTopical (NOI23_topical)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define FOR(i, l, r) for(int i = l; i <= r; i++)
#define FORD(i, l, r) for(int i = l; i >= r; i--)
#define db double
#define ldb long double
#define all(x) (x).begin(), (x).end()
#define ins insert
#define pb push_back
namespace sub1{
	void sol(){
		FOR(i, 1, k) if(r[1][i] > 0) return void(cout << "0\n");
		cout << "1\n";
	}
}
void solve(){
	cin >> n >> k;
	FOR(i, 1, n)FOR(j, 1, k) cin >> r[i][j];
	FOR(i, 1, n)FOR(j, 1, k) cin >> u[i][j];
	if(n == 1) sub1::sol();
	
}
signed main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	return 0;
}
/*
n modules k topics
dau tien kien thuc benson cua topic j la p[j] = 0
chi co the hoan thanh modulo i neu p[j] >= r[i][j] voi moi  j
sau khi hoan thanh modulo i thi p[j] += u[i][j] voi moi j
tham lam
p[j] >= r[i][j] moi co the an dc
phai hoan thanh 1 modulo thi moi co the tang dc knowledge


*/

Compilation message (stderr)

Main.cpp: In function 'void sub1::sol()':
Main.cpp:13:27: error: 'k' was not declared in this scope
   13 |                 FOR(i, 1, k) if(r[1][i] > 0) return void(cout << "0\n");
      |                           ^
Main.cpp:4:42: note: in definition of macro 'FOR'
    4 | #define FOR(i, l, r) for(int i = l; i <= r; i++)
      |                                          ^
Main.cpp:13:33: error: 'r' was not declared in this scope
   13 |                 FOR(i, 1, k) if(r[1][i] > 0) return void(cout << "0\n");
      |                                 ^
Main.cpp: In function 'void solve()':
Main.cpp:18:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   18 |         cin >> n >> k;
      |                ^
      |                yn
Main.cpp:18:21: error: 'k' was not declared in this scope
   18 |         cin >> n >> k;
      |                     ^
Main.cpp:19:41: error: 'r' was not declared in this scope
   19 |         FOR(i, 1, n)FOR(j, 1, k) cin >> r[i][j];
      |                                         ^
Main.cpp:20:41: error: 'u' was not declared in this scope
   20 |         FOR(i, 1, n)FOR(j, 1, k) cin >> u[i][j];
      |                                         ^