MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / main

Function main

Math/Freivalds Algorithm.cpp:79–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77 return 1;
78}
79int main() {
80 ios_base::sync_with_stdio(0);
81 cin.tie(0);
82 int n, q; cin >> n >> q;
83 Mat a(n, n), c(n, n);
84 for(int i = 0; i < n; i++){
85 for(int j = 0; j < n; j++) cin >> a.a[i][j];
86 }
87 while (q--) {
88 int ty; cin >> ty;
89 if (ty == 1) {
90 int x1, y1, x2, y2, v; cin >> x1 >> y1 >> x2 >> y2 >> v;
91 for(int i = x1; i <= x2; i++) for(int j = y1; j <= y2; j++) a.a[i][j] += v;
92 }
93 else {
94 for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) cin >> c.a[i][j];
95 cout << (Freivalds(a, a, c) ? "yes\n" : "no\n");
96 }
97 }
98 return 0;
99}

Callers

nothing calls this directly

Calls 1

FreivaldsFunction · 0.85

Tested by

no test coverage detected