Submission #677432

#TimeUsernameProblemLanguageResultExecution timeMemory
677432mjhmjh1104복사 붙여넣기 2 (JOI15_copypaste2)C++17
100 / 100
216 ms7072 KiB
#include <tuple> #include <cstdio> #include <vector> using namespace std; int k, m, n; char s[200006]; long long a[200006], b[200006], c[200006]; int main() { scanf("%d%d%s%d", &k, &m, s, &n); for (int i = 0; i < n; i++) scanf("%lld%lld%lld", a + i, b + i, c + i); for (int i = 0; i < k; i++) { int t = i; for (int j = n - 1; j >= 0; j--) { int l = b[j] - a[j]; if (t < c[j]) ; else if (t < c[j] + l) t = a[j] + (t - c[j]); else t -= l; } printf("%c", s[t]); } }

Compilation message (stderr)

copypaste2.cpp: In function 'int main()':
copypaste2.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%d%d%s%d", &k, &m, s, &n);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
copypaste2.cpp:12:38: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     for (int i = 0; i < n; i++) scanf("%lld%lld%lld", a + i, b + i, c + i);
      |                                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...