結果
| 問題 |
No.2821 A[i] ← 2A[j] - A[i]
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-05-15 05:03:14 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 665 bytes |
| コンパイル時間 | 2,153 ms |
| コンパイル使用メモリ | 195,260 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-05-15 05:03:22 |
| 合計ジャッジ時間 | 6,482 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 33 |
コンパイルメッセージ
main.cpp: In function ‘void Thaer()’:
main.cpp:30:16: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
30 | freopen("input.txt", "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:31:16: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
31 | freopen("output.txt", "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
//#define int int64_t
#define el '\n'
void Main() {
int n;
cin >> n;
vector<int> v(n);
for (int &x: v)cin >> x;
int64_t g = 0;
cout << g << el;
for (int i = 1; i < n; ++i) {
g = gcd(v[i], v[i - 1]);
cout << g << el;
}
}
void Thaer();
int32_t main() {
cin.tie(0)->sync_with_stdio(0);
// Thaer();
int T = 1;
// cin >> T;
for (int i = 1; i <= T; ++i) {
Main();
// if (i != T)cout << el;
}
}
void Thaer() {
if (fopen("input.txt", "r")) {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
}
}