Submission #764775

# Submission time Handle Problem Language Result Execution time Memory
764775 2023-06-24T03:54:06 Z vjudge1 Roadside Advertisements (NOI17_roadsideadverts) C++17
7 / 100
36 ms 1292 KB
#include <iostream>


#define int long long
const int N = 1e5 + 78;
using namespace std;

string trans(int n , int k){
    string s = "";
    while(n != 0){
        int d = n % k;
        if(d < 10){
            s = to_string(d) + s;
        }
        else{
            s = char(d + 'A' - 10) + s;
        }
        n /= k;
    }
    return s;
}

void solve(){
	int n , q , sum = 0;
	cin >> n;
	for(int i = 1; i < n ; i++){
		int x , y , z;
		cin >> x >> y >> z;
		sum += z;
	}
	cin >> q;
	while(q--){
		cout << sum << '\n';
	}
}

main(){

    int t = 1;
    //cin >> t;
    while(t--){
		solve();
	}
}

Compilation message

roadsideadverts.cpp:38:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   38 | main(){
      | ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 1292 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 1036 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 36 ms 1292 KB Output isn't correct
3 Halted 0 ms 0 KB -