Submission #1444514
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-9;
const bool debug = 0;
//---------------------------------//
int N;
ll x[112345];
int a[112345];
ll M, K;
int main() {
cin >> N;
REP(i, N) scanf("%lld", x + i);
cin >> M >> K;
REP(i, M) scanf("%d", a + i), a[i]--;
K %= (M + 1);
while (K--) REP(i, M) x[a[i]] = x[a[i] - 1] + x[a[i] + 1] - x[a[i]];
REP(i, N) printf("%lld\n", x[i]);
return 0;
}
Submission Info
Submission Time
2017-07-23 14:45:07+0900
Task
C - Rabbit Exercise
User
tkmst201
Language
C++14 (GCC 5.4.1)
Score
0
Code Size
973 Byte
Status
WA
Exec Time
2103 ms
Memory
2432 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:27:32: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
REP(i, N) scanf("%lld", x + i);
^
./Main.cpp:29:38: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
REP(i, M) scanf("%d", a + i), a[i]--;
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
0 / 800
Status
Set Name
Test Cases
Sample
0_00.txt, 0_01.txt, 0_02.txt
All
0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 1_21.txt, 1_22.txt, 1_23.txt, 1_24.txt, 1_25.txt
Case Name
Status
Exec Time
Memory
0_00.txt
AC
1 ms
256 KB
0_01.txt
AC
1 ms
256 KB
0_02.txt
AC
1 ms
256 KB
1_00.txt
AC
1 ms
256 KB
1_01.txt
AC
1 ms
256 KB
1_02.txt
AC
23 ms
2048 KB
1_03.txt
AC
293 ms
2432 KB
1_04.txt
TLE
2103 ms
1152 KB
1_05.txt
WA
121 ms
384 KB
1_06.txt
TLE
2103 ms
512 KB
1_07.txt
WA
1341 ms
384 KB
1_08.txt
WA
665 ms
512 KB
1_09.txt
TLE
2103 ms
512 KB
1_10.txt
WA
297 ms
384 KB
1_11.txt
WA
271 ms
384 KB
1_12.txt
WA
9 ms
256 KB
1_13.txt
TLE
2103 ms
512 KB
1_14.txt
WA
1089 ms
384 KB
1_15.txt
TLE
2103 ms
640 KB
1_16.txt
AC
4 ms
384 KB
1_17.txt
TLE
2103 ms
896 KB
1_18.txt
TLE
2103 ms
1024 KB
1_19.txt
TLE
2103 ms
1152 KB
1_20.txt
TLE
2103 ms
768 KB
1_21.txt
TLE
2103 ms
768 KB
1_22.txt
TLE
2103 ms
1152 KB
1_23.txt
WA
1064 ms
1920 KB
1_24.txt
WA
200 ms
1408 KB
1_25.txt
TLE
2103 ms
1408 KB