結果
| 問題 | No.69 文字を自由に並び替え |
| コンテスト | |
| ユーザー |
Hissha_
|
| 提出日時 | 2018-04-02 10:23:56 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 486 bytes |
| 記録 | |
| コンパイル時間 | 243 ms |
| コンパイル使用メモリ | 40,740 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-05-25 01:00:29 |
| 合計ジャッジ時間 | 1,031 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:13:26: warning: NULL used in arithmetic [-Wpointer-arith]
13 | if(a[i]==NULL){
| ^~~~
ソースコード
#include <stdio.h>
int main(void) {
// your code goes here
char a[10], b[10];
char c;
int i, j, n, counta=0, countb=0;
scanf("%s", a);
scanf("%s", b);
for(i=0;i<11;i++){
if(a[i]==NULL){
n=i;
break;
}
}
for(i=0;i<n;i++){
c=a[i];
for(j=0;j<n;j++){
if(a[j]==c) counta++;
}
for(j=0;j<n;j++){
if(b[j]==c) countb++;
}
if(counta!=countb){
printf("%s\n","NO");
return 0;
}
counta=0;
countb=0;
}
printf("%s\n","YES");
return 0;
}
Hissha_