Submission #508677

#TimeUsernameProblemLanguageResultExecution timeMemory
508677rainboy회전 (JOI12_rotate)C11
90 / 100
2055 ms6080 KiB
#include <stdio.h>

#define N	2000

int main() {
	static char cc[N][N + 1], cc_[N][N + 1];
	int n, q, i, j, i_, j_;

	scanf("%d%d", &n, &q);
	for (i = 0; i < n; i++)
		scanf("%s", cc[i]);
	while (q--) {
		int l;

		scanf("%d%d%d", &i, &j, &l), i--, j--;
		for (i_ = 0; i_ < l; i_++)
			for (j_ = 0; j_ < l; j_++)
				cc_[i + l - 1 - j_][j + i_] = cc[i + i_][j + j_];
		for (i_ = 0; i_ < l; i_++)
			for (j_ = 0; j_ < l; j_++)
				cc[i + i_][j + j_] = cc_[i + i_][j + j_];
	}
	for (i = 0; i < n; i++)
		printf("%s\n", cc[i]);
	return 0;
}

Compilation message (stderr)

rotate.c: In function 'main':
rotate.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  scanf("%d%d", &n, &q);
      |  ^~~~~~~~~~~~~~~~~~~~~
rotate.c:11:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   scanf("%s", cc[i]);
      |   ^~~~~~~~~~~~~~~~~~
rotate.c:15:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |   scanf("%d%d%d", &i, &j, &l), i--, j--;
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...