結果
問題 | No.313 π |
ユーザー |
![]() |
提出日時 | 2019-03-16 00:48:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 5,000 ms |
コード長 | 684 bytes |
コンパイル時間 | 1,506 ms |
コンパイル使用メモリ | 166,096 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-01 22:12:13 |
合計ジャッジ時間 | 2,770 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 32 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:33:11: warning: 'm' may be used uninitialized [-Wmaybe-uninitialized] 33 | printf("%d %d\n", n, m); | ~~~~~~^~~~~~~~~~~~~~~~~ main.cpp:21:12: note: 'm' was declared here 21 | int n, m; | ^ main.cpp:33:11: warning: 'n' may be used uninitialized [-Wmaybe-uninitialized] 33 | printf("%d %d\n", n, m); | ~~~~~~^~~~~~~~~~~~~~~~~ main.cpp:21:9: note: 'n' was declared here 21 | int n, m; | ^
ソースコード
#include <bits/stdc++.h>#define fst(t) std::get<0>(t)#define snd(t) std::get<1>(t)#define thd(t) std::get<2>(t)#define unless(p) if(!(p))#define until(p) while(!(p))using ll = std::int64_t;using P = std::tuple<int,int>;int cnt[10] = {20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841};std::string S;int main(){std::cin.tie(nullptr);std::ios::sync_with_stdio(false);std::cin >> S;int n, m;for(int i=0;i<=9;++i){int c = std::count(S.begin(), S.end(), '0' + i);if(c - 1 == cnt[i]){n = i;}else if(c + 1 == cnt[i]){m = i;}}printf("%d %d\n", n, m);}