Submission #100975

# Submission time Handle Problem Language Result Execution time Memory
100975 2019-03-15T15:38:33 Z KLPP Wand (COCI19_wand) C++14
7 / 70
53 ms 2304 KB
#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;

int main(){
  int n,m;
  scanf("%d %d",&n,&m);
  int victory[n];
  int fail[n];
  for(int i=0;i<n;i++){
    victory[i]=0;
    fail[i]=0;
  }
  for(int i=0;i<m;i++){
    int x,y;
    scanf("%d %d",&x,&y);
    x--;y--;
    victory[x]++;
    fail[y]++;
  }
  for(int i=0;i<n;i++){
    if(victory[i]>0 || (victory[i]+fail[i]==0)){
      cout<<1;
    }else cout<<0;
  }cout<<endl;
  return 0;
}

Compilation message

wand.cpp: In function 'int main()':
wand.cpp:8:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d",&n,&m);
   ~~~~~^~~~~~~~~~~~~~~
wand.cpp:17:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",&x,&y);
     ~~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Output isn't correct
2 Correct 2 ms 384 KB Output is correct
3 Incorrect 34 ms 2168 KB Output isn't correct
4 Incorrect 36 ms 2168 KB Output isn't correct
5 Incorrect 42 ms 2132 KB Output isn't correct
6 Incorrect 32 ms 2176 KB Output isn't correct
7 Incorrect 53 ms 2168 KB Output isn't correct
8 Incorrect 49 ms 2168 KB Output isn't correct
9 Incorrect 34 ms 2300 KB Output isn't correct
10 Incorrect 40 ms 2304 KB Output isn't correct