Submission #979561
Source Code Expand
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back
const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;
#define int LL
signed main(void) {
int N; cin >> N;
VI p(N);
REP(i, N) scanf("%lld", &p[i]);
VI hoge(N);
int cnt = 0;
for (auto itr = hoge.rbegin(); itr != hoge.rend(); itr++) {
*itr = INF - cnt++;
}
VI sum(N);
REP(i, N) sum[p[i] - 1] = hoge[i];
VI a(N), b(N);
REP(i, N) {
a[i] = (i + 1) * (i + 1);
b[i] = sum[i] - a[i];
}
REP(i, N) printf("%d ", a[i]);
cout << endl;
REP(i, N) printf("%d ", b[i]);
cout << endl;
}
Submission Info
Submission Time
2016-11-12 21:37:04+0900
Task
B - Construct Sequences
User
sekiya9311
Language
C++14 (GCC 5.4.1)
Score
0
Code Size
2056 Byte
Status
WA
Exec Time
1121 ms
Memory
1024 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:64:34: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 2 has type ‘__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type* {aka int*}’ [-Wformat=]
REP(i, N) scanf("%lld", &p[i]);
^
./Main.cpp:64:35: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
REP(i, N) scanf("%lld", &p[i]);
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
0 / 400
Status
Set Name
Test Cases
Sample
example0.txt, example1.txt, example2.txt
All
000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, example0.txt, example1.txt, example2.txt
Case Name
Status
Exec Time
Memory
000.txt
RE
1121 ms
256 KB
001.txt
WA
3 ms
256 KB
002.txt
WA
3 ms
256 KB
003.txt
WA
3 ms
256 KB
004.txt
RE
110 ms
256 KB
005.txt
WA
9 ms
1024 KB
006.txt
RE
110 ms
256 KB
007.txt
WA
8 ms
896 KB
008.txt
RE
112 ms
256 KB
009.txt
WA
8 ms
1024 KB
010.txt
WA
9 ms
1024 KB
011.txt
WA
9 ms
1024 KB
012.txt
WA
9 ms
1024 KB
013.txt
WA
9 ms
1024 KB
014.txt
WA
9 ms
1024 KB
015.txt
WA
9 ms
1024 KB
016.txt
WA
9 ms
1024 KB
017.txt
WA
9 ms
1024 KB
018.txt
WA
9 ms
1024 KB
example0.txt
AC
2 ms
256 KB
example1.txt
AC
3 ms
256 KB
example2.txt
AC
2 ms
256 KB