Submission #9489

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
94892014-09-28 06:48:59lemonsqueezeSolve another chuck (kriii2_S)C++98
Compilation error
0 ms0 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

S.cpp: In function 'void rotR(int, int)':
S.cpp:15:50: error: 'to_string' was not declared in this scope
S.cpp: In function 'void rotC(int, int)':
S.cpp:22:50: error: 'to_string' was not declared in this scope
S.cpp: In function 'void negR(int)':
S.cpp:29:50: error: 'to_string' was not declared in this scope
S.cpp: In function 'void negC(int)':
S.cpp:35:50: error: 'to_string' was not declared in this scope
S.cpp: In function 'int main()':
S.cpp:133:35: warning: format '%d' expects argument of type 'int', but argument 3 has type 'std::vector<std::basic_string<char> >::size_type {aka long unsigned int}' [-Wformat]
S.cpp:134:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
S.cpp:84:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
S.cpp:85:74: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]