Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main() {
- int n, m;
- cin>>n>>m;
- std::pair<int, int> a[m];
- for (int i = 0; i < m; i++) {
- cin>>a[i].first>>a[i].second;
- a[i].first--;
- a[i].second--;
- }
- vector<int> h;
- bool r = false;
- for (int x = 0; x < n; x++) {
- for (int y = 0; y < n; y++) {
- for (int i = 0; i < m; i++) {
- if (a[i].first == x && a[i].second == y) {
- r = true;
- cout<<1<<" ";
- break;
- }
- }
- if (!r) cout<<0<<" ";
- r = false;
- }
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement