답안 #733796

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
733796 2023-05-01T10:24:56 Z vjudge1 Lightning Rod (NOI18_lightningrod) C++17
0 / 100
1763 ms 262144 KB
#include<bits/stdc++.h>

using namespace std;
using ll = long long;
int main() {
	int t, n, m, ans, i, z;
	
	cin >> n;
	ll x[n + 2], y[n + 2];
	cin >> x[1] >> y[1];
	ans = 1;
	for ( i = 2; i <= n; i ++) {
		scanf("%d %d",&x[i], &y[i]);
		if ( abs(x[i] - x[i - 1]) < abs(y[i]- y[i - 1])) ans ++;
	}
	cout << ans << endl;
}

Compilation message

lightningrod.cpp: In function 'int main()':
lightningrod.cpp:13:11: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'll*' {aka 'long long int*'} [-Wformat=]
   13 |   scanf("%d %d",&x[i], &y[i]);
      |          ~^     ~~~~~
      |           |     |
      |           int*  ll* {aka long long int*}
      |          %lld
lightningrod.cpp:13:14: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'll*' {aka 'long long int*'} [-Wformat=]
   13 |   scanf("%d %d",&x[i], &y[i]);
      |             ~^         ~~~~~
      |              |         |
      |              int*      ll* {aka long long int*}
      |             %lld
lightningrod.cpp:6:6: warning: unused variable 't' [-Wunused-variable]
    6 |  int t, n, m, ans, i, z;
      |      ^
lightningrod.cpp:6:12: warning: unused variable 'm' [-Wunused-variable]
    6 |  int t, n, m, ans, i, z;
      |            ^
lightningrod.cpp:6:23: warning: unused variable 'z' [-Wunused-variable]
    6 |  int t, n, m, ans, i, z;
      |                       ^
lightningrod.cpp:13:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   scanf("%d %d",&x[i], &y[i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1725 ms 262144 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1763 ms 252780 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1725 ms 262144 KB Output isn't correct
2 Halted 0 ms 0 KB -