提出 #1907605
ソースコード 拡げる
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(x) (x).begin(),(x).end()
# define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
# define mp make_pair
# define eb emplace_back
# define REP (i, a) for (int i = 0; i < (a); i++)
# define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
# define int LL
int n, m, Q;
vector<int>v;
signed main() {
INIT;
cin >> n >> m;
int num = 0;
for (int i = 1; i <= n; i++) {
v.emplace_back(num);
cout << num;
if (i != n)cout << " ";
num += i;
}
cout << endl;
cout.flush();
map<int, pair<int, int>>mapp;
for (int i = 0; i < n - 1; i++) {
for (int j = i + 1; j < n; j++) {
mapp[v[i] + v[j]] = mp(i, j);
}
}
cin >> Q;
for (int i = 0; i < Q; i++) {
int q;
cin >> q;
cout << mapp[q].first + 1 << " " << mapp[q].second + 1 << endl;
cout.flush();
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | H - Ango |
| ユーザ | keidaroo2380 |
| 言語 | C++14 (GCC 5.4.1) |
| 得点 | 0 |
| コード長 | 1523 Byte |
| 結果 | TLE |
| 実行時間 | 15763 ms |
| メモリ | 2512 KiB |
ジャッジ結果
| セット名 | 01 | 02 | 03 | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 20 | 0 / 50 | 0 / 30 | ||||||
| 結果 |
|
|
|
| セット名 | テストケース |
|---|---|
| 01 | 01.txt |
| 02 | 02.txt |
| 03 | 03.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01.txt | TLE | 15755 ms | 2512 KiB |
| 02.txt | TLE | 15763 ms | -1221992 KiB |
| 03.txt | TLE | 15763 ms | -1301360 KiB |