Submission #288873

# Submission time Handle Problem Language Result Execution time Memory
288873 2020-09-02T04:47:40 Z 반딧불(#5784) None (JOI12_rotate) C++17
10 / 100
2000 ms 3328 KB
#include <bits/stdc++.h>

using namespace std;

int n, q;
char arr[1002][1002];
char tmp[1002][1002];

int main(){
    scanf("%d %d", &n, &q);
    for(int i=1; i<=n; i++){
        scanf("%s", arr[i]+1);
    }

    while(q--){
        int x, y, d;
        scanf("%d %d %d", &x, &y, &d);
        for(int i=x; i<x+d; i++) for(int j=y; j<y+d; j++) tmp[i][j] = arr[i][j];
        for(int i=x; i<x+d; i++){
            for(int j=y; j<y+d; j++){
                arr[i][j] = tmp[x+(j-y)][y+(x+d-1-i)];
            }
        }
    }

    for(int i=1; i<=n; i++){
        for(int j=1; j<=n; j++){
            printf("%c", arr[i][j]);
        }
        puts("");
    }
}

Compilation message

rotate.cpp: In function 'int main()':
rotate.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 |     scanf("%d %d", &n, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~~
rotate.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   12 |         scanf("%s", arr[i]+1);
      |         ~~~~~^~~~~~~~~~~~~~~~
rotate.cpp:17:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   17 |         scanf("%d %d %d", &x, &y, &d);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 512 KB Output is correct
2 Correct 3 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 2063 ms 3200 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2088 ms 3200 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 2080 ms 3200 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 2053 ms 3328 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 2071 ms 3200 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 2037 ms 3232 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 2065 ms 3200 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 2045 ms 3200 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 2083 ms 3200 KB Time limit exceeded