結果
| 問題 | No.408 五輪ピック |
| コンテスト | |
| ユーザー |
FF256grhy
|
| 提出日時 | 2017-01-23 06:18:19 |
| 言語 | C90 (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 430 bytes |
| 記録 | |
| コンパイル時間 | 85 ms |
| コンパイル使用メモリ | 25,688 KB |
| 最終ジャッジ日時 | 2026-02-24 00:07:27 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function 'main':
main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
4 | scanf("%d%d",&n,&m);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | #define I for(int i=0;i<m;i++)
main.c:1:11: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
1 | #define I for(int i=0;i<m;i++)
| ^~~
main.c:5:9: note: in expansion of macro 'I'
5 | I scanf("%d%d",a+i,b+i),c[--b[i]]|=!--a[i],c[a[i]]|=!b[i];
| ^
main.c:1:11: note: use option '-std=c99', '-std=gnu99', '-std=c11' or '-std=gnu11' to compile your code
1 | #define I for(int i=0;i<m;i++)
| ^~~
main.c:5:9: note: in expansion of macro 'I'
5 | I scanf("%d%d",a+i,b+i),c[--b[i]]|=!--a[i],c[a[i]]|=!b[i];
| ^
main.c:1:19: error: redefinition of 'i'
1 | #define I for(int i=0;i<m;i++)
| ^
main.c:6:9: note: in expansion of macro 'I'
6 | I{
| ^
main.c:1:19: note: previous definition of 'i' with type 'int'
1 | #define I for(int i=0;i<m;i++)
| ^
main.c:5:9: note: in expansion of macro 'I'
5 | I scanf("%d%d",a+i,b+i),c[--b[i]]|=!--a[i],c[a[i]]|=!b[i];
| ^
main.c:1:11: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
1 | #define I for(int i=0;i<m;i++)
| ^~~
main.c:6:9: note: in expansion of macro 'I'
6 | I{
| ^
main.c:1:19: error: redefinition of 'i'
1 | #define I for(int i=0;i<m;i++)
| ^
main.c:10:9: note: in expansion of macro 'I'
10 | I{
| ^
main.c:1:19: note: previous definition of 'i' with type 'int'
1 | #define I for(int i=0;i<m;i++)
| ^
main.c:6:9: note: in expansion of macro 'I'
6 | I{
ソースコード
#define I for(int i=0;i<m;i++)
int n,m,a[50000],b[50000],c[20000],d[20000],e;
int main(){
scanf("%d%d",&n,&m);
I scanf("%d%d",a+i,b+i),c[--b[i]]|=!--a[i],c[a[i]]|=!b[i];
I{
if(a[i]&&c[b[i]])d[a[i]]=d[a[i]]==0?b[i]:-1;
if(b[i]&&c[a[i]])d[b[i]]=d[b[i]]==0?a[i]:-1;
}
I{
if(!d[a[i]]||!d[b[i]]||d[a[i]]==b[i]||d[b[i]]==a[i])continue;
if(d[a[i]]==-1||d[b[i]]==-1||d[a[i]]!=d[b[i]])e=1;
}
puts(e?"YES":"NO");
return 0;
}
FF256grhy