結果
| 問題 |
No.112 ややこしい鶴亀算
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-15 22:20:33 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 431 bytes |
| コンパイル時間 | 1,732 ms |
| コンパイル使用メモリ | 193,260 KB |
| 最終ジャッジ日時 | 2025-01-14 15:06:20 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | WA * 23 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, ss, ee) for (int i = ss; i < ee; ++i)
using namespace std;
void solve() {
int N, x, sum = 0;
cin >> N;
rep(i, 0, N) {
cin >> x;
sum += x;
}
int a = N, b = 0;
rep(i, 0, N) {
if (sum == a * 4 + b * 2) {
cout << a << " " << b << endl;
return;
}
a--;
b++;
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
solve();
getchar();
}