結果
| 問題 |
No.2707 Bag of Words Encryption
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-31 21:10:23 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 375 bytes |
| コンパイル時間 | 6,741 ms |
| コンパイル使用メモリ | 242,532 KB |
| 最終ジャッジ日時 | 2025-02-21 17:22:06 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:12:18: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'char*')
12 | cin >> n >> (s+1);
| ~~~~~~~~ ^~ ~~~~~
| | |
| | char*
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.4.0/include/c++/12/sstream:38,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.4.0/include/c++/12/complex:45,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.4.0/include/c++/12/ccomplex:39,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.4.0/include/c++/12/x86_64-pc-linux-gnu/bits/stdc++.h:54,
from main.cpp:1:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.4.0/include/c++/12/istream:168:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
168 | operator>>(bool& __n)
| ^~~~~~~~
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.4.0/include/c++/12/istream:168:7: note: conversion of argument 1 would be ill-formed:
main.cpp:12:23: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'char*'
12 | cin >> n >> (s+1);
| ~~^~~
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.4.0/include/c++/12/istream:172:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
172 | operator>>(short& __n);
| ^~~~~~~~
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.4.0/include/c++/12/istream:172:7: note: conversion of argument 1 would be ill-f
ソースコード
#include<bits/stdc++.h>
#define pt printf(">>>")
#define mid (((l)+(r))/2)
using namespace std;
typedef long long ll;
typedef long double ld;
const ll N=1e6+10,inf=1e18+10,mod=1e9+7;
const ll dir[4][2]={{1,0},{-1,0},{0,1},{0,-1}};
ll n,cnt[26];
char s[N];
int main(){
cin >> n >> (s+1);
for(ll i=1;i<=n;i++)cnt[s[i]-'A']++;
for(ll i=0;i<26;i++)cout << cnt[i];
return 0;
}