結果
| 問題 | No.2024 Xer |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2022-08-01 11:53:38 |
| 言語 | C90(gcc15) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 895 bytes |
| 記録 | |
| コンパイル時間 | 1,141 ms |
| コンパイル使用メモリ | 25,396 KB |
| 最終ジャッジ日時 | 2026-02-24 01:09:23 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function 'radix_sort_aux':
main.c:10:9: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
10 | for(int i=0;i<256;++i){
| ^~~
main.c:10:9: note: use option '-std=c99', '-std=gnu99', '-std=c11' or '-std=gnu11' to compile your code
main.c:13:17: error: redefinition of 'i'
13 | for(int i=0;i<n;++i){
| ^
main.c:10:17: note: previous definition of 'i' with type 'int'
10 | for(int i=0;i<256;++i){
| ^
main.c:13:9: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
13 | for(int i=0;i<n;++i){
| ^~~
main.c:17:17: error: redefinition of 'i'
17 | for(int i=0;i<256;++i){
| ^
main.c:13:17: note: previous definition of 'i' with type 'int'
13 | for(int i=0;i<n;++i){
| ^
main.c:17:9: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
17 | for(int i=0;i<256;++i){
| ^~~
main.c:22:17: error: redefinition of 'i'
22 | for(int i=0;i<n;++i){
| ^
main.c:17:17: note: previous definition of 'i' with type 'int'
17 | for(int i=0;i<256;++i){
| ^
main.c:22:9: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
22 | for(int i=0;i<n;++i){
| ^~~
main.c: In function 'main':
main.c:4:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
4 | #define rep(v,e) for(long v=0;v<e;++v)
| ^~~
main.c:42:9: note: in expansion of macro 'rep'
42 | rep(i,n){
| ^~~
main.c:47:13: error: redefinition of 'i'
47 | rep(i,n-1){
| ^
main.c:4:27: note: in definition of macro 'rep'
4 | #define rep(v,e) for(long v=0;v<e;++v)
| ^
main.c:42:13: note: previous definition of 'i' with type 'lon
ソースコード
#pragma GCC optimize("Ofast")
#define rd() ({long _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})
#define rep(v,e) for(long v=0;v<e;++v)
typedef unsigned long ulong;
void radix_sort_aux(ulong*a,ulong*b,int n){
int c[256];
for(int i=0;i<256;++i){
c[i]=0;
}
for(int i=0;i<n;++i){
++c[a[i]&255];
}
int t=0;
for(int i=0;i<256;++i){
int u=c[i];
c[i]=t;
t+=u;
}
for(int i=0;i<n;++i){
b[c[a[i]&255]++]=a[i]>>8;
}
}
void radix_sort(ulong*a,int n){
static ulong b[200000];
radix_sort_aux(a,b,n);
radix_sort_aux(b,a,n);
radix_sort_aux(a,b,n);
radix_sort_aux(b,a,n);
}
ulong a[200000];
int main(){
char*mmap();
char*rp=mmap(0l,1l<<25,1,2,0,0ll);
long n=rd();
long x=rd();
rep(i,n){
long y=rd();
a[i]=y<<32|y+(y^x);
}
radix_sort(a,n);
rep(i,n-1){
if(a[i]>=(a[i+1]^x)|(a[i]^x)>=a[i+1]){
write(1,"No",2);
_exit(0);
}
}
write(1,"Yes",3);
_exit(0);
}
tails