結果
| 問題 |
No.313 π
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-12-11 21:38:12 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 523 bytes |
| コンパイル時間 | 482 ms |
| コンパイル使用メモリ | 63,360 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-15 08:24:15 |
| 合計ジャッジ時間 | 1,678 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 32 |
ソースコード
#include <string>
#include <iostream>
#include <cmath>
#include <fstream>
using namespace std;
int a[10] = { 1954, 1997, 1986, 1986, 2043, 2082, 2017, 1953, 1962, 2020 };
int b[10];
int main()
{
string s;
cin >> s;
for (int i = 2; i < s.size(); i++) {
b[s[i] - '0']++;
}
int g = 0;
int l = 0;
for (int i = 0; i < 10; i++) {
if (a[i] < b[i]) {
l = i;
}
if (a[i] > b[i]) {
g = i;
}
}
if (l != g) {
cout << g << " " << l << endl;
}
else {
cout << s[0] << " " << 3 << endl;
}
return 0;
}