# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9489 | lemonsqueeze | Solve another chuck (kriii2_S) | C++98 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int n, m;
int a[101][101];
int tmp[101];
vector<string> ans;
void rotR (int i, int k)
{
ans.push_back ("rotR " + to_string ((long long)i) + " " + to_string ((long long )k));
for (int j=1; j<=m; j++) tmp[j%m] = a[i][j];
for (int j=1; j<=m; j++) a[i][j] = tmp[(j-k+m) % m];
}
void rotC (int j, int k)
{
ans.push_back ("rotC " + to_string ((long long)j) + " " + to_string ((long long )k));
for (int i=1; i<=n; i++) tmp[i%n] = a[i][j];
for (int i=1; i<=n; i++) a[i][j] = tmp[(i-k+n) % n];
}
void negR (int i)
{
ans.push_back ("negR " + to_string ((long long)i));
for (int j=1; j<=m; j++) a[i][j] *= -1;