結果
| 問題 |
No.2655 Increasing Strides
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-19 22:51:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 434 bytes |
| コンパイル時間 | 2,321 ms |
| コンパイル使用メモリ | 192,840 KB |
| 最終ジャッジ日時 | 2025-02-20 07:52:52 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 WA * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void fast_io() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
}
signed main(void) {
fast_io();
int N;
cin >> N;
int di[4] = {1, 0, -1, 0};
int dj[4] = {0, 1, 0, -1};
int x = 0, y = 0;
for (int i = 1; i <= N; i++) {
x += di[i % 4] * i;
y += dj[i % 4] * i;
}
cout << (x == 0 && y == 0 ? "Yes\n" : "No\n");
return 0;
}