제출 #1125513

#제출 시각아이디문제언어결과실행 시간메모리
1125513sleepntsheep복사 붙여넣기 2 (JOI15_copypaste2)C11
100 / 100
193 ms2888 KiB
#include <stdio.h>

#define N (1 << 18)

int k, m, n,
    a[N], b[N], c[N];
char s[N];


int main()
{
  int i, j, ii;
  (void)scanf("%d%d%s%d", &k, &n, s, &m);

  for (i = 0; i < m; ++i)
    (void)scanf("%d%d%d", a + i, b + i, c + i);

  for (i = 0; i < k; ++i)
  {
    ii = i;
    for (j = m - 1; j >= 0; --j)
    {
      if (ii < c[j])
        continue;
      if (ii < b[j] + c[j] - a[j])
        ii += a[j] - c[j];
      else
        ii += a[j] - b[j];
    }
    putchar(s[ii]);
  }

  return 0;
}


컴파일 시 표준 에러 (stderr) 메시지

copypaste2.c: In function 'main':
copypaste2.c:13:9: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   (void)scanf("%d%d%s%d", &k, &n, s, &m);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
copypaste2.c:16:11: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |     (void)scanf("%d%d%d", a + i, b + i, c + i);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...