답안 #211767

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
211767 2020-03-21T08:08:22 Z goodboy Potatoes and fertilizers (LMIO19_bulves) C++14
24 / 100
146 ms 4600 KB
#include <stdio.h> 
#include <math.h>
using namespace std;
 
int main() {
    int n , a , b;
    scanf("%d",&n);
	long long ans = 0 , prefix = 0;
    for (int i = 1; i <= n; i++) {
    	scanf("%d%d",&a,&b);
      	prefix += (a-b);
      	ans += abs(prefix);
  	}
  	printf("%lld\n",ans);
  	return 0;
}

Compilation message

bulves.cpp: In function 'int main()':
bulves.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
bulves.cpp:10:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
      scanf("%d%d",&a,&b);
      ~~~~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 15 ms 256 KB Output is correct
5 Correct 26 ms 256 KB Output is correct
6 Correct 75 ms 256 KB Output is correct
7 Correct 146 ms 256 KB Output is correct
8 Correct 114 ms 376 KB Output is correct
9 Correct 120 ms 4600 KB Output is correct
10 Correct 104 ms 2300 KB Output is correct
11 Correct 101 ms 2296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 15 ms 256 KB Output is correct
5 Correct 26 ms 256 KB Output is correct
6 Correct 75 ms 256 KB Output is correct
7 Correct 146 ms 256 KB Output is correct
8 Correct 114 ms 376 KB Output is correct
9 Correct 120 ms 4600 KB Output is correct
10 Correct 104 ms 2300 KB Output is correct
11 Correct 101 ms 2296 KB Output is correct
12 Incorrect 41 ms 2040 KB Output isn't correct
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Incorrect 4 ms 256 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Incorrect 4 ms 256 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Incorrect 4 ms 256 KB Output isn't correct
5 Halted 0 ms 0 KB -