結果
問題 | No.587 七対子 |
ユーザー |
![]() |
提出日時 | 2017-11-03 23:05:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 588 bytes |
コンパイル時間 | 494 ms |
コンパイル使用メモリ | 70,016 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 19:43:47 |
合計ジャッジ時間 | 1,354 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:31:13: warning: 't' may be used uninitialized [-Wmaybe-uninitialized] 31 | cout << t << endl; | ^ main.cpp:20:8: note: 't' was declared here 20 | char t; | ^
ソースコード
#include<iostream> #include<algorithm> #include<vector> #include<string> #include<utility> #define REP(i,n) for(int i = 0;i < (n);i++) #define pb push_back using namespace std; const int INF = 1e9; typedef long long ll; int main(){ string s; cin >> s; int a[26]={0}; REP(i,s.size()){ a[s[i]%26]++; } int sum = 0; char t; for(int i = 19;i < 19+26;i++){ if(a[i%26] == 2){ sum++; //t = 97+(i-19); } else if(a[i%26] == 1){ t = 97+(i-19); } } if(sum == 6) cout << t << endl; else cout << "Impossible" << endl; return 0; }